﻿/* ============================================================
   ERP PRO — Layout Styles
   Dark / Light · RTL / LTR · Arabic / English
   System Theme + Manual Override
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&family=DM+Sans:wght@300;400;500;600&family=Cairo:wght@300;400;500;600;700&display=swap');

/* ================================================================
   CSS VARIABLES — Dark Theme (default)
   ================================================================ */

:root {
    /* Colors */
    --bg-base: #0d0f14;
    --bg-surface: #13161e;
    --bg-card: #1a1e2a;
    --bg-hover: #1f2436;
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(212, 175, 55, 0.4);
    --gold: #d4af37;
    --gold-light: #f0d060;
    --gold-dim: rgba(212, 175, 55, 0.12);
    --text-primary: #eef0f5;
    --text-secondary: #8a90a0;
    --text-muted: #50566a;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, .40);
    --danger: rgba(220, 53, 69, .15);
    --danger-border: rgba(220, 53, 69, .40);
    --danger-text: #ff6b7a;
    /* Layout */
    --sidebar-w: 260px;
    --navbar-h: 64px;
    --radius-sm: 8px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    /* Fonts */
    --font-en: 'DM Sans', sans-serif;
    --font-ar: 'Cairo', sans-serif;
    --font-display-en: 'Playfair Display', serif;
    --font-display-ar: 'Cairo', sans-serif;
}

/* ================================================================
   LIGHT THEME — via attribute (manual)
   ================================================================ */

[data-theme="light"] {
    --bg-base: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #e8eaf0;
    --border: rgba(0, 0, 0, 0.08);
    --border-active: rgba(160, 120, 10, 0.40);
    --gold: #9a7a08;
    --gold-light: #b89010;
    --gold-dim: rgba(160, 120, 10, 0.10);
    --text-primary: #141720;
    --text-secondary: #454d68;
    --text-muted: #8890a8;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, .07);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, .13);
    --danger: rgba(220, 53, 69, .10);
    --danger-border: rgba(220, 53, 69, .30);
    --danger-text: #c0392b;
}

/* ================================================================
   SYSTEM PREFERENCE — auto dark/light (when no manual override)
   ================================================================ */

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]):not([data-theme="light"]) {
        --bg-base: #f0f2f5;
        --bg-surface: #ffffff;
        --bg-card: #ffffff;
        --bg-hover: #e8eaf0;
        --border: rgba(0, 0, 0, 0.08);
        --border-active: rgba(160, 120, 10, 0.40);
        --gold: #9a7a08;
        --gold-light: #b89010;
        --gold-dim: rgba(160, 120, 10, 0.10);
        --text-primary: #141720;
        --text-secondary: #454d68;
        --text-muted: #8890a8;
        --shadow-card: 0 4px 20px rgba(0, 0, 0, .07);
        --shadow-hover: 0 8px 30px rgba(0, 0, 0, .13);
        --danger: rgba(220, 53, 69, .10);
        --danger-border: rgba(220, 53, 69, .30);
        --danger-text: #c0392b;
    }
}

/* ================================================================
   RESET & BASE
   ================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-en);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

[dir="rtl"] body,
[dir="rtl"] {
    font-family: var(--font-ar);
}

/* ================================================================
   SCROLLBAR
   ================================================================ */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ================================================================
   THEME TOGGLE BUTTON
   ================================================================ */

.theme-toggle-btn {
    background: var(--gold-dim);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-sm);
    color: var(--gold);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

    .theme-toggle-btn:hover {
        background: var(--gold);
        color: var(--bg-base);
    }

/* أيقونة الشمس = الدارك (أضغط لتحويل للفاتح) */
/* أيقونة القمر  = اللايت (أضغط لتحويل للداكن) */
.icon-sun,
.icon-moon {
    transition: opacity var(--transition);
}

:root:not([data-theme="light"]) .icon-sun {
    display: inline;
}

:root:not([data-theme="light"]) .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: inline;
}

/* ================================================================
   NAVBAR — Guest Layout
   ================================================================ */

body.layout-navbar {
    display: flex;
    flex-direction: column;
}

    body.layout-navbar .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

