/* =========================================================================
   RadiusX — "Grid" Design System (dark, electric)
   -------------------------------------------------------------------------
   Deep black canvas, floating panels, white/silver type, and an electric
   X-blue energy accent that glows, pulses and sweeps. Tajawal + JetBrains
   Mono for numbers. RTL-first.
   ========================================================================= */

[hidden] { display: none !important; }
html { overflow-x: hidden; }

:root {
    /* ===== LIGHT THEME (default) ===== */
    --bg:         #eef1f6;
    --bg-2:       #e7ebf1;
    --surface:    #ffffff;
    --surface-2:  #f4f6f9;
    --surface-3:  #e9edf3;
    --border:     #e2e7ee;
    --border-2:   #cfd7e1;

    --text:       #0f172a;
    --text-muted: #5b6b7c;
    --text-dim:   #8b98a8;

    /* --- accent (deep X-blue) — overridable by [data-accent] --- */
    --accent:      #2563eb;
    --accent-2:    #3b82f6;
    --accent-deep: #1d4ed8;
    --glow:        rgba(37, 99, 235, 0.30);
    --glow-soft:   rgba(37, 99, 235, 0.10);

    --success: #0f9d6b; --success-bg: rgba(15,157,107,.12);
    --warning: #d97706; --warning-bg: rgba(217,119,6,.13);
    --danger:  #e11d48; --danger-bg:  rgba(225,29,72,.10);
    --info:    var(--accent); --info-bg: var(--glow-soft);

    --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px;
    --sidebar-w: 270px; --gap: 16px;

    --sh-sm: 0 1px 2px rgba(15,23,42,.06);
    --sh-md: 0 6px 22px -10px rgba(15,23,42,.20);
    --sh-glow: 0 0 0 1px var(--glow-soft), 0 10px 30px -14px var(--glow);
}

/* ===== DARK THEME ===== */
html[data-theme="dark"] {
    --bg:         #000000;
    --bg-2:       #060709;
    --surface:    #0e0f12;
    --surface-2:  #16181d;
    --surface-3:  #1c1f25;
    --border:     #23262d;
    --border-2:   #2e323b;

    --text:       #ffffff;
    --text-muted: #8b98a8;
    --text-dim:   #5a6472;

    --accent-2:    #45e6ff;
    --glow:        rgba(29, 155, 240, 0.35);
    --glow-soft:   rgba(29, 155, 240, 0.12);

    --success: #00ba7c; --success-bg: rgba(0,186,124,.12);
    --warning: #ffd400; --warning-bg: rgba(255,212,0,.12);
    --danger:  #f4212e; --danger-bg:  rgba(244,33,46,.12);

    --sh-sm: 0 1px 2px rgba(0,0,0,.5);
    --sh-md: 0 6px 22px -10px rgba(0,0,0,.8);
}

