/* Admin Layout with Drawer Sidebar */
.admin-panel-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-dark);
}

.admin-top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-card-solid);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000; /* Lower than modal */
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.admin-top-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.admin-top-header .header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.admin-top-header .header-right {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.admin-top-header .site-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
}

.admin-quick-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.admin-quick-info .admin-name {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-quick-info .admin-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.admin-menu-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.admin-menu-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-light);
}

.admin-menu-toggle .hamburger {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: all 0.3s ease;
}

.admin-menu-toggle .hamburger::before,
.admin-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    left: 0;
    transition: all 0.3s ease;
}

.admin-menu-toggle .hamburger::before { top: -8px; }
.admin-menu-toggle .hamburger::after { bottom: -8px; }

.admin-main-content {
    flex: 1;
    margin-right: 0; /* Sidebar is hidden by default */
    padding: 2rem;
    padding-top: 6rem; /* Space for top header */
    min-width: 0;
    transition: all 0.4s ease;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    display: none;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.admin-sidebar-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .admin-main-content {
        padding: 1rem;
        padding-top: 6rem;
    }
    .admin-top-header .site-name {
        font-size: 1.1rem;
    }
    .admin-quick-info .admin-name {
        display: none;
    }
}

/* Table and Content styling updates for the new layout */
.admin-section {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 800;
}

/* User Info Cell Styles */
.user-info-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.user-real-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.badge-count {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    box-shadow: 0 4px 10px rgba(168, 85, 255, 0.3);
}

.admin-table-img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.admin-table-img:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}


/* Prevent horizontal scrolling on mobile only */
@media (max-width: 768px) {
    body.admin-body,
    html.admin-html {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
        touch-action: pan-y; /* Allow vertical scrolling only */
    }

    .admin-panel {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .admin-panel .container {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000; /* Increased to be above top-header (1100) */
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(109, 6, 150, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: var(--danger);
    background: var(--bg-hover);
    transform: rotate(90deg);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* Login Form */
.login-form {
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: fadeInScale 0.5s ease-out;
}

.login-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.login-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 85, 255, 0.25);
}

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

/* Category Dropdown in Admin Modal */
.custom-select-wrapper-admin {
    position: relative;
    width: 100%;
    z-index: 10000;
}

.custom-select-trigger-admin {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.custom-select-trigger-admin:hover {
    border-color: var(--primary-color);
}

.custom-select-trigger-admin .arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.custom-select-trigger-admin.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(168, 85, 255, 0.25);
}

.custom-select-trigger-admin.active .arrow {
    transform: rotate(180deg);
}

.custom-select-options-admin {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.category-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    font-weight: 600;
}

.category-checkbox-item:hover {
    background: rgba(168, 85, 255, 0.12);
}

.category-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.category-checkbox-item label {
    margin: 0 !important;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168, 85, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #cc2952;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 51, 102, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--bg-dark);
}

.btn-success:hover {
    background: #00cc6e;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.alert.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--success);
    color: var(--success);
}

.alert.alert-error {
    background: rgba(255, 51, 102, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.alert.alert-info {
    background: rgba(168, 85, 255, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Admin Panel */
.admin-panel {
    animation: fadeIn 0.5s ease-out;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-text {
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.nav-text span {
    color: var(--primary-color);
}

/* Account Management */
.account-forms-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.5s ease-out;
    overflow: visible;
    position: relative;
}

.account-form-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    overflow: visible;
    position: relative;
    z-index: 20; /* اجعل كرت النموذج فوق الجدول دائماً */
}

.account-form-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(168, 85, 255, 0.2);
}

/* Ensure dropdown positioning is not affected by parent transforms */
.account-form-card:hover .custom-streamer-select .select-dropdown {
    transform: none !important;
}

.account-form-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.account-form-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.account-form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Grid - Ensure dropdowns can overflow */
.form-grid {
    overflow: visible !important;
    position: relative;
}

/* Scheduled form specific tweaks */
.scheduled-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.scheduled-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-start;
}

/* Ensure custom streamer select container has proper positioning */
.form-grid .custom-streamer-select {
    position: relative !important;
    z-index: 1001 !important;
    transform: none !important; /* Prevent transform from affecting dropdown */
}

.form-grid .custom-streamer-select .select-dropdown {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    transform: none !important; /* Ensure dropdown position is not affected */
}

/* Pinned Announcement Management */
.pinned-form-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.pinned-form-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.pinned-form-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 255, 0.2);
}

.pinned-form-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.pinned-form-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pinned-form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Custom Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.5rem;
}

.checkbox-label .checkbox-custom {
    margin: 0;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-hover);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Admin Tabs - على الحاسوب: سحب/تمرير أفقي لرؤية كل الأقسام */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    touch-action: pan-x;
    /* على الحاسوب: إظهار شريط التمرير الرفيع لمعرفة إمكانية السحب */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
}

.admin-tabs::-webkit-scrollbar {
    height: 6px;
}

.admin-tabs::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.admin-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.admin-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #7c3aed);
}

.admin-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
    flex-shrink: 0;
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--primary-color);
}