.navbar-top {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: var(--navbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 20px;
    animation: slideDown 0.4s ease;
    transition: background var(--transition), border-color var(--transition);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar-brand {
    font-family: var(--font-display-en);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

[dir="rtl"] .navbar-brand {
    font-family: var(--font-display-ar);
    letter-spacing: 0;
}

.navbar-brand::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-grow: 1;
}

    .navbar-links a {
        padding: 7px 14px;
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        font-size: .87rem;
        text-decoration: none;
        transition: all var(--transition);
        border: 1px solid transparent;
    }

        .navbar-links a:hover {
            color: var(--text-primary);
            background: var(--bg-hover);
            border-color: var(--border);
        }

        .navbar-links a.active {
            color: var(--gold-light);
            background: var(--gold-dim);
            border-color: var(--border-active);
            font-weight: 500;
        }

.navbar-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
}

.lang-btn {
    background: var(--gold-dim);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: .8rem;
    padding: 5px 12px;
    cursor: pointer;
    transition: all var(--transition);
}

    .lang-btn:hover {
        background: var(--gold);
        color: var(--bg-base);
    }

.btn-nav-login {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: var(--gold);
    color: var(--bg-base);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

    .btn-nav-login:hover {
        background: var(--gold-light);
    }

.btn-nav-register {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

    .btn-nav-register:hover {
        border-color: var(--border-active);
        color: var(--gold);
    }

/* ================================================================
   SIDEBAR — Logged In Layout
   ================================================================ */

body.layout-sidebar {
    display: flex;
    flex-direction: row;
}

.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-surface);
    border-inline-end: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    animation: slideInSideLtr 0.4s ease;
    transition: background var(--transition), border-color var(--transition);
}

[dir="rtl"] .sidebar {
    animation-name: slideInSide;
}

@keyframes slideInSide {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInSideLtr {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-brand {
    font-family: var(--font-display-en);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: .04em;
    color: var(--gold);
    padding: 26px 22px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

[dir="rtl"] .sidebar-brand {
    font-family: var(--font-display-ar);
    letter-spacing: 0;
}

.sidebar-brand::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--gold);
    flex-shrink: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

.sidebar-section-label {
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--text-muted);
    padding: 14px 12px 6px;
    font-weight: 600;
}

[dir="rtl"] .sidebar-section-label {
    letter-spacing: 0;
    font-size: .7rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .88rem;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
}

    .sidebar-nav .nav-link:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        border-color: var(--border);
    }

    .sidebar-nav .nav-link.active {
        background: var(--gold-dim);
        color: var(--gold-light);
        border-color: var(--border-active);
        font-weight: 500;
    }

        .sidebar-nav .nav-link.active::after {
            content: '';
            position: absolute;
            inset-inline-end: 0;
            top: 20%;
            bottom: 20%;
            width: 3px;
            border-radius: 4px;
            background: var(--gold);
        }

/* ── Submenu ── */
.sidebar-submenu {
    border-inline-start: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    margin: 4px 0;
}

    .sidebar-submenu.active {
        background: rgba(212, 175, 55, 0.05);
    }

    .sidebar-submenu ul {
        list-style: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .sidebar-submenu.active ul {
        max-height: 500px;
    }

    .sidebar-submenu ul li a {
        display: block;
        padding: 8px 18px;
        font-size: 0.85rem;
        color: var(--text-secondary);
        border-radius: var(--radius-sm);
        transition: all 0.2s;
    }

        .sidebar-submenu ul li a:hover,
        .sidebar-submenu ul li a.active {
            color: var(--gold-light);
            background: rgba(212, 175, 55, 0.1);
        }

    .sidebar-submenu .submenu-title::after {
        content: '▶';
        float: right;
        transition: transform 0.3s ease;
        font-size: .7rem;
    }

[dir="rtl"] .sidebar-submenu .submenu-title::after {
    float: left;
    content: '◀';
}

.sidebar-submenu.active .submenu-title::after {
    transform: rotate(90deg);
}

[dir="rtl"] .sidebar-submenu.active .submenu-title::after {
    transform: rotate(-90deg);
}

/* ── User Section ── */
.user-section {
    padding: 14px;
    border-top: 1px solid var(--border);
    background: linear-gradient(to top, rgba(212, 175, 55, .04), transparent);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 2px solid var(--border-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-name {
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: .7rem;
    color: var(--gold);
    margin-top: 2px;
}

.btn-logout {
    width: 100%;
    padding: 9px;
    border-radius: var(--radius-sm);
    background: var(--danger);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-logout:hover {
        background: rgba(220, 53, 69, .22);
        border-color: rgba(220, 53, 69, .6);
    }

/* ================================================================
   MAIN CONTENT
   ================================================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    .main-content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: radial-gradient(ellipse 60% 40% at 80% 20%, rgba(212,175,55,.04) 0%, transparent 60%), radial-gradient(ellipse 50% 60% at 10% 80%, rgba(60,80,200,.04) 0%, transparent 60%);
        pointer-events: none;
        z-index: -1;
    }

[data-theme="light"] .main-content::before {
    opacity: 0.3;
}

.page-header {
    padding: 28px 40px 20px;
    border-bottom: 1px solid var(--border);
}

    .page-header h1 {
        font-family: var(--font-display-en);
        font-size: 1.65rem;
        font-weight: 500;
        color: var(--text-primary);
    }

[dir="rtl"] .page-header h1 {
    font-family: var(--font-display-ar);
}

.page-header h1::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--gold);
    margin-top: 8px;
    border-radius: 2px;
}

main {
    padding: 36px 40px;
    flex-grow: 1;
}

footer {
    border-top: 1px solid var(--border);
    padding: 16px 40px;
    font-size: .78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ================================================================
   TABLE
   ================================================================ */

.table {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: var(--bg-card);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--bg-surface);
    --bs-table-hover-bg: var(--bg-hover);
    color: var(--text-primary) !important;
}

    .table tbody tr:hover {
        transform: scale(1.003);
    }

    .table th,
    .table td {
        color: var(--text-primary) !important;
        border-color: var(--border) !important;
        padding: 14px 16px;
    }

    .table .text-muted {
        color: var(--text-secondary) !important;
    }

    .table thead th {
        color: var(--gold-light) !important;
        background: var(--bg-surface);
        font-weight: 600;
        letter-spacing: .5px;
    }

[dir="rtl"] .table thead th {
    letter-spacing: 0;
}

/* ================================================================
   CARD PRO
   ================================================================ */

.card-pro {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    width: 100%;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

    .card-pro:hover {
        border-color: var(--border-active);
        box-shadow: var(--shadow-hover);
    }

    .card-pro .card-header {
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        padding: 14px 16px;
        border-radius: 0;
        transition: background var(--transition);
    }

    .card-pro .card-body {
        padding: 16px;
    }

        .card-pro .card-body .user-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: var(--gold-dim);
            border: 2px solid var(--border-active);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--gold-light);
            flex-shrink: 0;
        }

        .card-pro .card-body .card-text {
            font-size: .84rem;
            color: var(--text-secondary);
        }

            .card-pro .card-body .card-text strong {
                color: var(--text-primary);
            }

        .card-pro .card-body div.mb-1 {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }

/* ================================================================
   INPUTS
   ================================================================ */

.pro-input,
.pro-multi-select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all var(--transition);
    font-family: inherit;
}

    .pro-input:focus,
    .pro-multi-select:focus {
        border-color: var(--border-active);
        box-shadow: 0 0 0 3px var(--gold-dim);
        background: var(--bg-hover);
        color: var(--text-primary);
        outline: none;
    }

    .pro-input::placeholder {
        color: var(--text-muted);
    }
     /*  .pro-input.form-select {
       background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4af37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
   }*/
    .pro-input.form-select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4af37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 16px 12px;
    }

        .pro-input.form-select option {
            background: var(--bg-card);
            color: var(--text-primary);
        }

            .pro-input.form-select option:checked {
                background: var(--gold-dim);
                color: var(--gold-light);
            }

#searchInput {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: .85rem;
    min-width: 220px;
    transition: all var(--transition);
    font-family: inherit;
}

    #searchInput:focus {
        outline: none;
        border-color: var(--border-active);
        box-shadow: 0 0 0 3px var(--gold-dim);
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    #searchInput::placeholder {
        color: var(--text-muted);
    }