/* ===== ACCENT PRESETS (apply in both themes) ===== */
html[data-accent="emerald"] { --accent:#10b981; --accent-2:#34e0a1; --accent-deep:#059669; --glow:rgba(16,185,129,.32); --glow-soft:rgba(16,185,129,.10); }
html[data-accent="violet"]  { --accent:#8b5cf6; --accent-2:#c4b5fd; --accent-deep:#7c3aed; --glow:rgba(139,92,246,.32); --glow-soft:rgba(139,92,246,.10); }
html[data-accent="amber"]   { --accent:#f59e0b; --accent-2:#fcd34d; --accent-deep:#d97706; --glow:rgba(245,158,11,.32); --glow-soft:rgba(245,158,11,.10); }
html[data-accent="rose"]    { --accent:#f43f5e; --accent-2:#fb7185; --accent-deep:#e11d48; --glow:rgba(244,63,94,.32); --glow-soft:rgba(244,63,94,.10); }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent;
    font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif; }

.mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace !important;
    font-feature-settings: "tnum" 1; letter-spacing: 0; direction: ltr; unicode-bidi: plaintext; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-weight: 500;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s, color .3s;
}
/* electric ambient glow — dark theme only */
html[data-theme="dark"] body {
    background-image:
        radial-gradient(1200px 500px at 100% -10%, var(--glow-soft), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, var(--glow-soft), transparent 55%);
    background-attachment: fixed;
}
[dir="rtl"] * { letter-spacing: normal; }

a { text-decoration: none; color: inherit; transition: color .2s; }
button { cursor: pointer; border: 0; background: transparent; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1,h2,h3 { font-weight: 800; letter-spacing: -.02em; }
::selection { background: var(--glow); color: var(--text); }

* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: content-box; }

/* ===== Brand mark with electric pulse ==================================== */
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 900; font-size: 21px; letter-spacing: -.04em; color: var(--text); }
.brand .x {
    display: inline-grid; place-items: center; width: 36px; height: 36px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Crect%20width='64'%20height='64'%20rx='14'%20fill='%232563eb'/%3E%3Ccircle%20cx='32'%20cy='32'%20r='20'%20stroke='rgba(255,255,255,0.28)'%20stroke-width='2'%20fill='none'/%3E%3Cpath%20d='M24%2024%20L40%2040%20M40%2024%20L24%2040'%20stroke='%23ffffff'%20stroke-width='5'%20stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    color: transparent; border-radius: 8px; font-size: 0; position: relative;
}
html[data-theme="dark"] .brand .x { color: transparent; }
/* highlight only the X in the "RadiusX" wordmark (letters stay together) */
.brand .wx { color: var(--accent); }
html[data-theme="dark"] .brand .wx { color: var(--accent-2); }
@keyframes x-pulse {
    0%,100% { box-shadow: 0 0 0 1px var(--glow-soft), 0 0 18px -4px var(--glow); }
    50%     { box-shadow: 0 0 0 1px var(--glow), 0 0 30px 0 var(--glow); }
}

/* ===== App shell ========================================================= */
body.app-body { display: flex; }

.sidebar {
    width: var(--sidebar-w); position: fixed; inset-block: var(--gap); inset-inline-start: var(--gap);
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border); border-radius: var(--r-xl);
    display: flex; flex-direction: column; z-index: 1000;
    box-shadow: var(--sh-md);
    transition: transform .42s cubic-bezier(.22,1,.36,1);
    overflow: hidden;
}
/* electric top hairline */
.sidebar::before { content:""; position:absolute; inset-inline:24px; top:0; height:1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity:.6; }

.sidebar-header { padding: 22px 20px 14px; display: flex; align-items: center; gap: 12px; }
.sidebar-header .brand-text { line-height: 1.1; }
.sidebar-header .brand-text small { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 2px;
    color: var(--accent); text-transform: uppercase; margin-top: 4px; opacity: .9; }
.close-sidebar { margin-inline-start: auto; width: 32px; height: 32px; border-radius: 9px; color: var(--text-muted);
    display: none; align-items: center; justify-content: center; }
.close-sidebar:hover { color: var(--danger); background: var(--danger-bg); }

.sidebar-nav { padding: 6px 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--text-dim);
    text-transform: uppercase; padding: 16px 12px 7px; }

