/*======================================================================*\
|| #################################################################### ||
|| #                         NEDAL SOFTWARE                            # ||
|| # ---------------------------------------------------------------- # ||
|| # Developed by: Nedal Hussein Al Masseri                           # ||
|| # Website: https://www.nedalshield.com                               # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright © 2026 Nedal Hussein Al Masseri                        # ||
|| # All Rights Reserved.                                             # ||
|| #                                                                  # ||
|| # Unauthorized copying, modification, redistribution, or resale    # ||
|| # is strictly prohibited without prior written permission.         # ||
|| #################################################################### ||
\*======================================================================*/

:root {
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-soft: #eef4fb;
    --border: #dbe5f0;
    --text: #122033;
    --muted: #64748b;
    --primary: #0b4ea2;
    --primary-dark: #08396f;
    --success: #16814b;
    --danger: #c0392b;
    --shadow: 0 10px 30px rgba(24, 45, 75, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", Arial, Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    background: linear-gradient(180deg, #082f5f 0%, #0b4ea2 100%);
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    font-size: 22px;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 18px;
}

.brand span {
    margin-top: 3px;
    font-size: 13px;
    opacity: 0.76;
}

.sidebar-nav {
    margin-top: 22px;
    display: grid;
    gap: 7px;
}

.nav-item {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.main-content {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1,
.topbar p,
.section-header h2,
.section-header p {
    margin: 0;
}

.topbar h1 {
    font-size: 28px;
}

.topbar p,
.section-header p {
    margin-top: 6px;
    color: var(--muted);
}

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

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #e9f8f0;
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(22, 129, 75, 0.12);
}

.icon-button,
.secondary-button,
.action-card {
    border: 0;
    cursor: pointer;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.panel-section {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.stat-card {
    padding: 20px;
}

.stat-label,
.stat-description {
    display: block;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.stat-value {
    display: block;
    margin: 10px 0 6px;
    font-size: 30px;
}

.stat-value.small {
    font-size: 24px;
}

.stat-value.success {
    color: var(--success);
}

.stat-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.panel-section {
    margin-top: 18px;
    padding: 22px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 20px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.action-card {
    text-align: right;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 18px;
    border-radius: 14px;
    color: var(--text);
    transition: 0.18s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: #b8cce2;
}

.action-card.danger {
    background: #fff2f0;
    border-color: #f1cbc6;
}

.action-card strong,
.action-card small {
    display: block;
}

.action-card strong {
    margin: 10px 0 5px;
}

.action-card small {
    color: var(--muted);
    line-height: 1.6;
}

.action-icon {
    font-size: 24px;
}

.secondary-button {
    background: var(--surface-soft);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 38px 18px;
    border: 1px dashed #c6d4e4;
    border-radius: 14px;
    background: #fbfdff;
}

.empty-state strong,
.empty-state p {
    display: block;
}

.empty-state strong {
    margin-top: 10px;
}

.empty-state p {
    margin: 7px 0 0;
    color: var(--muted);
}

.empty-icon {
    font-size: 32px;
}

@media (max-width: 1050px) {
    .dashboard-grid,
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-content {
        padding: 18px;
    }

    .topbar,
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.nav-group {
    border-radius: 12px;
    overflow: hidden;
}

.nav-group-title {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.18s ease;
}

.nav-group-title::-webkit-details-marker {
    display: none;
}

.nav-group-title:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.nav-arrow {
    font-size: 16px;
    transition: transform 0.18s ease;
}

.nav-group[open] .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: grid;
    gap: 5px;
    padding: 4px 8px 8px;
}

.nav-subitem {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.18s ease;
}

.nav-subitem:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(11, 78, 162, 0.16), transparent 34%),
        linear-gradient(135deg, #eef4fb 0%, #f8fbff 100%);
}

.login-card {
    width: min(100%, 430px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(24, 45, 75, 0.14);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.login-brand strong,
.login-brand span {
    display: block;
}

.login-brand strong {
    font-size: 19px;
}

.login-brand span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.login-heading {
    margin: 24px 0 18px;
}

.login-heading h1,
.login-heading p {
    margin: 0;
}

.login-heading h1 {
    font-size: 25px;
}

.login-heading p {
    margin-top: 7px;
    color: var(--muted);
    line-height: 1.7;
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #f1cbc6;
    border-radius: 12px;
    background: #fff2f0;
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
}

.login-form label span {
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fbfdff;
    color: var(--text);
    outline: none;
    transition: 0.18s ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 78, 162, 0.10);
}

.login-form button {
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    background: linear-gradient(135deg, var(--primary), #1675d1);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--danger);
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: 0.18s ease;
}

.logout-button:hover {
    background: #fff2f0;
}

/* Sidebar polish: clearer brand + readable expanded menu */
.sidebar .brand {
    align-items: center;
}

.sidebar .brand > div:last-child {
    text-align: center;
    flex: 1;
}

.sidebar .brand strong {
    display: block;
    font-size: 23px;
    line-height: 1.15;
}

.sidebar .brand span {
    display: block;
    margin-top: 7px;
    font-size: 18px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.88);
}

.sidebar .nav-item,
.sidebar .nav-group-title,
.sidebar .nav-subitem {
    font-size: 18px;
    font-weight: 800;
}

.sidebar .nav-subitem {
    color: rgba(255, 255, 255, 0.82);
    padding: 12px 18px;
    border-radius: 12px;
}

.sidebar .nav-subitem:hover,
.sidebar .nav-subitem:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.sidebar details[open] .nav-group-title {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar .nav-submenu {
    margin-top: 8px;
    gap: 5px;
}

/* NEDAL_LOGIN_BRAND_V2 */
.login-brand {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.login-brand .brand-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    font-size: 40px;
}

.login-brand strong {
    font-size: 23px;
}

.login-brand span {
    font-size: 15px;
}

/* NEDAL_LOGIN_RESET_UI_V1 */
.login-brand {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.login-brand .brand-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    font-size: 40px;
    margin: 0 auto;
}

.login-brand > div:last-child {
    text-align: center;
}

.login-brand strong,
.login-brand span {
    display: block;
}

.login-brand strong {
    font-size: 23px;
}

.login-brand span {
    font-size: 15px;
}

.forgot-password-link {
    margin-top: -4px;
    text-align: center;
}

.forgot-password-link a {
    color: #0d58ae;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* NEDAL_SERVER_STATUS_BUTTON_V1 */
.server-status-button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #cfe0f5;
    border-radius: 12px;
    background: #ffffff;
    color: #0d58ae;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(21, 76, 137, .08);
}

.server-status-button:hover {
    background: #edf6ff;
    border-color: #a9caee;
}

/* NEDAL_COLOR_SIDEBAR_V1 */

/* نحافظ على لون الشريط والشعار الحاليين، وننسّق عناصر القائمة فقط */
.sidebar .sidebar-nav .nav-item,
.sidebar .sidebar-nav .nav-group-title,
.sidebar .sidebar-nav .nav-subitem {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    transition:
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.sidebar .sidebar-nav .nav-subitem {
    min-height: 49px;
    font-size: 17px;
}

.sidebar .sidebar-nav .nav-item > span,
.sidebar .sidebar-nav .nav-subitem > span,
.sidebar .sidebar-nav .nav-group-title > span:first-of-type {
    min-width: 0;
    text-align: center;
}

.sidebar .sidebar-nav .nav-item::before,
.sidebar .sidebar-nav .nav-subitem::before,
.sidebar .sidebar-nav .nav-group-title::before {
    content: "";
    display: block;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 12px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.16),
        0 5px 13px rgba(0,22,55,.16);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.sidebar .sidebar-nav .nav-item::after,
.sidebar .sidebar-nav .nav-subitem::after {
    content: "";
    display: block;
    width: 36px;
    height: 1px;
}

.sidebar .sidebar-nav .nav-item:hover,
.sidebar .sidebar-nav .nav-group-title:hover,
.sidebar .sidebar-nav .nav-subitem:hover {
    transform: translateY(-1px);
    border-color: rgba(151,203,255,.18);
    box-shadow: 0 7px 17px rgba(2,30,68,.13);
}

.sidebar .sidebar-nav .nav-item.active,
.sidebar .sidebar-nav .nav-subitem.active {
    border-color: rgba(143,200,255,.23);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.09),
        0 8px 19px rgba(2,29,67,.18);
}

.sidebar .sidebar-nav .nav-item.active::before,
.sidebar .sidebar-nav .nav-subitem.active::before {
    transform: scale(1.07);
    filter: brightness(1.15);
    box-shadow:
        0 0 0 4px rgba(93,190,255,.10),
        0 0 17px rgba(78,183,255,.25);
}

/* الرئيسية */
.sidebar .sidebar-nav > .nav-item[href="/"]::before {
    background-color: rgba(52,174,255,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366c8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E");
}

/* التحكم العائلي */
.sidebar .sidebar-nav .nav-group-title::before {
    background-color: rgba(163,113,255,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4a0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

/* الأجهزة */
.sidebar .sidebar-nav .nav-subitem[href="/devices.php"]::before {
    background-color: rgba(41,218,179,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362edcd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='10' x='2' y='3' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3Crect width='6' height='10' x='16' y='11' rx='2'/%3E%3C/svg%3E");
}

/* التطبيقات */
.sidebar .sidebar-nav .nav-subitem[href="/apps.php"]::before {
    background-color: rgba(255,153,55,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffb461' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Crect width='7' height='7' x='14' y='14' rx='1'/%3E%3C/svg%3E");
}

/* الجداول الزمنية */
.sidebar .sidebar-nav .nav-subitem[href="/devices.php#schedules"]::before {
    background-color: rgba(245,93,163,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8cc1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Ccircle cx='16' cy='16' r='3'/%3E%3Cpath d='M16 14.5V16l1 1'/%3E%3C/svg%3E");
}

/* الحماية */
.sidebar .sidebar-nav > .nav-item[href="/protection.php"]::before {
    background-color: rgba(57,211,114,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2375e99f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-8 9-4.5-1.5-8-4-8-9V5l8-3 8 3v8Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

/* الشبكة */
.sidebar .sidebar-nav > .nav-item[href="/network.php"]::before {
    background-color: rgba(31,201,218,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367e5ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='6' height='6' x='9' y='2' rx='1'/%3E%3Crect width='6' height='6' x='2' y='16' rx='1'/%3E%3Crect width='6' height='6' x='16' y='16' rx='1'/%3E%3Cpath d='M12 8v4M5 16v-2h14v2'/%3E%3C/svg%3E");
}

/* السجلات */
.sidebar .sidebar-nav > .nav-item[href="/logs.php"]::before {
    background-color: rgba(255,188,52,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd16a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h9l5 5v15H6z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h6'/%3E%3C/svg%3E");
}

/* AdGuard */
.sidebar .sidebar-nav > .nav-item[href="/news.php"]::before {
    content:"📰";
}

.sidebar .sidebar-nav > .nav-item[href="/adguard.php"]::before {
    background-color: rgba(117,214,77,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aee79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-8 9-4.5-1.5-8-4-8-9V5l8-3 8 3v8Z'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E");
}

/* الإعدادات */
.sidebar .sidebar-nav > .nav-item[href="/settings.php"]::before {
    background-color: rgba(145,155,255,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b2b9ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21H9.6v-.1A1.7 1.7 0 0 0 8.6 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H3V9.6h.1A1.7 1.7 0 0 0 4.6 8.6a1.7 1.7 0 0 0-.34-1.88l-.06-.06 2.83-2.83.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V3h4v.1A1.7 1.7 0 0 0 15.4 4.6a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.83 2.83-.06.06A1.7 1.7 0 0 0 19.4 9c.36.29.57.72.6 1.18V13.6h-.1A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E");
}

/* زر إدارة العملاء — مع الحفاظ على النص في المنتصف */
.sidebar .nedal-admin-link {
    display: grid !important;
    grid-template-columns: 36px minmax(0,1fr) 36px;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    text-align: center;
}

.sidebar .nedal-admin-link::before {
    content: "👥";
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(34,128,215,.12);
    font-size: 18px;
}

.sidebar .nedal-admin-link::after {
    content: "";
    width: 34px;
    height: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar .sidebar-nav .nav-item,
    .sidebar .sidebar-nav .nav-group-title,
    .sidebar .sidebar-nav .nav-subitem,
    .sidebar .sidebar-nav .nav-item::before,
    .sidebar .sidebar-nav .nav-subitem::before,
    .sidebar .sidebar-nav .nav-group-title::before {
        transition: none;
    }
}

/* NEDAL_SIDEBAR_WIDTH_SCROLL_V1 */
@media (min-width: 761px) {
    .app-shell {
        grid-template-columns: 310px minmax(0, 1fr);
    }

    .sidebar {
        width: 310px;
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: 48px;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,.38) transparent;
    }

    .sidebar::-webkit-scrollbar {
        width: 7px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background: rgba(255,255,255,.38);
    }

    .sidebar .sidebar-nav .nav-item > span,
    .sidebar .sidebar-nav .nav-group-title > span:first-of-type,
    .sidebar .sidebar-nav .nav-subitem > span,
    .sidebar .nedal-admin-link > span {
        white-space: nowrap;
    }
}


/* NEDAL_PERSONAL_DNS_NAV_V1 */
.sidebar .sidebar-nav > .nav-item[href="/personal-dns-admin.php"]::before{
content:"🌐";
}


/* NEDAL_PERSONAL_DNS_CUSTOMER_NAV_V1 */
.sidebar .sidebar-nav > .nav-item[href="/personal-dns.php"]::before{
    content:"🌐";
}


/* NEDAL_SIDEBAR_ICON_ALIGNMENT_FIX_V1 */

/* 1) أيقونات المبيعات والدفع الإلكتروني داخل المربع الصحيح */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item[href="/sales.php"]::after,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem[href="/sales.php"]::after{
    content:"🛒" !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item[href="/payment-transactions.php"]::after,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem[href="/payment-transactions.php"]::after{
    content:"💳" !important;
}

/* 2) توحيد خط تموضع الأيقونات بين العناصر العادية والفرعية */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-group-title{
    position:relative !important;
}

/* خلي النص يبتعد نفس المسافة عن مربع الأيقونة */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem{
    padding-right:78px !important;
}

/* توحيد موضع مربع الأيقونة */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item::after,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem::after,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-group-title::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-group-title::after{
    right:18px !important;
    left:auto !important;
}

/* إزالة أي إزاحة إضافية لعناصر التحكم العائلي الفرعية */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-submenu{
    padding-right:0 !important;
    margin-right:0 !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem{
    margin-right:0 !important;
}

/* تحسين تمركز النص */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item span,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem span,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-group-title span{
    display:inline-flex;
    align-items:center;
}


/* NEDAL_COMMERCE_NAV_FIX_V2 */

/*
 * المبيعات والدفع الإلكتروني:
 * أيقونة حقيقية منفصلة عن النص،
 * بدون pseudo-elements أو مسافات وهمية.
 */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item.ns-commerce-nav{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;

    gap:14px !important;

    min-height:58px !important;

    padding:
        7px 14px
        7px 14px !important;

    margin-right:0 !important;
    margin-left:0 !important;
}

/* إلغاء الـ pseudo القديم لهذين الزرين فقط */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item.ns-commerce-nav::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item.ns-commerce-nav::after{
    display:none !important;
    content:none !important;
}

/* مربع الأيقونة */
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item.ns-commerce-nav
.ns-commerce-icon{
    display:grid !important;
    place-items:center !important;

    flex:0 0 44px !important;

    width:44px !important;
    height:44px !important;

    margin:0 !important;
    padding:0 !important;

    border:1px solid rgba(103,174,235,.30);
    border-radius:13px;

    background:rgba(24,108,185,.18);

    font-size:20px !important;
    line-height:1 !important;

    transform:none !important;
}

/* النص */
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item.ns-commerce-nav
.ns-commerce-label{
    display:block !important;

    flex:1 1 auto !important;

    margin:0 !important;
    padding:0 !important;

    text-align:right !important;
    white-space:nowrap;

    line-height:1.35 !important;
}

/* عند التفعيل */
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item.ns-commerce-nav.active
.ns-commerce-icon{
    background:rgba(52,146,224,.28);
    border-color:rgba(121,194,255,.45);
}

/* الجوال */
@media(max-width:760px){

    .sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item.ns-commerce-nav{
        gap:14px !important;
        padding-right:14px !important;
        padding-left:14px !important;
    }

}


/* NEDAL_SIDEBAR_UNIFIED_ALIGNMENT_V3 */

/*
 * المرجع في المحاذاة:
 * المبيعات + الدفع الإلكتروني.
 *
 * جميع عناصر القائمة تستخدم الآن:
 * [ مربع الأيقونة ] [ النص ]
 * بدون العمود الوهمي الثالث القديم.
 */


/* =====================================================
   العناصر العادية + عناصر التحكم العائلي
   ===================================================== */

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item:not(.ns-commerce-nav),
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;

    gap:14px !important;

    min-height:58px !important;

    padding:7px 14px !important;

    margin-right:0 !important;
    margin-left:0 !important;

    text-align:right !important;
}


/* مربع الأيقونة القديم يصبح بنفس مقاس المبيعات والدفع */

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item:not(.ns-commerce-nav)::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-subitem::before{
    display:grid !important;
    place-items:center !important;

    position:static !important;

    flex:0 0 44px !important;

    width:44px !important;
    height:44px !important;

    margin:0 !important;

    border-radius:13px !important;

    background-position:center !important;
    background-repeat:no-repeat !important;
    background-size:20px 20px !important;

    font-size:20px !important;
    line-height:1 !important;

    transform:none;
}


/* حذف العمود الفارغ الذي كان يوازن الأيقونة */

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item:not(.ns-commerce-nav)::after,
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-subitem::after{
    display:none !important;
    content:none !important;
}


/* النص يبدأ من نفس مكان نص المبيعات */

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item:not(.ns-commerce-nav) > span,
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-subitem > span{
    display:block !important;

    flex:1 1 auto !important;

    min-width:0 !important;

    margin:0 !important;
    padding:0 !important;

    text-align:right !important;

    line-height:1.35 !important;
}


/* =====================================================
   المبيعات + الدفع الإلكتروني
   نبقيهما المرجع بدون تغيير موقعهما
   ===================================================== */

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-item.ns-commerce-nav{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;

    gap:14px !important;

    min-height:58px !important;

    padding:7px 14px !important;

    margin-right:0 !important;
    margin-left:0 !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item.ns-commerce-nav
.ns-commerce-icon{
    flex:0 0 44px !important;

    width:44px !important;
    height:44px !important;

    margin:0 !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item.ns-commerce-nav
.ns-commerce-label{
    flex:1 1 auto !important;

    margin:0 !important;
    padding:0 !important;

    text-align:right !important;
}


/* =====================================================
   عنوان التحكم العائلي
   نفس خط بقية القائمة مع إبقاء السهم
   ===================================================== */

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-group-title{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;

    gap:14px !important;

    min-height:58px !important;

    padding:7px 14px !important;

    text-align:right !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-group-title::before{
    display:grid !important;
    place-items:center !important;

    position:static !important;

    flex:0 0 44px !important;

    width:44px !important;
    height:44px !important;

    margin:0 !important;

    border-radius:13px !important;

    background-position:center !important;
    background-repeat:no-repeat !important;
    background-size:20px 20px !important;

    transform:none;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-group-title > span:first-of-type{
    flex:1 1 auto !important;

    margin:0 !important;
    padding:0 !important;

    text-align:right !important;
}

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-group-title .nav-arrow{
    flex:0 0 auto !important;
    margin-right:auto !important;
}


/* =====================================================
   إلغاء إزاحة القائمة الفرعية بالكامل
   ===================================================== */

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-submenu{
    padding:4px 0 8px !important;
    margin:8px 0 0 !important;
}


/* =====================================================
   Active / Hover
   ===================================================== */

.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-item:not(.ns-commerce-nav).active::before,
.sidebar:not(.pdns-sidebar) .sidebar-nav
.nav-subitem.active::before{
    transform:scale(1.07) !important;
}


/* =====================================================
   المحافظة على المحاذاة في الشاشات الصغيرة
   ===================================================== */

@media(max-width:760px){

    .sidebar:not(.pdns-sidebar) .sidebar-nav
    .nav-item:not(.ns-commerce-nav),
    .sidebar:not(.pdns-sidebar) .sidebar-nav
    .nav-subitem,
    .sidebar:not(.pdns-sidebar) .sidebar-nav
    .nav-item.ns-commerce-nav,
    .sidebar:not(.pdns-sidebar) .sidebar-nav
    .nav-group-title{
        padding-right:14px !important;
        padding-left:14px !important;
        gap:14px !important;
    }

}


/* NEDAL_SIDEBAR_SUBITEM_HOVER_UNIFIED_V1 */

/*
 * توحيد Hover عناصر التحكم العائلي
 * مع بقية عناصر القائمة مثل الحماية والقوائم.
 */

.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem:hover,
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem:focus-visible{
    color:#fff !important;

    background:
        rgba(255,255,255,.14) !important;

    border-color:
        rgba(151,203,255,.18) !important;

    box-shadow:
        0 7px 17px
        rgba(2,30,68,.13) !important;

    transform:
        translateY(-1px) !important;

    outline:none !important;
    outline-offset:0 !important;
}

/* منع أي إطار قديم حول الزر */
.sidebar:not(.pdns-sidebar) .sidebar-nav .nav-subitem{
    outline:none !important;
}



/* NEDAL_PDNS_SIDEBAR_ISOLATION_GUARD_V1 */

/*
 * Personal DNS له Sidebar خاص به.
 * لا يرث تخطيط سايدبار الإدارة التجاري.
 */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;

    gap:12px !important;

    min-height:auto !important;

    padding:11px 13px !important;

    margin-right:0 !important;
    margin-left:0 !important;

    text-align:right !important;
}


/* لا نستخدم pseudo icons في Personal DNS */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item::before,

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item::after{
    display:none !important;
    content:none !important;
}


/* الأيقونة الحقيقية الموجودة داخل الصفحة */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item
.pdns-nav-icon{
    display:grid !important;
    place-items:center !important;

    flex:0 0 34px !important;

    width:34px !important;
    height:34px !important;

    min-width:34px !important;
    max-width:34px !important;

    margin:0 !important;
    padding:0 !important;

    border-radius:10px !important;

    background:
        rgba(255,255,255,.09) !important;

    font-size:17px !important;

    text-align:center !important;
}


/* نص الزر */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item
> span:not(.pdns-nav-icon){
    display:block !important;

    flex:1 1 auto !important;

    width:auto !important;
    min-width:0 !important;

    margin:0 !important;
    padding:0 !important;

    text-align:right !important;
}


/* Hover الأصلي */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item:hover{
    background:
        rgba(255,255,255,.08) !important;

    color:#fff !important;

    border-color:
        transparent !important;

    box-shadow:none !important;

    transform:none !important;

    outline:none !important;
}


/* Active الأصلي */

.pdns-customer-page
.pdns-sidebar
.sidebar-nav
.nav-item.active{
    background:
        rgba(255,255,255,.15) !important;

    border-color:
        rgba(255,255,255,.14) !important;

    color:#fff !important;

    box-shadow:
        inset 3px 0 0
        rgba(117,201,255,.85) !important;

    transform:none !important;
}


/* NEDAL_ADMIN_SIDEBAR_BLUE_EDGE_V1 */

/*
 * تأثير أزرق موحد لأزرار لوحة الإدارة فقط.
 * Personal DNS مستثنى لأنه يملك تصميمه الخاص.
 */

/* Hover */
.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-item:hover,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-subitem:hover,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-group-title:hover{
    background:
        rgba(255,255,255,.10) !important;

    border-color:
        rgba(119,196,255,.20) !important;

    box-shadow:
        inset 4px 0 0 rgba(102,199,255,.82),
        0 7px 17px rgba(2,30,68,.13) !important;

    transform:
        translateY(-1px) !important;
}


/* العنصر النشط */
.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-item.active,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-subitem.active{
    background:
        rgba(255,255,255,.15) !important;

    border-color:
        rgba(126,201,255,.26) !important;

    box-shadow:
        inset 4px 0 0 rgba(102,199,255,.95),
        inset 0 1px 0 rgba(255,255,255,.09),
        0 8px 19px rgba(2,29,67,.18) !important;
}


/* مربع الأيقونة في العنصر النشط */
.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-item.active::before,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-subitem.active::before,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-item.ns-commerce-nav.active
.ns-commerce-icon{
    box-shadow:
        0 0 0 4px rgba(93,190,255,.10),
        0 0 17px rgba(78,183,255,.24) !important;
}


/* بدون outline مشوه */
.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-item:focus-visible,

.sidebar:not(.pdns-sidebar)
.sidebar-nav
.nav-subitem:focus-visible{
    outline:none !important;
}


/* NEDAL_INVITATIONS_NAV_V1 */
.sidebar .sidebar-nav > .nav-item[href="/invitations.php"]::before {
    background-color: rgba(177,113,255,.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1a0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 0 0 6v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a3 3 0 0 0 0-6V5a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z'/%3E%3Cpath d='M13 5v2'/%3E%3Cpath d='M13 17v2'/%3E%3Cpath d='M13 11v2'/%3E%3C/svg%3E");
}

/* Invitation page follows the native admin shell */
.main-content.inv-content {
    min-width: 0;
}

.main-content.inv-content .ns-shell-topbar {
    margin-bottom: 24px;
}

@media (max-width:760px) {
    .main-content.inv-content {
        padding:18px;
    }
}

/* NEDAL_ADMIN_LOGOUT_FIX_V1 */

.ns-shell-topbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:24px;
}

.ns-shell-title {
    display:flex;
    align-items:center;
    gap:12px;
}

.ns-shell-title-icon {
    font-size:28px;
}

.ns-shell-title h1 {
    margin:0;
    color:#123b68;
}

.ns-shell-title p {
    margin:5px 0 0;
    color:#6f8499;
}

.ns-shell-actions {
    display:flex;
    gap:10px;
    align-items:center;
}

.ns-shell-button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:9px 16px;
    border:1px solid #d4e2f0;
    border-radius:12px;
    background:#ffffff;
    color:#175b9a;
    font-weight:800;
    text-decoration:none;
}

.ns-shell-button:hover {
    background:#eef6ff;
    border-color:#b7d2ec;
}

.ns-sidebar-bottom {
    margin-top:auto;
    padding-top:18px;
}

.ns-sidebar-logout {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:10px 14px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:14px;
    background:rgba(190,45,45,.18);
    color:#ffd6d6;
    font-size:16px;
    font-weight:800;
    text-decoration:none;
    transition:.18s ease;
}

.ns-sidebar-logout:hover {
    background:rgba(210,45,45,.28);
    color:#ffffff;
    border-color:rgba(255,180,180,.35);
}

.ns-shared-sidebar {
    display:flex;
    flex-direction:column;
}

.ns-shared-sidebar .sidebar-nav {
    flex:1;
}

@media(max-width:760px) {
    .ns-shell-topbar {
        align-items:flex-start;
        flex-direction:column;
    }
}
