/* ==========================================================================
   المفلحي للهندسة وصناعة اللوحات الكهربائية - Enterprise Grade UI ($1000 Value)
   ========================================================================== */

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

:root {
    --primary: #FF5722;
    --primary-hover: #E64A19;
    --primary-light: rgba(255, 87, 34, 0.12);
    --primary-glow: rgba(255, 87, 34, 0.35);
    
    --secondary: #1E293B;
    --dark: #0F172A;
    --dark-surface: #1E293B;
    --light-bg: #F8FAFC;
    --white: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #F1F5F9;
    
    --border-color: #E2E8F0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 20px 35px -10px rgba(255, 87, 34, 0.22), 0 10px 15px -5px rgba(0, 0, 0, 0.07);
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==========================================================================
   الشريط العلوي المؤسسي (Enterprise Header)
   ========================================================================== */
.top-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: var(--white);
    padding: 1rem 2.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--primary);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-decoration: none;
}

.brand-logo-container {
    background: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-text {
    font-weight: 900;
    font-size: 1.6rem;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo-text span {
    color: var(--dark);
}

.brand-titles h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.3;
}

.brand-titles p {
    font-size: 0.85rem;
    color: #94A3B8;
    margin-top: 2px;
}

.portal-link-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 0.65rem 1.5rem;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.portal-link-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* ==========================================================================
   قسم الترحيب والإحصائيات الهندسية (Hero & Trust Showcase)
   ========================================================================== */
.hero-showcase {
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.hero-showcase::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 100px;
    background: var(--primary);
    filter: blur(120px);
    opacity: 0.3;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2.6rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: #94A3B8;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.stat-box:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.95rem;
    color: #CBD5E1;
    font-weight: 700;
}

/* ==========================================================================
   شريط البحث والتصفية (Catalog Filter Bar)
   ========================================================================== */
.main-container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    flex-grow: 1;
    width: 100%;
}

.filter-bar {
    background: var(--white);
    padding: 1.25rem 2rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition-fast);
    background: #F8FAFC;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ==========================================================================
   شبكة المنتجات وبطاقة القلب التفاعلي 3D (In-Place Flip Card)
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.product-card {
    perspective: 1200px;
    height: 520px;
    position: relative;
    width: 100%;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 22px;
    box-shadow: var(--card-shadow);
}

.product-card.is-flipped .card-inner {
    transform: rotateY(-180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 22px;
    background: var(--white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.card-front {
    justify-content: space-between;
}

.image-container {
    height: 52%;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #F1F5F9;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image {
    transform: scale(1.06);
}

.order-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.front-content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    background: var(--white);
}

.product-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: block;
    word-wrap: break-word;
}

.btn-info {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.3);
}

.btn-info:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 87, 34, 0.45);
}

/* الوجه الخلفي لتفاصيل اللوحة وموقع التركيب */
.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
    padding: 1.5rem;
    justify-content: space-between;
    border: 2px solid var(--primary);
}

.back-header {
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.back-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 800;
}

