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

:root {
    --bg-dark: #0b0d11;
    --card-dark: #141720;
    --card-dark-hover: #1a1e2a;
    --card-border: #232836;
    --gold: #d4af37;
    --gold-light: #f5d77f;
    --gold-hover: #e5be47;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --text-primary: #f3f4f6;
    --text-secondary: #9aa1b2;
    --sidebar-w: 270px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    overflow-x: hidden;
}

/* بطاقات وتصميم راقي */
.card-luxury {
    background: linear-gradient(145deg, #161922, #111319);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.text-gold {
    color: var(--gold) !important;
}

.bg-gold {
    background-color: var(--gold) !important;
    color: #000 !important;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #aa820a 100%);
    color: #0d0f12;
    font-weight: 700;
    border: none;
    border-radius: 9px;
    padding: 8px 18px;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #f5d77f 0%, #d4af37 100%);
    color: #000;
    box-shadow: 0 0 18px var(--gold-glow);
    transform: translateY(-1px);
}

.btn-outline-gold {
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.05);
    border-radius: 9px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: #0d0f12;
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
}

/* الحقول والنماذج */
.form-control, .form-select {
    background-color: #0c0e14 !important;
    border: 1px solid #232838 !important;
    color: #f3f4f6 !important;
    border-radius: 9px;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 10px var(--gold-glow) !important;
}

/* جدول الأجهزة */
.table-luxury {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-luxury thead th {
    background-color: #0e1017;
    color: var(--gold-light);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid #232838;
}

.table-luxury tbody tr {
    background-color: transparent;
    transition: all 0.2s ease;
    border-bottom: 1px solid #1c202b;
}

.table-luxury tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.04);
}

.table-luxury tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    color: #cbd5e1;
    border-bottom: 1px solid #1c202b;
    font-size: 0.95rem;
}

.device-name-title {
    color: var(--gold-light);
    font-weight: 800;
    font-size: 1rem;
    display: inline-block;
}

.device-sn-code {
    background: #08090d;
    border: 1px solid #282e3d;
    color: #38bdf8;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 600;
}

.badge-brand {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold-light);
    border: 1px solid rgba(212, 175, 55, 0.35);
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
}

.badge-status-available {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.badge-status-sold {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.badge-status-transfer {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
}

/* =======================================================
   القائمة الجانبية والهيدر المتجاوب (Desktop & Mobile)
   ======================================================= */

/* شريط الموبايل العلوي */
.mobile-topbar {
    display: none;
    background: rgba(14, 16, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1f2430;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.mobile-hamburger-btn {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--gold-light);
    font-size: 1.25rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-hamburger-btn:hover {
    background: var(--gold);
    color: #000;
}

/* القائمة الجانبية للكمبيوتر */
.sidebar {
    width: var(--sidebar-w);
    background: #0e1017;
    border-left: 1px solid #1c202b;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    border-right: 4px solid transparent;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
    border-right-color: var(--gold);
}

.main-content {
    margin-right: var(--sidebar-w);
    padding: 25px;
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

/* خلفية التعتيم على الموبايل */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1030;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* التجاوب مع شاشات الموبايل والتابلت */
@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar {
        transform: translateX(100%); /* إخفاء السايدبار جهة اليمين */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    }

    .sidebar.open {
        transform: translateX(0); /* إظهار السايدبار عند الضغط */
    }

    .main-content {
        margin-right: 0;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .mobile-device-card {
        background: #141720;
        border: 1px solid #232838;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 12px;
    }
}