/* =========================================================================
   مدير الاختصارات — نظام تصميم جديد كليًا (2.0)
   لغة بصرية عصرية: بطاقات مرفوعة، لمسة زجاجية، أيقونة بتدرّج لوني.
   وضعان فقط: نهاري (افتراضي) وليلي عبر [data-theme="dark"] على <html>.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* -------------------------------- 1) الرموز -------------------------------- */

:root {
    --bg: #f4f5fa;
    --surface: #ffffff;
    --surface-alt: #eef0f8;
    --surface-2: #e7e9f6;
    --ink: #13141c;
    --muted: #6b7180;
    --brand: #4f46e5;
    --brand-2: #06b6d4;
    --brand-dark: #4338ca;
    --brand-light: #ecebfd;
    --danger: #ef4444;
    --danger-light: #fde8e8;
    --success: #10b981;
    --success-light: #e3faf1;
    --warning: #f59e0b;
    --warning-light: #fef3e0;
    --info: #3b82f6;
    --info-light: #e8f1ff;
    --line: #e6e8f2;
    --shadow: 0 24px 48px -16px rgba(30, 34, 90, .18);
    --shadow-sm: 0 10px 24px -10px rgba(30, 34, 90, .14);
    --radius: 20px;
    --radius-sm: 13px;
    --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
}

[data-theme="dark"] {
    --bg: #0a0b11;
    --surface: #15161f;
    --surface-alt: #1c1e29;
    --surface-2: #232533;
    --ink: #eef0f7;
    --muted: #8d93a6;
    --brand: #8b85f6;
    --brand-2: #2dd4ee;
    --brand-dark: #756ff2;
    --brand-light: #23233f;
    --danger: #f87171;
    --danger-light: #2c1a1c;
    --success: #34d399;
    --success-light: #17281f;
    --warning: #fbbf24;
    --warning-light: #2c2313;
    --info: #60a5fa;
    --info-light: #17233a;
    --line: #262837;
    --shadow: 0 24px 50px -14px rgba(0, 0, 0, .6);
    --shadow-sm: 0 12px 26px -10px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* ------------------------------ 2) القاعدة ------------------------------ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    direction: rtl;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15.5px;
    transition: background .2s ease, color .2s ease;
}

a { color: inherit; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.2px; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------------------------- 3) شعار العلامة ---------------------------- */

.brand-icon {
    --size: 44px;
    width: var(--size);
    height: var(--size);
    border-radius: 13px;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 10px 22px -6px color-mix(in srgb, var(--brand) 55%, transparent);
}
.brand-icon i { font-size: 18px; }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: inline-block; }
.brand-lockup .brand-text h1 { font-size: 21px; color: var(--ink); line-height: 1.1; }
.brand-lockup .brand-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; }

/* ------------------------------ 4) الأزرار ------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--grad);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    line-height: 1.2;
    box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--brand) 65%, transparent);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 30px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:active { transform: translateY(0); }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 16px; font-size: 13.5px; border-radius: 10px; box-shadow: none; }

.btn-ghost {
    background: var(--surface-alt);
    color: var(--ink);
    border: 1.5px solid var(--line);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }

.btn-outline-brand {
    background: transparent;
    color: var(--brand);
    border: 1.5px solid var(--brand);
    box-shadow: none;
}
.btn-outline-brand:hover { background: var(--brand-light); box-shadow: none; }

.btn-danger { background: var(--danger); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--danger) 60%, transparent); }
.btn-warning { background: var(--warning); color: #241a05; box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--warning) 60%, transparent); }

.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: .15s ease;
}
.icon-btn:hover { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand); transform: translateY(-1px); }

.theme-toggle i { transition: transform .3s ease; }
.theme-toggle:hover i { transform: rotate(20deg); }

/* ------------------------------ 5) التنبيهات ------------------------------ */

