
        :root {
            --primary: #2563eb; --danger: #dc2626; --success: #16a34a;
            --bg: #f1f5f9; --sidebar: #1e293b; --white: #fff;
            --shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        }
       
        body { font-family: tahoma; background: var(--bg); margin: 0; display: flex; height: 100vh; overflow: hidden; direction: rtl; }
       
        /* Login Overlay */
        #admin-login-overlay {
            position: fixed; inset: 0; background: var(--sidebar); z-index: 10000;
            display: flex; align-items: center; justify-content: center;
        }
        .login-card {
            background: white; padding: 35px; border-radius: 20px; width: 90%; max-width: 360px;
            box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); text-align: center;
        }
        /* Mobile Header */
        .mobile-header {
            display: none; background: var(--sidebar); color: white; padding: 10px 20px;
            justify-content: space-between; align-items: center; position: fixed; top: 0; left: 0; right: 0; z-index: 102;
        }
        /* Sidebar */
        .sidebar { width: 260px; background: var(--sidebar); color: white; display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; z-index: 1001; transition: 0.3s; }
        .sidebar h2 { font-size: 18px; text-align: center; margin-bottom: 30px; color: #38bdf8; border-bottom: 1px solid #334155; padding-bottom: 15px; }
        .menu-item { padding: 15px 25px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 10px; border-right: 4px solid transparent; font-size: 14px; }
        .menu-item:hover { background: #334155; }
        .menu-item.active { background: #334155; border-right-color: var(--primary); color: #38bdf8; font-weight: bold; }
        /* Content Area */
        .main-content { flex: 1; overflow-y: auto; padding: 30px; position: relative; padding-bottom: 100px; display: none; }
        .tab-content { display: none; max-width: 1000px; margin: 0 auto; animation: fadeIn 0.3s ease; }
        .tab-content.active { display: block; }
       
        .card { background: var(--white); padding: 25px; border-radius: 15px; box-shadow: var(--shadow); margin-bottom: 30px; }
        h3 { margin-top: 0; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; color: #1e293b; }
        /* Stats Bar */
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; margin-bottom: 20px; }
        .stat-item { background: #f8fafc; padding: 15px; border-radius: 12px; text-align: center; border: 1px solid #e2e8f0; }
        .stat-value { display: block; font-size: 20px; font-weight: bold; color: var(--primary); }
        .stat-label { font-size: 11px; color: #64748b; }
        #logs-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
        }
        .mini-card {
            background: #fff; border-radius: 15px; padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-top: 4px solid var(--primary);
            text-align: center; transition: 0.3s; position: relative;
        }
        .mini-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
        .mini-card .name { font-size: 16px; font-weight: bold; color: #1e293b; margin-bottom: 5px; margin-top: 10px; }
        .mini-card .phone { font-size: 14px; color: #64748b; margin-bottom: 15px; }
       
        .turn-badge {
            position: absolute; top: -12px; left: 15px;
            background: var(--primary); color: white;
            width: 35px; height: 35px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-weight: bold; font-size: 14px; border: 3px solid var(--bg);
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        .ann-item {
            background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
            padding: 15px; margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-end;
            animation: fadeIn 0.3s ease; flex-wrap: wrap;
        }
        .modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.7);
            display: none; align-items: center; justify-content: center; z-index: 9999;
            backdrop-filter: blur(5px);
        }
        .modal-content {
            background: white; width: 90%; max-width: 500px; padding: 25px;
            border-radius: 20px; position: relative; line-height: 1.8;
        }
        .close-modal { position: absolute; top: 15px; left: 15px; cursor: pointer; font-size: 24px; color: #64748b; }
        .svc-master-box { border: 2px solid #e2e8f0; border-radius: 15px; margin-bottom: 20px; background: #fff; overflow: hidden; }
        .svc-master-header { display: flex; gap: 10px; align-items: center; padding: 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; cursor: pointer; flex-wrap: wrap; }
        .svc-body { padding: 15px; display: block; }
        .device-sub-item { background: #ffffff; border-radius: 10px; margin-bottom: 12px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
        .device-header { display: flex; gap: 10px; align-items: center; padding: 10px; background: #f1f5f9; cursor: pointer; border-bottom: 1px solid #e2e8f0; }
        .device-content { padding: 15px; display: block; }
        .hidden { display: none !important; }
        .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
        .input-group { margin-bottom: 15px; }
        label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 13px; color: #475569; }
        input, select, textarea { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-family: tahoma; box-sizing: border-box; outline: none; font-size: 13px; }
        .btn { border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-family: tahoma; font-weight: bold; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
        .btn-save { background: var(--success); color: white; width: 100%; max-width: 400px; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2); }
        .btn-add { background: var(--primary); color: white; margin-top: 10px; }
        .btn-del { background: #fee2e2; color: var(--danger); font-size: 11px; }
        .sub-items-wrapper, .brands-wrapper { background: #f8fafc; margin-top: 15px; padding: 12px; border-radius: 8px; border: 1px dashed #cbd5e1; }
        .si-row, .brand-row { display: flex; gap: 5px; margin-bottom: 8px; }
       
        .save-bar { position: fixed; bottom: 0; left: 0; right: 260px; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); padding: 15px; border-top: 1px solid #e2e8f0; display: flex; justify-content: center; z-index: 1000; transition: 0.3s; }
        .toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 10px; color: white; display: none; z-index: 10001; }
        @media (max-width: 768px) {
            body { flex-direction: column; }
            .sidebar {
                position: fixed; right: -260px; top: 0; bottom: 0; width: 260px;
                height: 100vh; transition: 0.3s; box-shadow: -5px 0 15px rgba(0,0,0,0.2);
            }
            .sidebar.open { right: 0; }
            .mobile-header { display: flex; }
            .main-content { padding: 80px 15px 120px 15px; }
            .save-bar { right: 0; width: 100%; box-sizing: border-box; }
            .stats-grid { grid-template-columns: 1fr 1fr; }
            .svc-master-header { flex-direction: column; align-items: stretch; }
            .ann-item { flex-direction: column; align-items: stretch; }
            .ann-item div { width: 100% !important; }
        }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    
/* اصلاح اسکرول منوی مدیریت */
.sidebar {
    height: 100vh;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    overscroll-behavior: contain;
}

/* نوار اسکرول منوی مدیریت */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e293b;
}

/* اصلاح نمایش منو در موبایل */
@media (max-width: 768px) {
    .sidebar {
        height: 100vh;
        max-height: 100vh;
        box-sizing: border-box;
        overflow-y: auto;
    }
}