.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 13px;
    font-size: 14px; font-weight: 600; color: var(--text-muted);
    transition: background .2s, color .2s, transform .15s; position: relative; margin: 0 2px;
}
.nav-link i { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-link > span { flex: 1; }
.nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(-2px); }
[dir="ltr"] .nav-link:hover { transform: translateX(2px); }
.nav-link:hover i { opacity: 1; }
.nav-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff; font-weight: 800;
    box-shadow: 0 6px 20px -10px var(--glow);
}
.nav-link.active i { opacity: 1; color: #fff; }
/* dark theme keeps the subtler translucent treatment */
html[data-theme="dark"] .nav-link.active {
    background: linear-gradient(135deg, rgba(29,155,240,.22), rgba(29,155,240,.06));
    box-shadow: inset 0 0 0 1px rgba(29,155,240,.35), 0 6px 20px -10px var(--glow);
}
html[data-theme="dark"] .nav-link.active i { color: var(--accent-2); }
/* electric leading bar on active */
.nav-link.active::before { content:""; position:absolute; inset-block:9px; inset-inline-start:5px; width:3px; border-radius:99px;
    background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px var(--glow);
    animation: bar-glow 2s ease-in-out infinite; }
@keyframes bar-glow { 0%,100%{opacity:.7} 50%{opacity:1} }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 11px; padding: 10px; margin-bottom: 10px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.sidebar-user .avatar { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: 0 0 18px -4px var(--glow); }
.sidebar-user .who-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who-role { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.logout-btn { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px; border-radius: 13px;
    background: var(--surface-2); color: var(--danger); font-size: 13.5px; font-weight: 800; transition: .2s; width: 100%; }
.logout-btn:hover { background: var(--danger-bg); }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    z-index: 999; opacity: 0; visibility: hidden; transition: .3s; }
.sidebar-overlay.show { opacity: 1; visibility: visible; }

.main-wrapper { flex: 1; margin-inline-start: calc(var(--sidebar-w) + var(--gap) * 2); min-width: 0; }
.content { padding: 26px 30px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.mobile-fab { display: none; position: fixed; top: 16px; inset-inline-start: 16px; width: 46px; height: 46px;
    border-radius: 14px; background: var(--surface); color: var(--accent); border: 1px solid var(--border);
    box-shadow: var(--sh-md); z-index: 95; align-items: center; justify-content: center; }
.mobile-fab:hover { background: var(--surface-2); }

.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang-toggle a { padding: 6px 12px; font-size: 13px; font-weight: 800; color: var(--text-muted); }
.lang-toggle a.active { background: var(--accent); color: #fff; }

/* ===== Breadcrumb + page header ========================================= */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .current { color: var(--accent); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 13.5px; }

/* ===== Stat cards ======================================================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 18px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s; }
.stat-card::after { content:""; position:absolute; inset-inline-end:-40px; top:-40px; width:120px; height:120px;
    background: radial-gradient(circle, var(--glow-soft), transparent 70%); opacity:0; transition:opacity .3s; }
.stat-card:hover { border-color: var(--border-2); transform: translateY(-3px); box-shadow: var(--sh-glow); }
.stat-card:hover::after { opacity: 1; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); }
.stat-icon i { width: 22px; height: 22px; }
.stat-info h3 { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.stat-info .value { font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -.02em;
    font-family: "JetBrains Mono", ui-monospace, monospace; }
.stat-info .sub { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
/* colored stat icons */
.stat-icon.green { color: var(--success); } .stat-icon.amber { color: var(--warning); }
.stat-icon.red { color: var(--danger); } .stat-icon.blue { color: var(--accent); }

/* ===== Card panel ======================================================== */
.card-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.card-panel + .card-panel { margin-top: 16px; }
.card-panel-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.card-panel-header h2 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.card-panel-header h2 i { color: var(--accent); width: 18px; height: 18px; }

/* ===== Tables ============================================================ */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 620px; }
th { text-align: start; padding: 11px 14px; background: var(--surface-2); color: var(--text-muted);
    font-size: 11.5px; font-weight: 800; white-space: nowrap; border-bottom: 1px solid var(--border); }
th:first-child { border-start-start-radius: var(--r-sm); }
th:last-child { border-start-end-radius: var(--r-sm); }
td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 500; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 44px 16px; }

/* ===== Badges ============================================================ */
.badge { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border); }
.badge::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.badge--active    { color: var(--success); border-color: rgba(0,186,124,.3);  background: var(--success-bg); }
.badge--suspended { color: var(--warning); border-color: rgba(255,212,0,.3);  background: var(--warning-bg); }
.badge--expired   { color: var(--danger);  border-color: rgba(244,33,46,.3);  background: var(--danger-bg); }

/* ===== Buttons =========================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
    border-radius: 13px; font-size: 13.5px; font-weight: 800; border: 1px solid transparent; cursor: pointer;
    transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .2s, background .2s, filter .2s, border-color .2s; }
.btn i { width: 17px; height: 17px; }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
    box-shadow: 0 8px 22px -10px var(--glow); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px var(--glow); filter: brightness(1.07); }
.btn--primary:active { transform: translateY(0); }
.btn--white { background: #fff; color: #000; }
.btn--white:hover { transform: translateY(-2px); filter: brightness(.92); }
.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--border-2); transform: translateY(-1px); }
.btn--danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(244,33,46,.3); }
.btn--danger:hover { background: var(--danger); color: #fff; transform: translateY(-1px); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 12.5px; border-radius: 10px; }
.btn--lg { padding: 15px 28px; font-size: 16px; border-radius: 15px; }

.action-btns { display: flex; gap: 6px; align-items: center; }
.btn-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; transition: .18s;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); }
.btn-icon i { width: 17px; height: 17px; }
.btn-icon:hover { transform: translateY(-2px); border-color: var(--border-2); }
.btn-icon.edit { color: var(--accent); }
.btn-icon.edit:hover { background: var(--info-bg); }
.btn-icon.delete { color: var(--danger); }
.btn-icon.delete:hover { background: var(--danger-bg); }
.btn-icon.toggle { color: var(--warning); }
.btn-icon.toggle:hover { background: var(--warning-bg); }

/* ===== Forms ============================================================= */
.form { max-width: 620px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: var(--text); }
.form-control { width: 100%; padding: 13px 15px; border-radius: 13px; border: 1px solid var(--border);
    background: var(--surface-2); font-size: 14.5px; font-weight: 500; color: var(--text); outline: none; transition: .2s; font-family: inherit; }