.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.flash {
    display: flex; align-items: center; gap: 11px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    font-size: 14.5px;
    border: 1px solid var(--line);
}
.flash i { font-size: 18px; width: 20px; text-align: center; }
.flash.success { color: var(--success); background: var(--success-light); border-color: transparent; }
.flash.error, .flash.danger { color: var(--danger); background: var(--danger-light); border-color: transparent; }
.flash.warning { color: var(--warning); background: var(--warning-light); border-color: transparent; }
.flash.info { color: var(--info); background: var(--info-light); border-color: transparent; }

/* -------------------------------- 6) البطاقات -------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 28px; }

/* ---------------------------- 7) صفحة تسجيل الدخول ---------------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}
.auth-side {
    flex: 1 1 100%;
    background: radial-gradient(circle at 25% 20%, rgba(255,255,255,.16), transparent 45%), var(--grad);
    color: #fff;
    padding: 30px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    gap: 4px;
    transition: flex-basis .75s cubic-bezier(.65,0,.35,1), padding .75s cubic-bezier(.65,0,.35,1), text-align .1s;
}
.auth-side::-webkit-scrollbar { width: 6px; }
.auth-side::after {
    content: '';
    position: absolute; inset: -20% -20% auto auto; width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}
.auth-theme-toggle { position: absolute; top: 16px; inset-inline-end: 16px; z-index: 3; background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.auth-side .brand-icon { width: 50px; height: 50px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); box-shadow: none; margin-bottom: 6px; flex-shrink: 0; }
.auth-side .brand-icon i { font-size: 20px; }
.auth-landing-title { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.auth-tagline { font-size: 15.5px; font-weight: 700; max-width: 420px; line-height: 1.45; opacity: .95; margin: 0 auto; }
.auth-note { color: rgba(255,255,255,.85); font-size: 13px; max-width: 360px; font-weight: 500; }
.auth-side-foot { margin-top: 10px; flex-shrink: 0; }

.auth-landing-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: center; flex-shrink: 0; transition: opacity .25s, transform .25s; }
.auth-landing-btn { min-width: 160px; }
.auth-shell.opened .auth-landing-actions { opacity: 0; transform: translateY(8px); pointer-events: none; position: absolute; }

/* عرض شرائح متحركة (شبيهة بلقطات شاشة) لمحتوى الموقع في صفحة تسجيل الدخول */
.auth-preview {
    position: relative;
    margin-top: 14px;
    width: 100%;
    max-width: 400px;
    height: 210px;
    flex-shrink: 0;
    z-index: 1;
    transition: max-width .75s cubic-bezier(.65,0,.35,1);
}
.auth-preview-frame {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.97);
    border-radius: 14px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
    overflow: hidden;
    color: var(--ink, #13141c);
}
.auth-preview-frame .apf-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid #eceefa;
    background: #f7f8fd;
}
.auth-preview-frame .apf-bar span {
    width: 9px; height: 9px; border-radius: 50%; background: #dcdfef;
}
.auth-preview-frame .apf-bar span:nth-child(1) { background: #ff6159; }
.auth-preview-frame .apf-bar span:nth-child(2) { background: #ffbd2e; }
.auth-preview-frame .apf-bar span:nth-child(3) { background: #28c941; }
.auth-slide {
    position: absolute;
    inset: 0;
    top: 33px;
    padding: 12px 16px;
    opacity: 0;
    animation: authSlideCycle 16s infinite;
}
.auth-slide:nth-child(2) { animation-delay: 0s; }
.auth-slide:nth-child(3) { animation-delay: 4s; }
.auth-slide:nth-child(4) { animation-delay: 8s; }
.auth-slide:nth-child(5) { animation-delay: 12s; }
@keyframes authSlideCycle {
    0%   { opacity: 0; transform: translateY(10px) scale(.98); }
    3%   { opacity: 1; transform: translateY(0) scale(1); }
    22%  { opacity: 1; transform: translateY(0) scale(1); }
    28%  { opacity: 0; transform: translateY(-10px) scale(.98); }
    100% { opacity: 0; }
}
.auth-slide .as-title { font-size: 12.5px; font-weight: 800; color: #13141c; margin-bottom: 9px; display:flex; align-items:center; gap:8px; }
.auth-slide .as-title i { color: var(--brand); }
.auth-slide-img { padding: 0; }
.auth-slide-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.as-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.as-chip { background: #f0f1fb; border-radius: 9px; height: 34px; display:flex; align-items:center; justify-content:center; color:#8b85f6; font-size:14px; }
.as-row { display:flex; align-items:center; gap:9px; background:#f7f8fd; border-radius:9px; padding:7px 11px; margin-bottom:6px; font-size:12px; font-weight:700; color:#3a3d4d; }
.as-row i { color: var(--brand-2); }
.as-bar-track { background:#eceefa; border-radius:6px; height:7px; overflow:hidden; flex:1; }
.as-bar-fill { background: var(--grad); height:100%; border-radius:6px; }
.as-pkg { display:flex; gap:7px; }
.as-pkg-card { flex:1; border-radius:10px; padding:8px; text-align:center; background:#f7f8fd; border:1px solid #eceefa; }
.as-pkg-card.featured { background: var(--brand-light, #ecebfd); border-color: var(--brand); }
.as-pkg-card b { display:block; font-size:11px; color:#13141c; }
.as-pkg-card span { font-size:10px; color:#8a8fa3; }

.auth-form-wrap {
    flex: 0 0 0%;
    width: 0;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    transform: translateX(40px);
    transition: flex-basis .75s cubic-bezier(.65,0,.35,1), opacity .45s ease .2s, transform .5s ease .2s, padding .75s;
}
[dir="rtl"] .auth-form-wrap { transform: translateX(-40px); }

/* حالة "الانقسام" — تُضاف عبر JS عند الضغط على تسجيل دخول/إنشاء حساب:
   لقطات الشاشة والمقدّمة تنكمش لنصف الشاشة، ونموذج الدخول ينزلق من
   الجانب الآخر ويظهر بأنيميشن. */
.auth-shell.opened .auth-side { flex-basis: 50%; padding: 30px 40px; }
.auth-shell.opened .auth-preview { max-width: 340px; }
.auth-shell.opened .auth-form-wrap { flex-basis: 50%; width: auto; opacity: 1; transform: translateX(0); padding: 30px 40px; }
.auth-shell.opened.redirecting .auth-form-wrap { opacity: 0; } /* عند التوجه لصفحة إنشاء حساب: لا نُظهر نموذج الدخول */

.auth-shell.no-anim, .auth-shell.no-anim .auth-side, .auth-shell.no-anim .auth-form-wrap, .auth-shell.no-anim .auth-landing-actions { transition: none !important; }

.auth-card { width: 100%; max-width: 380px; position: relative; margin: auto; }
.auth-card h2 { font-size: 25px; margin-bottom: 5px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; font-weight: 500; }

@media (max-width: 860px) {
    .auth-shell { flex-direction: column; height: auto; min-height: 100vh; }
    .auth-side, .auth-shell.opened .auth-side { flex-basis: auto; max-height: none; padding: 30px 22px; }
    .auth-preview, .auth-shell.opened .auth-preview { max-width: 320px; }
    .auth-form-wrap, .auth-shell.opened .auth-form-wrap { flex-basis: auto; width: 100%; max-height: none; padding: 26px 22px; }
    .auth-shell:not(.opened) .auth-form-wrap { display: none; }
}
/* في الشاشات القصيرة: نصغّر الأنيميشن تدريجيًا بدل إخفائه كليًا، حتى يبقى
   ظاهرًا دائمًا مهما كان ارتفاع نافذة المتصفح. */
.auth-preview {
    height: clamp(120px, 24vh, 210px);
}
.auth-shell.opened .auth-preview {
    height: clamp(110px, 22vh, 210px);
}
@media (max-height: 620px) {
    .auth-side { padding-top: 14px; padding-bottom: 14px; gap: 2px; }
    .auth-side .brand-icon { width: 40px; height: 40px; margin-bottom: 2px; }
    .auth-side .brand-icon i { font-size: 16px; }
    .auth-landing-title { font-size: 21px; margin-bottom: 3px; }
    .auth-tagline { font-size: 13.5px; }
    .auth-note { display: none; }
    .auth-landing-actions { margin-top: 10px; }
}
@media (max-height: 460px) {
    .auth-preview { height: 0; opacity: 0; margin: 0; overflow: hidden; }
}

/* -------------------------------- 8) النماذج -------------------------------- */

.field { margin-bottom: 18px; }
.field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}
.field small.hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.field small.hint a { color: var(--brand); text-decoration: underline; }

.input, select.input, textarea.input,
input[type=text], input[type=password], input[type=email],
input[type=url], input[type=date], input[type=number], select, textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--surface-alt);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--brand-light);
}
input[type=color] { padding: 4px; height: 46px; cursor: pointer; }

.input-icon-wrap { position: relative; }
.input-icon-wrap i {
    position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 14px;
}
.input-icon-wrap input { padding-inline-start: 42px; }

.pw-toggle {
    position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px;
}

.checkbox-row { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; }
.checkbox-row input { width: auto; accent-color: var(--brand); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.perm-check {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s ease;
}
.perm-check:has(input:checked) { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.perm-check input { accent-color: var(--brand); }

/* ---------------------------------- 9) الهيدر العام ---------------------------------- */

.topbar {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    position: static;
    top: 14px;
    z-index: 20;
}  
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.notif-bell { position: relative; }
.count {
    background: var(--danger); color: #fff;
    border-radius: 50%; min-width: 18px; height: 18px;
    font-size: 10.5px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 3px;
}
.notif-bell .count {
    position: absolute; top: -6px; inset-inline-end: -6px;
    border: 2px solid var(--surface);
}
.sidebar-badge { position: static !important; margin-inline-start: auto; border-color: transparent !important; }

/* ---------------------------- 10) البحث + التصنيفات ---------------------------- */

.search-bar { position: relative; max-width: 440px; width: 100%; }
.search-bar i { position: absolute; inset-inline-start: 17px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-bar input { padding-inline-start: 44px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease;
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.category-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 15px;
}
.category-icon {
    width: 44px; height: 44px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 8px 18px -6px rgba(0,0,0,.25);
}
.category-header h3 { font-size: 17.5px; flex: 1; font-weight: 800; }
.count-pill {
    background: var(--surface-alt);
    color: var(--muted);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.sites-list { display: flex; flex-direction: column; gap: 8px; }
.site-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    background: var(--surface-alt);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    transition: .15s ease;
}
.site-item:hover { background: var(--brand-light); border-color: var(--brand); transform: translateX(-4px); }
.site-item i.site-icon {
    color: #fff;
    background: var(--grad);
    font-size: 13px; width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.site-info { flex: 1; min-width: 0; }
.site-name { font-weight: 700; font-size: 14.5px; }
.site-desc {
    font-size: 10px;
    color: var(--muted);

    white-space: normal;      /* يسمح بالنزول لسطر جديد */
    overflow-wrap: break-word;
    word-break: break-word;
}
.site-item .go { color: var(--muted); font-size: 13px; }

.empty-state { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; opacity: .5; }

/* ------------------------------- 11) الإشعارات ------------------------------- */

.notif-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 17px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    margin-bottom: 10px;
    border: 1.5px solid transparent;
}
.notif-item.unread { background: var(--brand-light); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.notif-head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.notif-head i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.notif-item.type-success .notif-head i { background: var(--success); }
.notif-item.type-warning .notif-head i { background: var(--warning); }
.notif-item.type-danger  .notif-head i { background: var(--danger); }
.notif-item.type-info    .notif-head i { background: var(--info); }
.notif-head strong { font-size: 15px; }
.notif-msg { color: var(--muted); font-size: 13.5px; margin-inline-start: 34px; }
.notif-meta { color: var(--muted); font-size: 12px; margin-inline-start: 34px; margin-top: 7px; }
.notif-actions { display: flex; gap: 8px; flex-shrink: 0; }
.new-tag { background: var(--grad); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }

/* --------------------------------- 12) لوحة الأدمن --------------------------------- */

.admin-shell { display: grid; grid-template-columns: 258px 1fr; height: 100vh; align-items: start; }

.sidebar {
    background: var(--surface);
    border-inline-end: 1px solid var(--line);
    color: var(--ink);
    height: 100vh;
    padding: 26px 18px;
    position: sticky;
    top: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar .brand-lockup { margin-bottom: 28px; padding-inline-start: 4px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 14.5px;
    transition: .15s ease;
}
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { background: var(--surface-alt); color: var(--ink); }
.sidebar-nav a.active { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--brand) 60%, transparent); }
.sidebar-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot a, .sidebar-foot button { color: var(--muted); font-size: 13.5px; text-decoration: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-family: inherit; font-weight: 600; }
.sidebar-foot a:hover, .sidebar-foot button:hover { color: var(--ink); background: var(--surface-alt); }

.admin-main { padding: 26px 32px 55px; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; gap: 14px; flex-wrap: wrap;
}
.admin-topbar h1 { font-size: 25px; }
.admin-topbar .crumb { color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 500; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; height: auto; }
    .sidebar { position: static; height: auto; max-height: none; overflow-y: visible; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-main { height: auto; overflow-y: visible; }
}

/* ------------------------------- 13) الإحصائيات ------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 15px;
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px; flex-shrink: 0;
    box-shadow: 0 10px 20px -8px rgba(0,0,0,.28);
}
.stat-card h3 { font-size: 25px; line-height: 1.1; }
.stat-card p { color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 500; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 22px; }
.split-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col, .split-col { grid-template-columns: 1fr; } }

/* --------------------------- 13ب) بطاقات باقات الاشتراك --------------------------- */

.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}
.pkg-card {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
}
.pkg-card.pkg-free { border-color: var(--success); background: var(--success-light); }
.pkg-card h4 { font-size: 15.5px; margin-top: 8px; }
.pkg-card .pkg-price { font-size: 21px; font-weight: 800; color: var(--brand); margin-top: 4px; }
.pkg-card.pkg-free .pkg-price { color: var(--success); }
.pkg-contents { margin-top: 10px; font-size: 12.5px; }
.pkg-contents strong { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.pkg-contents ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pkg-contents li { display: flex; align-items: center; gap: 6px; }
.pkg-contents li i { color: var(--brand); font-size: 11px; width: 14px; text-align: center; }

/* --------------------------- 13ج) الترتيب بالسحب والتثبيت (Pin) --------------------------- */

.drag-list { display: flex; flex-direction: column; gap: 8px; }
.drag-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: grab;
    font-size: 13.5px;
    font-weight: 600;
}
.drag-item.dragging { opacity: 0.4; }
.drag-item .drag-handle { color: var(--muted); cursor: grab; }
.drag-item img.site-icon-img { width: 20px; height: 20px; object-fit: contain; border-radius: 5px; }
.pin-btn { color: var(--muted); }
.pin-btn.pinned { color: var(--warning); }
.pin-btn.pinned i { transform: rotate(-35deg); display: inline-block; }

/* شعار الموقع كصورة (بديل أيقونة Font Awesome) في لوحة المشترك */
.site-item .site-icon-img {
    width: 30px; height:30px; object-fit: contain; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--line); padding: 3px; flex-shrink: 0;
}
.category-header .category-icon img { width: 22px; height: 22px; object-fit: contain; }
.pinned-badge { color: var(--warning); margin-inline-end: 4px; }

/* شرائح تصفية التصنيفات (البحث حسب التصنيف) */
.cat-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    border: 1.5px solid var(--line); background: var(--surface);
    font-size: 12.5px; font-weight: 700; color: var(--muted);
    cursor: pointer; transition: all .15s ease;
}
.cat-filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.cat-filter-chip.active { background: var(--grad); border-color: transparent; color: #fff; }

/* صف الموقع في لوحة المشترك: زر تثبيت شخصي أمام الرابط نفسه */

.site-row { display: flex; align-items: center; gap: 4px; }
.site-row .site-item { flex: 1; min-width: 0; }
.site-row .my-pin-btn { flex-shrink: 0; }
.site-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; box-shadow: 0 0 0 2px var(--surface); }
.site-status-dot.up { background: var(--success); }
.site-status-dot.down { background: var(--danger); }
.site-status-dot.unknown { background: var(--muted); opacity: .5; }

/* هيكل تحميل (Skeleton) يظهر مكان مواقع التصنيف قبل تحميلها الكسول */
.site-skeleton { height: 46px; border-radius: 10px; margin-bottom: 6px; background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line) 37%, var(--surface-alt) 63%); background-size: 400% 100%; animation: skeletonShine 1.4s ease infinite; }
@keyframes skeletonShine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.category-card.dragging { opacity: .4; }
.category-card .drag-handle { margin-inline-end: 2px; }

/* --------------------------- 14) حاسبة الأسعار بطراز نقطة البيع (POS) --------------------------- */

.pos-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) { .pos-layout { grid-template-columns: 1fr; } }

.pos-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pos-tab {
    padding: 7px 16px; border-radius: 999px;
    border: 1.5px solid var(--line); background: var(--surface);
    font-size: 12.5px; font-weight: 700; color: var(--muted);
    cursor: pointer; transition: all .15s ease; font-family: inherit;
}
.pos-tab:hover { border-color: var(--brand); color: var(--brand); }
.pos-tab.active { background: var(--grad); border-color: transparent; color: #fff; }

/* قائمة "أسعار خدماتي" الموحّدة (بدل عدة جداول منفصلة) */
.price-rows-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; padding-inline-end: 4px; }
.price-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-alt);
    transition: border-color .15s ease;
}
.price-row:hover { border-color: var(--brand); }
.price-row-icon {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-light, #ecebfd); color: var(--brand); font-size: 13.5px;
}
.price-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.price-row-name { font-weight: 700; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-row-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.price-row-input { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.price-row-input .input { width: 110px; padding: 8px 10px; text-align: center; }
.price-row-currency { font-size: 12px; color: var(--muted); font-weight: 700; }

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding: 2px;
}
.pos-item {
    background: var(--surface-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pos-item.has-qty { border-color: var(--brand); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-light); }
.pos-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.pos-item-name { font-size: 13px; font-weight: 700; line-height: 1.35; flex: 1; }
.pos-item-price { font-size: 17px; font-weight: 800; color: var(--brand); }
.pos-item-price small { font-size: 11px; font-weight: 700; color: var(--muted); }

.pos-qty-stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.qty-btn {
    width: 30px; height: 30px; border-radius: 9px; border: none;
    background: var(--surface); border: 1.5px solid var(--line);
    font-size: 17px; font-weight: 800; color: var(--brand);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: all .12s ease;
}
.qty-btn:hover { background: var(--grad); color: #fff; border-color: transparent; transform: scale(1.06); }
.qty-btn.minus:hover { background: var(--danger); }
.qty-val { font-size: 16px; font-weight: 800; min-width: 24px; text-align: center; }

.pos-cart {
    background: var(--surface-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
}
.pos-cart h4 { font-size: 14.5px; margin-bottom: 12px; }
.cart-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; min-height: 60px; }
.cart-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 11px;
}
.cart-row-name { font-size: 12.5px; font-weight: 700; }
.cart-remove { width: 26px; height: 26px; font-size: 11px; color: var(--danger); }
.cart-total-row {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1.5px dashed var(--line); margin-top: 14px; padding-top: 14px;
    font-weight: 800; font-size: 15px;
}
#calcTotal { font-size: 22px; color: var(--brand); }

/* --------------------------- 15) ودجة الدردشة مع الدعم الفني --------------------------- */

.chat-bubble {
    position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 999;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--grad); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer;
    box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--brand) 65%, transparent);
    transition: transform .15s ease;
}
.chat-bubble:hover { transform: scale(1.07); }
.chat-bubble .chat-badge {
    position: absolute; top: -4px; inset-inline-start: -4px;
    background: var(--danger); color: #fff; border: 2px solid var(--bg);
    border-radius: 50%; min-width: 20px; height: 20px; font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.chat-panel {
    position: fixed; bottom: 92px; inset-inline-end: 24px; z-index: 999;
    width: 340px; max-width: calc(100vw - 32px); height: 460px; max-height: 70vh;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-panel-head {
    background: var(--grad); color: #fff; padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.chat-panel-head strong { font-size: 14px; }
.chat-panel-head small { display: block; opacity: .85; font-size: 11px; font-weight: 500; }
.chat-panel-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: .9; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-alt); }
.chat-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.chat-msg.from-user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-left-radius: 4px; }
.chat-msg.from-admin { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.chat-msg time { display: block; font-size: 10px; opacity: .7; margin-top: 4px; }
.chat-empty { text-align: center; color: var(--muted); font-size: 12.5px; margin: auto; }
.chat-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input-row input {
    flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px;
    font-family: inherit; font-size: 13px; background: var(--surface-alt); color: var(--ink);
}
.chat-input-row button {
    width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--grad); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.chat-input-row #chatMicBtn { background: var(--surface-alt); color: var(--brand); border: 1.5px solid var(--line); }
.chat-input-row #chatAttachBtn { background: var(--surface-alt); color: var(--brand); border: 1.5px solid var(--line); }

.chat-msg audio { max-width: 220px; height: 34px; }
.chat-msg.from-user audio { filter: invert(1) grayscale(1) contrast(1.2); }
.chat-img { max-width: 180px; max-height: 180px; border-radius: 10px; display: block; cursor: zoom-in; object-fit: cover; }

.chat-recording-row {
    align-items: center; gap: 10px; padding: 10px 14px;
    border-top: 1px solid var(--line); background: var(--surface);
    font-size: 13px; font-weight: 700; color: var(--ink);
}
.chat-recording-row .rec-dot {
    width: 10px; height: 10px; border-radius: 50%; background: var(--danger);
    animation: recPulse 1.1s ease-in-out infinite;
}
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.chat-recording-row button {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff;
}
.chat-recording-row #chatRecCancel { background: var(--muted); margin-inline-start: auto; }
.chat-recording-row #chatRecStop { background: var(--grad); }

/* صندوق الدعم الفني في لوحة الأدمن */
.support-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; height: 640px; max-height: 75vh; }
@media (max-width: 900px) { .support-layout { grid-template-columns: 1fr; height: auto; } }
.support-conv-list { overflow-y: auto; }
.support-conv-item {
    display: block; text-decoration: none; color: var(--ink);
    padding: 11px 12px; border-radius: var(--radius-sm); margin-bottom: 6px;
    border: 1.5px solid transparent; transition: all .12s ease;
}
.support-conv-item:hover { background: var(--surface-alt); }
.support-conv-item.active { background: var(--brand-light); border-color: var(--brand); }
.support-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; font-size: 13.5px; }
.support-thread { display: flex; flex-direction: column; overflow: hidden; }
.support-thread-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }

/* --------------------------------- 14) الجداول --------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.table th {
    background: var(--surface-alt);
    color: var(--muted);
    text-align: right;
    padding: 13px 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 1px solid var(--line);
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-alt); }
.table .row-actions { display: flex; gap: 6px; }

.status-badge { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 800; display: inline-block; }
.status-active { background: var(--success-light); color: var(--success); }
.status-inactive { background: var(--danger-light); color: var(--danger); }
.tag-pill { display: inline-block; background: var(--brand-light); color: var(--brand-dark); padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; margin: 2px; }

.hidden-row { display: none !important; }
.inline-edit-row td { background: var(--surface-alt); padding: 18px 15px; }
.inline-edit-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-edit-form .field { margin-bottom: 0; min-width: 160px; flex: 1; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid var(--line); vertical-align: middle; }

/* --------------------------- بطاقات إدارة (بدل الجداول) --------------------------- */
.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.admin-item-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-item-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.aic-head { display: flex; align-items: flex-start; gap: 12px; }
.aic-icon {
    width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-light); color: var(--brand); font-size: 17px; overflow: hidden;
}
.aic-icon img { width: 100%; height: 100%; object-fit: cover; }
.aic-icon.aic-icon-contain img { object-fit: contain; padding: 6px; }
.aic-title-wrap { flex: 1; min-width: 0; }
.aic-title { font-weight: 800; font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-subtitle { font-size: 12px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.aic-body { font-size: 12.5px; color: var(--muted); line-height: 1.6; flex: 1; }
.aic-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aic-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.aic-foot .row-actions { display: flex; gap: 6px; }
.aic-link { color: var(--brand); font-weight: 700; font-size: 12.5px; text-decoration: none; }
.aic-link:hover { text-decoration: underline; }
.admin-item-card .inline-edit-row { grid-column: 1 / -1; }
.admin-item-card.hidden-row { display: none !important; }
.aic-edit-panel { background: var(--surface-alt); border-radius: 10px; padding: 14px; margin-top: 2px; }
.aic-edit-panel .inline-edit-form { display: flex; flex-direction: column; gap: 10px; }
.aic-edit-panel .field { margin-bottom: 0; }
.aic-empty-note { grid-column: 1 / -1; }

/* ----------------------------- 15) الإجراءات (لوحة أزرار) ----------------------------- */

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.action-tile {
    display: flex; flex-direction: column; align-items: center; gap: 11px;
    padding: 24px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    font-size: 13.5px;
    text-align: center;
    transition: .18s ease;
}
.action-tile .tile-icon {
    width: 44px; height: 44px; border-radius: 13px;
    background: var(--grad); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.action-tile:hover { border-color: var(--brand); transform: translateY(-4px); box-shadow: var(--shadow-sm); }

/* ------------------------------- 16) نماذج مستقلة ------------------------------- */

.form-container { max-width: 620px; margin: 26px auto; }
.form-container .back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); text-decoration: none; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.form-container h2 { margin-bottom: 22px; }

/* ----------------------------------- 17) عام ----------------------------------- */

.muted { color: var(--muted); }
.text-center { text-align: center; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.section-title h3 { font-size: 17.5px; display: flex; align-items: center; gap: 9px; font-weight: 800; }

/* -------------------------------- 18) استجابة -------------------------------- */

@media (max-width: 768px) {
    .container { padding: 18px 16px; }
    .categories-grid { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; position: static; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ---- دردشة الدعم: اسم وصورة الأدمن + بدء محادثة جديدة ---- */
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.chat-avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-light); color: var(--brand); font-size: 14px; }
.chat-head-agent { display: flex; align-items: center; gap: 10px; }
.chat-head-agent .chat-avatar { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,.55); }
.chat-row { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 92%; }
.chat-row .chat-msg { align-self: auto; max-width: 100%; }
.chat-agent-name { display: block; font-size: 11px; font-weight: 800; color: var(--brand); margin-bottom: 3px; }
.chat-msg.from-user .chat-agent-name { color: rgba(255,255,255,.9); }
.support-new-conv { position: relative; margin-bottom: 12px; }
.support-new-results {
    position: absolute; top: 100%; inset-inline: 0; z-index: 20; max-height: 240px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.support-new-item { display: flex; flex-direction: column; padding: 8px 12px; text-decoration: none; color: var(--ink); font-size: 13px; }
.support-new-item:hover { background: var(--surface-alt); }
.support-new-item .muted { font-size: 11.5px; }