/* ================================================================
   BUTTONS
   ================================================================ */

.btn-gold {
    background: var(--gold);
    color: var(--bg-base);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background var(--transition);
}

    .btn-gold:hover {
        background: var(--gold-light);
        color: var(--bg-base);
    }

.btn-gold-outline {
    background: transparent;
    border: 1px solid var(--border-active);
    color: var(--gold-light);
    border-radius: 8px;
    transition: all var(--transition);
}

    .btn-gold-outline:hover {
        background: var(--gold-dim);
    }

/* ================================================================
   TOGGLE SWITCH — Gold
   ================================================================ */

.toggle-wrapper {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-secondary);
}

.toggle-slider {
    position: relative;
    width: 42px;
    height: 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: var(--transition);
}

    .toggle-slider::before {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        top: 2px;
        inset-inline-start: 3px;
        background: var(--text-muted);
        border-radius: 50%;
        transition: var(--transition);
    }

.toggle-input:checked + .toggle-label .toggle-slider {
    background: var(--gold-dim);
    border-color: var(--border-active);
}

    .toggle-input:checked + .toggle-label .toggle-slider::before {
        transform: translateX(18px);
        background: var(--gold);
        box-shadow: 0 0 8px var(--gold);
    }

[dir="rtl"] .toggle-input:checked + .toggle-label .toggle-slider::before {
    transform: translateX(-18px);
}

.toggle-input:checked + .toggle-label .toggle-text {
    color: var(--gold-light);
}