.back-body {
    flex-grow: 1;
    overflow-y: auto;
    text-align: right;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-section {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 700;
    line-height: 1.5;
}

.back-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-map-location {
    background: linear-gradient(135deg, #FACC15 0%, #EAB308 100%);
    color: #0F172A;
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.4);
}

.btn-map-location:hover {
    background: linear-gradient(135deg, #EAB308 0%, #CA8A04 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(234, 179, 8, 0.55);
}

.btn-back-flip {
    background: #E2E8F0;
    color: var(--dark);
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-back-flip:hover {
    background: #CBD5E1;
}

/* ==========================================================================
   صفحة تسجيل الدخول الفاخرة (Login Portal Page)
   ========================================================================== */
.portal-page-body {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.portal-box {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-header {
    background: var(--dark);
    color: var(--white);
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 4px solid var(--primary);
}

.portal-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--white);
    margin-top: 1rem;
}

.portal-body {
    padding: 2.5rem 2rem;
}

/* ==========================================================================
   لوحة التحكم المؤسسية (Enterprise Dashboard Layout)
   ========================================================================== */
.dashboard-body {
    background-color: #F1F5F9;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 290px;
    background: var(--dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.9rem 1.25rem;
    color: #CBD5E1;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: right;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 87, 34, 0.15);
    color: var(--primary);
}

.dashboard-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.dashboard-topbar {
    background: var(--white);
    padding: 1.25rem 2.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.user-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.9rem;
}

.pill-admin {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.pill-user {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.dashboard-content {
    padding: 2.5rem;
}

/* بطاقات الإحصائيات في الداشبورد */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.dash-stat-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dash-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

/* جدول اللوحات الاحترافي (Enterprise Table) */
.table-container {
    background: var(--white);
    border-radius: 22px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.btn-add-dashboard {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-dashboard:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.enterprise-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.enterprise-table th {
    background: #F8FAFC;
    padding: 1.25rem 1.5rem;
    font-weight: 800;
    color: var(--dark);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
}

.enterprise-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
    vertical-align: middle;
}

.enterprise-table tr:hover {
    background: #F8FAFC;
}

.table-img {
    width: 65px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.action-btns {
    display: flex;
    gap: 8px;
}

.btn-table-edit {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-table-edit:hover {
    background: #2563EB;
    color: var(--white);
}

.btn-table-del {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-table-del:hover {
    background: #DC2626;
    color: var(--white);
}

/* ==========================================================================
   النوافذ المنبثقة (Modals)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary);
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    transition: border-color var(--transition-fast);
    background-color: #F8FAFC;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 4px var(--primary-light);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.user-lock-banner {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-footer {
    padding: 1.25rem 2rem;
    background: #F8FAFC;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    background: #E2E8F0;
    color: var(--dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-submit {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 4rem;
    border-top: 3px solid var(--primary);
}

.footer p {
    color: #94A3B8;
    font-size: 0.95rem;
}

/* ==========================================================================
   نظام التوافق الفائق والشاشات الذكية للجوال والتابلت (Mobile First & Responsive)
   ========================================================================== */

/* أجهزة التابلت والشاشات المتوسطة (الأقل من 992px) */
@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-left: none;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-header {
        padding: 1rem 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: right;
    }

    .sidebar-header div {
        font-size: 1.6rem !important;
        margin-bottom: 0 !important;
    }

    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
        background: rgba(15, 23, 42, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-link {
        white-space: nowrap;
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        border-radius: 12px;
        justify-content: center;
    }

    .dashboard-topbar {
        padding: 1.25rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* أجهزة الجوال الذكية (الأقل من 768px) */
@media (max-width: 768px) {
    /* تكييف الترويسة العليا للموقع العام (index.html) */
    .header-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }

    .brand-section {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .brand-titles h1 {
        font-size: 1.35rem;
        line-height: 1.4;
    }

    .brand-titles p {
        font-size: 0.72rem;
    }

    .portal-link-btn {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    /* واجهة الهبوط والإحصائيات على شاشة الهاتف */
    .hero-showcase {
        padding: 3rem 1.25rem;
    }

    .hero-content h2 {
        font-size: 1.75rem;
        line-height: 1.4;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .stats-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-box {
        padding: 1.25rem;
    }

    /* شريط البحث وشبكة اللوحات الكهربائية */
    .main-container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .filter-bar {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1.25rem 1rem;
        text-align: center;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card {
        height: 465px;
        width: 100%;
    }

    .front-content {
        padding: 0.75rem 0.6rem 0.85rem;
    }

    .product-title {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }

    .btn-info {
        padding: 0.65rem 0.4rem;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .back-header h3 {
        font-size: 0.85rem;
    }

    .detail-section {
        padding: 0.5rem;
    }

    .detail-label {
        font-size: 0.65rem;
    }

    .detail-value {
        font-size: 0.82rem;
    }

    .btn-map-location {
        padding: 0.65rem 0.4rem;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .btn-back-flip {
        padding: 0.55rem 0.4rem;
        font-size: 0.78rem;
    }

    /* شاشة الدخول على الجوال (login.html) */
    .portal-page-body {
        padding: 1rem;
    }

    .portal-box {
        border-radius: 20px;
    }

    .portal-header {
        padding: 1.75rem 1.25rem;
    }

    .portal-header h2 {
        font-size: 1.35rem;
    }

    .portal-body {
        padding: 1.5rem 1.25rem;
    }

    /* لوحة التحكم التنفيذية على الجوال */
    .dashboard-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dash-stat-card {
        padding: 1.25rem 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        text-align: center;
    }

    .btn-add-dashboard {
        width: 100%;
        justify-content: center;
        padding: 0.9rem;
        font-size: 1rem;
    }

    /* الجداول والأزرار التفاعلية للمس باليد (Touch Friendly) */
    .table-container {
        border-radius: 16px;
        padding: 0.5rem;
    }

    .enterprise-table th, .enterprise-table td {
        padding: 0.85rem 0.5rem;
        font-size: 0.82rem;
    }

    .table-img {
        width: 48px;
        height: 48px;
    }

    .action-btns {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .btn-table-edit, .btn-table-del {
        width: 100%;
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
        justify-content: center;
    }

    /* النوافذ المنبثقة (Modals) ملائمة بالكامل لشاشة الجوال */
    .modal-content {
        width: 96%;
        max-height: 90vh;
        border-radius: 20px;
        margin: 0.5rem auto;
    }

    .modal-body {
        padding: 1.25rem 1rem;
    }

    .modal-body div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .form-control {
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        padding: 1rem;
        gap: 0.75rem;
    }

    .btn-submit, .btn-cancel, .btn-save-modal {
        width: 100%;
        padding: 0.9rem;
        font-size: 1rem;
    }
}

/* الأجهزة شديدة الصغر (الأقل من 480px) */
@media (max-width: 480px) {
    .sidebar-menu {
        padding: 0.5rem;
    }

    .sidebar-link {
        padding: 0.6rem 0.75rem;
        font-size: 0.78rem;
    }

    .user-status-pill {
        width: 100%;
        justify-content: center;
    }
}