.form-control:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--glow-soft); }
.form-control::placeholder { color: var(--text-dim); }
/* RTL consistency: even LTR-value fields (username, IP, rate…) anchor to the
   start side so the caret begins on the right like the rest of the form. */
[dir="rtl"] .form-control { text-align: right; }
[dir="rtl"] input[type="date"].form-control,
[dir="rtl"] select.form-control { text-align: right; }
.form-control[dir="ltr"] { direction: ltr; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.6; }
.form-err { color: var(--danger); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ===== Alerts / flash ==================================================== */
.alert { padding: 13px 18px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 700;
    display: flex; align-items: center; gap: 10px; margin-bottom: 20px; border: 1px solid transparent; }
.alert i { width: 18px; height: 18px; flex-shrink: 0; }
.alert--success { background: var(--success-bg); color: var(--success); border-color: rgba(0,186,124,.25); }
.alert--danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(244,33,46,.25); }
.alert--info    { background: var(--info-bg);    color: var(--info);    border-color: var(--glow-soft); }

/* ===== Filters =========================================================== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.empty-link { color: var(--accent); font-weight: 800; }
.muted { color: var(--text-muted); }

/* ===== Toasts / spinner ================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
.cc-spin { animation: spin .8s linear infinite; display: inline-grid; }
.toast-container { position: fixed; top: 22px; inset-inline-start: 22px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-inline-start: 3px solid var(--accent);
    padding: 13px 18px; border-radius: 13px; box-shadow: var(--sh-md); display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 13px; animation: toastIn .45s cubic-bezier(.22,1,.36,1); transition: opacity .5s; }
.toast.success { border-inline-start-color: var(--success); }
.toast.danger { border-inline-start-color: var(--danger); }
@keyframes toastIn { from { transform: translateX(-110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast .toast-close { margin-inline-start: 6px; color: var(--text-dim); cursor: pointer; display: grid; place-items: center; }
.toast .toast-close i { width: 15px; height: 15px; }

/* ===== Confirm modal =================================================== */
.rx-modal-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.rx-modal-overlay.open { opacity: 1; visibility: visible; }
.rx-modal { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 28px 26px; box-shadow: 0 34px 70px -24px rgba(0,0,0,.5); text-align: center;
    transform: translateY(14px) scale(.97); transition: transform .22s cubic-bezier(.22,1,.36,1); }
.rx-modal-overlay.open .rx-modal { transform: none; }
.rx-modal-ic { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
    background: var(--danger-bg); color: var(--danger); }
.rx-modal-ic.info { background: var(--glow-soft); color: var(--accent); }
.rx-modal-ic i { width: 28px; height: 28px; }
.rx-modal h3 { font-size: 19px; font-weight: 900; margin-bottom: 8px; }
.rx-modal p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; word-break: break-word; }
.rx-modal-actions { display: flex; gap: 10px; }
.rx-modal-actions .btn { flex: 1; justify-content: center; }

/* ===== Impersonation bar =============================================== */
.impersonation-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
    padding: 10px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-weight: 700; font-size: 13.5px;
    box-shadow: 0 8px 22px -12px var(--glow); }
.impersonation-bar i { width: 16px; height: 16px; vertical-align: -3px; }
.impersonation-bar strong { font-weight: 900; }

/* ===== "Powered by DevX" badge ========================================= */
.powered-by { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
    font-size: 12px; font-weight: 700; transition: .18s; white-space: nowrap; }
.powered-by:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); }
.powered-by .dx-mark { border-radius: 6px; flex-shrink: 0; }
.powered-by strong { color: var(--accent); font-weight: 800; }
.powered-by.pb-block { display: flex; justify-content: center; width: 100%; background: transparent; border: 0; }
.powered-by.pb-footer { background: transparent; border: 0; padding: 0; }

/* ===== Code block (router scripts) ===================================== */
.codeblock { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 16px 18px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px;
    line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; direction: ltr;
    text-align: left; overflow-x: auto; }