.toggle-label:hover .toggle-slider {
    border-color: var(--border-active);
}

/* ================================================================
   JSON EDITOR
   ================================================================ */

.json-editor {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
    direction: ltr; /* JSON دائماً LTR */
    transition: var(--transition);
}

    .json-editor:focus {
        outline: none;
        border-color: var(--border-active);
        box-shadow: 0 0 0 4px var(--gold-dim);
        background: var(--bg-hover);
    }

/* ================================================================
   MODAL
   ================================================================ */

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    overflow: hidden;
    transition: background var(--transition);
}

.modal-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
}

.modal-title {
    font-family: var(--font-display-en);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: .02em;
}

[dir="rtl"] .modal-title {
    font-family: var(--font-display-ar);
    letter-spacing: 0;
}

/* btn-close: داكن = invert، فاتح = طبيعي */
.modal-header .btn-close {
    filter: invert(1) opacity(.5);
    transition: opacity var(--transition);
}

    .modal-header .btn-close:hover {
        filter: invert(1) opacity(1);
    }

[data-theme="light"] .modal-header .btn-close {
    filter: none;
    opacity: .5;
}

    [data-theme="light"] .modal-header .btn-close:hover {
        filter: none;
        opacity: 1;
    }

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .modal-header .btn-close {
        filter: none;
        opacity: .5;
    }

        :root:not([data-theme="dark"]) .modal-header .btn-close:hover {
            filter: none;
            opacity: 1;
        }
}

.modal-body {
    background: var(--bg-card);
    padding: 24px;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
}

    .modal-body p {
        margin: 0;
    }

    .modal-body strong {
        color: var(--gold-light);
        font-weight: 600;
    }

.modal-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    gap: 10px;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, .7);
}

.modal-footer .btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    transition: all var(--transition);
}

    .modal-footer .btn-secondary:hover {
        border-color: var(--border-active);
        color: var(--text-primary);
        background: var(--bg-hover);
    }

.modal-footer .btn-danger {
    background: var(--danger);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    transition: all var(--transition);
}

    .modal-footer .btn-danger:hover {
        background: rgba(220, 53, 69, .3);
        border-color: rgba(220, 53, 69, .7);
        color: #fff;
    }

/* ================================================================
   MISC
   ================================================================ */

.section-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: .05em;
    margin-bottom: 18px;
}

[dir="rtl"] .section-title {
    letter-spacing: 0;
}

.param-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    min-height: 60px;
}

.row.g-3 {
    align-items: stretch;
}

    .row.g-3 > [class*="col"] {
        display: flex;
    }

        .row.g-3 > [class*="col"] > .card-pro {
            flex: 1;
        }

.text-danger.small {
    font-size: .78rem;
    margin-top: 4px;
    display: block;
}

/* User Details */
.user-info-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info-email {
    font-size: .8rem;
    color: var(--text-secondary);
}

.user-info-date {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 2px solid var(--border-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gold-light);
    flex-shrink: 0;
}

.card-divider {
    border-top: 1px solid var(--border);
    margin-bottom: 16px;
}

.form-label-pro {
    color: var(--text-secondary);
    font-size: .85rem;
}

.card-header-icon {
    color: var(--gold);
    font-size: 1.1rem;
}

.form-select-pro {
    min-height: 120px;
}

.error-page {
    min-height: calc(100vh - var(--navbar-h, 64px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* الرقم الضخم في الخلفية */
.error-bg-code {
    position: absolute;
    font-family: var(--font-display-en);
    font-size: clamp(160px, 28vw, 320px);
    font-weight: 700;
    color: var(--gold-dim);
    user-select: none;
    pointer-events: none;
    letter-spacing: -0.05em;
    line-height: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    opacity: 0.6;
}

.error-card {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
    padding: 48px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* أيقونة */
.error-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 2px solid var(--border-active);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 0 32px var(--gold-dim);
}

    .error-icon-wrap i {
        font-size: 2rem;
        color: var(--gold);
    }

/* كود الخطأ */
.error-code {
    font-family: var(--font-display-en);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* العنوان */
.error-title {
    font-family: var(--font-display-en);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

/* الرسالة من السيرفر */
.error-message {
    font-size: 0.9rem;
    color: var(--gold-light);
    background: var(--gold-dim);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    margin: 4px 0;
    width: 100%;
}

/* الوصف */
.error-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* الأزرار */
.error-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

    .error-actions .btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 10px 22px;
        font-size: 0.88rem;
        border-radius: var(--radius-sm);
        font-weight: 500;
        cursor: pointer;
        text-decoration: none;
        transition: all var(--transition);
    }