.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-section {
    animation: fadeInUp 0.5s ease-out;
    overflow: visible;
    position: relative;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.admin-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Admin Table */
.admin-table-container {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: visible;
    position: relative;
    z-index: 5; /* أقل من كرت النموذج حتى لا يغطي القائمة */
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.admin-table-container .admin-table {
    overflow: visible;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--bg-hover);
    border-bottom: 2px solid var(--primary-color);
}

.admin-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.admin-table th:first-child {
    width: 70px;
    text-align: center;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-table td:first-child {
    text-align: center;
    padding: 0.5rem;
}

.admin-table tbody tr {
    transition: all 0.3s ease;
}

.admin-table tbody tr:hover {
    background: var(--bg-hover);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.loading-cell {
    text-align: center !important;
    padding: 3rem !important;
}

.loading-cell .spinner {
    margin: 0 auto 1rem;
}

/* Table Avatar */
.table-avatar-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-block;
}

.table-avatar-placeholder-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.table-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 2;
}

.table-avatar.loaded {
    opacity: 1;
}

.table-avatar.lazy-image {
    background: transparent;
}

.table-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
}

.status-badge.live {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(176, 176, 176, 0.2);
    color: var(--text-secondary);
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.live .dot {
    animation: blink 1.5s ease-in-out infinite;
}

/* Status Dropdown */
.status-dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 10001;
}

.admin-table td {
    position: relative;
    overflow: visible;
}

.status-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000 !important;
    min-width: 150px;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-dropdown-item:hover {
    background: var(--bg-hover);
}

.status-dropdown-item.active {
    background: rgba(168, 85, 255, 0.1);
    color: var(--primary-color);
}

.status-dropdown-item:first-child {
    border-bottom: 1px solid var(--border-color);
}

.status-dropdown-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-dropdown-item:first-child .dot {
    background: var(--success);
}

.status-dropdown-item:last-child .dot {
    background: var(--text-secondary);
}

/* Platform Badges */
.platform-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Kick badge - Green */
.platform-badge.platform-kick {
    background: rgba(83, 255, 26, 0.1);
    color: #53ff1a;
    border: 1px solid rgba(83, 255, 26, 0.3);
}

/* Twitch badge - Purple */
.platform-badge.platform-twitch {
    background: rgba(145, 70, 255, 0.1);
    color: #9146ff;
    border: 1px solid rgba(145, 70, 255, 0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.edit:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(168, 85, 255, 0.12);
}

.action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 51, 102, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
        border-radius: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* منع zoom على iOS */
    }

    .header-content {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .header-left {
        display: flex;
        gap: 0.8rem;
        align-items: center;
        flex-wrap: wrap;
        flex: 1;
        min-width: 0;
    }
    
    .nav-left {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .nav-left .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .nav-text {
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .btn-sm {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    
    .logo {
        flex-shrink: 0;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* إخفاء شريط الأقسام العلوي على الجوال (يُستخدم القائمة الجانبية بدلاً منه) */
    .admin-tabs {
        display: none !important;
        margin-bottom: 0;
    }

    /* تحسين الجداول - Card View على الموبايل */
    .admin-table-container {
        overflow-x: visible;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table th,
    .admin-table td,
    .admin-table tr {
        display: block;
    }
    
    .admin-table thead {
        display: none;
    }
    
    .admin-table tr {
        background: var(--bg-card);
        border: 2px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        position: relative;
    }
    
    .admin-table td {
        border: none;
        padding: 0.5rem 0;
        text-align: right;
        position: relative;
        padding-right: 50%;
        padding-left: 0;
    }
    
    .admin-table td:before {
        content: attr(data-label);
        position: absolute;
        right: 0;
        font-weight: 700;
        color: var(--primary-color);
        font-size: 0.9rem;
    }
    
    .admin-table td:first-child {
        text-align: center;
        padding-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .admin-table td:first-child:before {
        display: none;
    }

    .action-buttons {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 80px;
        min-height: 44px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .account-forms-container {
        grid-template-columns: 1fr;
    }

    .account-form-card {
        padding: 1.5rem;
    }

    .pinned-form-container {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .pinned-form-card {
        padding: 1.5rem;
    }

    .pinned-form-header {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }

    .pinned-form-header h3 {
        font-size: 1.25rem;
    }

    .pinned-form-header p {
        font-size: 0.9rem;
    }
}

/* ============================================================================
   القائمة الجانبية للوحة التحكم (الجوال والأجهزة الصغيرة فقط)
   ============================================================================ */
.admin-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.admin-sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--border-color);
}

.admin-sidebar .sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.admin-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.admin-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #7c3aed);
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: right;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
    border: 1px solid transparent;
}

.admin-sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.admin-sidebar-link.active {
    background: rgba(168, 85, 255, 0.15);
    color: var(--primary-color);
    border-color: rgba(168, 85, 255, 0.4);
}

/* زر العودة للصفحة الرئيسية */
.admin-sidebar-home {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.12), rgba(0, 255, 136, 0.06));
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.admin-sidebar-home:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    color: var(--success);
}

.admin-sidebar-home-icon {
    font-size: 1.2rem;
    display: inline-block;
}

/* فاصل "أقسام لوحة التحكم" */
.admin-sidebar-divider {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.25rem 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* على الشاشات الكبيرة إخفاء زر القائمة (القائمة الجانبية للجوال فقط) */
@media (min-width: 769px) {
    body.admin-body .menu-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    body.admin-body .menu-toggle {
        display: flex;
    }
}

/* منع سحب/تمرير الصفحة عندما القائمة الجانبية مفتوحة (الاعتماد على position:fixed في JS) */
body.admin-sidebar-open {
    overflow: hidden;
}