html[data-theme="dark"] .codeblock { background: #06070a; }

/* ===== Ticket thread ===================================================== */
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.msg { max-width: 78%; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }
.msg .meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.msg .body { font-size: 14px; white-space: pre-wrap; line-height: 1.7; }
.msg.mine { align-self: flex-start; border-color: rgba(29,155,240,.4); background: linear-gradient(135deg, rgba(29,155,240,.16), rgba(29,155,240,.05)); }
.msg.them { align-self: flex-end; }
.msg .role-chip { font-size: 10px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); }

/* ===== Appearance panel (theme + accent) =============================== */
.appearance-fab { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 48px; height: 48px;
    border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
    display: grid; place-items: center; box-shadow: 0 8px 24px -8px var(--glow); z-index: 90; border: 0;
    transition: transform .2s; }
.appearance-fab:hover { transform: rotate(30deg) scale(1.06); }
.appearance-fab i { width: 22px; height: 22px; }
.appearance-panel { position: fixed; bottom: 80px; inset-inline-end: 22px; width: 260px; z-index: 91;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px;
    box-shadow: var(--sh-md); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .22s; }
.appearance-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ap-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.ap-title i { color: var(--accent); }
.ap-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 8px; }
.ap-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-theme { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px; border-radius: var(--r-md);
    border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--text); transition: .15s; }
.ap-theme:hover { border-color: var(--border-2); }
.ap-theme.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }
.ap-prev { width: 100%; height: 30px; border-radius: 7px; overflow: hidden; display: flex; border: 1px solid var(--border); }
.ap-prev span { flex: 1; } .ap-prev span:first-child { flex: 0 0 34%; }
.ap-prev.light { background: #fff; } .ap-prev.light span:first-child { background: #eef1f6; }
.ap-prev.dark { background: #0e0f12; } .ap-prev.dark span:first-child { background: #000; }
.ap-prev.dark span:last-child, .ap-prev.light span:last-child { box-shadow: inset 0 6px 0 var(--accent); }
.ap-accents { display: flex; gap: 10px; }
.ap-swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 2px solid transparent; cursor: pointer; transition: .15s; outline: 2px solid var(--border); outline-offset: 2px; }
.ap-swatch:hover { transform: scale(1.12); }
.ap-swatch.on { outline-color: var(--sw); border-color: var(--surface); }
.ap-hint { font-size: 11px; color: var(--text-dim); margin-top: 14px; }
@media (max-width: 992px){ .appearance-fab { bottom: 16px; inset-inline-end: 76px; } }

/* ===== Mini bar chart (CSS-only, no JS lib) ============================= */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 8px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 7px 7px 0 0; position: relative;
    background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 14px -4px var(--glow);
    transition: filter .15s; min-height: 4px; animation: barRise .6s cubic-bezier(.22,1,.36,1) both; }
.chart-col:hover .chart-bar { filter: brightness(1.15); }
.chart-bar .chart-val { position: absolute; top: -18px; inset-inline: 0; text-align: center; font-size: 11px; font-weight: 800; color: var(--text); }
.chart-lbl { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
@keyframes barRise { from { transform: scaleY(0); transform-origin: bottom; opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* ===== Live chat ======================================================== */
.chatbox { display: flex; flex-direction: column; height: 60vh; min-height: 380px; }
.chat-stream { flex: 1; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 72%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.chat-msg .meta { font-size: 10.5px; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; }
.chat-msg .body { font-size: 14px; white-space: pre-wrap; line-height: 1.6; }
.chat-msg.mine { align-self: flex-start; border-color: rgba(29,155,240,.35); background: linear-gradient(135deg, var(--glow-soft), transparent); }
.chat-msg.them { align-self: flex-end; }
.chat-input { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.chat-input textarea { flex: 1; resize: none; }
.chat-empty { margin: auto; color: var(--text-muted); text-align: center; }

/* ===== Info rows (key/value) ============================================ */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; }
.kv .item { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: var(--surface-2); }
.kv .item .k { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.kv .item .v { font-size: 18px; font-weight: 800; }

/* ===== Pagination ======================================================== */
.pagination { display: flex; gap: 6px; margin-top: 20px; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; background: var(--surface); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Entrance animations (stagger) ==================================== */
.content > * { animation: riseIn .5s cubic-bezier(.22,1,.36,1) both; }
.content > *:nth-child(1){animation-delay:.02s} .content > *:nth-child(2){animation-delay:.07s}
.content > *:nth-child(3){animation-delay:.12s} .content > *:nth-child(4){animation-delay:.17s}
.stats-grid .stat-card { animation: riseIn .55s cubic-bezier(.22,1,.36,1) both; }
.stats-grid .stat-card:nth-child(1){animation-delay:.05s} .stats-grid .stat-card:nth-child(2){animation-delay:.11s}
.stats-grid .stat-card:nth-child(3){animation-delay:.17s} .stats-grid .stat-card:nth-child(4){animation-delay:.23s}
.stats-grid .stat-card:nth-child(5){animation-delay:.29s} .stats-grid .stat-card:nth-child(6){animation-delay:.35s}
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

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

/* =========================================================================
   "X-Enterprise" touches (adopted from laravel_node_js.html identity)
   Gradient card surfaces + signature side accent bar + Enterprise pill.
   Keeps the electric-blue accent.
   ========================================================================= */
.stat-card, .card-panel, .lp-feature, .price-card, .kv .item, .auth-card, .msg {
    background-image: linear-gradient(150deg, var(--surface) 0%, var(--bg-2) 100%);
}
/* signature vertical accent bar on content panels */
.card-panel { position: relative; overflow: hidden; }
.card-panel::before {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
    background: linear-gradient(180deg, var(--accent), transparent 85%);
    opacity: .6;
}
/* subtle white lift on hover (the file's .glow), layered with the blue */
.stat-card:hover, .lp-feature:hover, .price-card:hover {
    box-shadow: var(--sh-glow), 0 0 18px -6px rgba(255,255,255,.08);
}
/* Enterprise brand pill */
.brand .tag {
    font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
    border: 1px solid var(--border-2); color: var(--text-muted);
    padding: 2px 9px; border-radius: 999px; margin-inline-start: 2px; align-self: center;
}

/* ===== Responsive ======================================================== */
@media (max-width: 992px) {
    .sidebar { inset-block: 0; inset-inline-start: 0; border-radius: 0; transform: translateX(-110%); }
    [dir="rtl"] .sidebar { transform: translateX(110%); }
    .sidebar.show { transform: translateX(0); }
    .close-sidebar { display: flex; }
    .main-wrapper { margin-inline-start: 0; }
    .mobile-fab { display: flex; }
    .content { padding: 76px 18px 48px; }
}
@media (max-width: 768px) {
    .content { padding: 74px 16px 48px; }
    .page-header h2 { font-size: 22px; }
    .kv { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .content { padding: 72px 13px 44px; }
    .form-row, .form-row.three { grid-template-columns: 1fr; gap: 14px; }

    .page-header { gap: 12px; }
    .page-header h2 { font-size: 20px; }
    .page-header p { font-size: 12.5px; }
    .page-header > .btn { width: 100%; }              /* full-width, easy-tap actions */

    .stats-grid { gap: 12px; }
    .card-panel { padding: 15px; }
    .kv { grid-template-columns: 1fr; }
    .filters { gap: 8px; }
    .filters > * { flex: 1 1 140px; }
    .btn-icon { width: 40px; height: 40px; }          /* touch target */
    .badge { padding: 3px 9px; font-size: 10.5px; }

    /* Data tables: tighter cells + pin the identifier column while scrolling */
    table { min-width: 560px; }
    th { padding: 9px 10px; font-size: 11px; }
    td { padding: 11px 10px; font-size: 12.5px; }
    .table-responsive table th:first-child,
    .table-responsive table td:first-child {
        position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--border);
    }
    [dir="rtl"] .table-responsive table th:first-child,
    [dir="rtl"] .table-responsive table td:first-child {
        left: auto; right: 0; box-shadow: -1px 0 0 var(--border);
    }
    .table-responsive table th:first-child { background: var(--surface-2); }
    .table-responsive table tbody tr:hover td:first-child { background: var(--surface-2); }

    /* Keep the floating gear clear of full-width bottom actions */
    .appearance-fab { bottom: 14px; inset-inline-end: 14px; }
}

/* =========================================================================
   Landing page (electric)
   ========================================================================= */
.lp-body { background: var(--bg); }
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); }
html[data-theme="dark"] .lp-nav { background: rgba(0,0,0,.7); }
.lp-nav .links { display: flex; align-items: center; gap: 22px; }
.lp-nav .links a.txt { color: var(--text-muted); font-weight: 700; }
.lp-nav .links a.txt:hover { color: var(--text); }

.lp-hero { position: relative; overflow: hidden; text-align: center; padding: 110px 24px 90px; }
/* animated electric orbs + grid */
.lp-hero::before { content:""; position:absolute; inset:0; z-index:0;
    background:
        radial-gradient(600px 300px at 50% 0%, rgba(29,155,240,.25), transparent 60%),
        radial-gradient(500px 400px at 85% 30%, rgba(69,230,255,.12), transparent 60%),
        radial-gradient(500px 400px at 15% 60%, rgba(29,155,240,.10), transparent 60%);
    animation: orb-float 9s ease-in-out infinite alternate; }
.lp-hero::after { content:""; position:absolute; inset:0; z-index:0; opacity:.4;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px; mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%); }
@keyframes orb-float { from { transform: translateY(-10px) scale(1); } to { transform: translateY(14px) scale(1.05); } }
.lp-hero > * { position: relative; z-index: 1; }
.lp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px;
    border: 1px solid var(--border-2); background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; margin-bottom: 26px; }
.lp-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: bar-glow 1.6s infinite; }
.lp-hero h1 { font-size: 60px; line-height: 1.08; font-weight: 900; max-width: 880px; margin: 0 auto 20px; }
.lp-hero h1 .grad { background: linear-gradient(120deg, var(--text) 15%, var(--accent-deep) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="dark"] .lp-hero h1 .grad { background: linear-gradient(120deg, #fff 20%, var(--accent-2) 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; }
.lp-hero .lead { color: var(--text-muted); font-size: 19px; max-width: 660px; margin: 0 auto 34px; }
.lp-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.lp-section { max-width: 1120px; margin: 0 auto; padding: 80px 24px; }
.lp-section .eyebrow { text-align: center; color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.lp-section h2 { font-size: 38px; text-align: center; margin: 12px 0 8px; }
.lp-section .sub { text-align: center; color: var(--text-muted); margin-bottom: 48px; font-size: 17px; }
.lp-features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.lp-feature { border: 1px solid var(--border); background: var(--surface); padding: 28px; border-radius: var(--r-lg); transition: .25s; }
.lp-feature:hover { border-color: var(--border-2); transform: translateY(-4px); box-shadow: var(--sh-glow); }
.lp-feature .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); }
.lp-feature .ic i { width: 24px; height: 24px; }
.lp-feature h3 { font-size: 19px; margin-bottom: 9px; }
.lp-feature p { color: var(--text-muted); }

.lp-pricing { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.price-card { border: 1px solid var(--border); background: var(--surface); padding: 30px; border-radius: var(--r-lg); display: flex; flex-direction: column; position: relative; transition: .25s; }
.price-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.price-card.featured { border-color: var(--accent); box-shadow: var(--sh-glow); }
.price-card .tag { position: absolute; top: -12px; inset-inline-start: 24px; font-size: 11px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; padding: 4px 12px; border-radius: 999px; box-shadow: 0 0 18px -4px var(--glow); }
.price-card .tier { font-weight: 800; font-size: 18px; }
.price-card .amount { font-size: 44px; font-weight: 900; margin: 14px 0 2px; font-family: "JetBrains Mono", monospace; }
.price-card .per { color: var(--text-muted); font-size: 14px; }
.price-card ul { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.price-card li { color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
.price-card li i { width: 17px; height: 17px; color: var(--success); flex-shrink: 0; }

.lp-final { text-align: center; padding: 100px 24px; border-top: 1px solid var(--border); position: relative; overflow: hidden; }
.lp-final::before { content:""; position:absolute; inset:0; background: radial-gradient(700px 300px at 50% 100%, rgba(29,155,240,.18), transparent 65%); }
.lp-final > * { position: relative; }
.lp-final h2 { font-size: 40px; margin-bottom: 12px; }
.lp-final p { color: var(--text-muted); font-size: 18px; margin-bottom: 30px; }
.lp-footer { border-top: 1px solid var(--border); padding: 28px 40px; color: var(--text-dim);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; }

@media (max-width: 640px) {
    .lp-hero h1 { font-size: 40px; }
    .lp-nav { padding: 14px 18px; }
    .lp-nav .links { gap: 12px; }
    .lp-nav .links a.txt { display: none; }
    .lp-section { padding: 56px 20px; }
    .lp-section h2 { font-size: 30px; }
}
