/* RadiX Dark Theme - Professional & Modern */
@import url('../fonts/fonts.css');

:root {
    /* Dark Theme Colors */
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    --secondary: #8B5CF6;
    --accent: #10B981;
    
    /* Status Colors */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Dark Background */
    --bg-body: #0F172A;
    --bg-sidebar: #1E293B;
    --bg-topbar: #1E293B;
    --bg-card: #1E293B;
    --bg-input: #0F172A;
    
    /* Text Colors */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-disabled: #64748B;
    
    /* Borders & Shadows */
    --border-color: #334155;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Enable text selection for inputs, textareas, and buttons */
input, textarea, select, button {
    -webkit-user-select: text;
    user-select: text;
}

/* Make ALL buttons and links clickable on mobile - CRITICAL! */
button, a, .btn, .btn-logout, [onclick], [role="button"], .btn-icon, .btn-sm, 
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, 
a.btn, a[class*="btn"], input[type="submit"], input[type="button"] {
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.5) !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure minimum touch target size for mobile */
@media (max-width: 768px) {
    button, .btn, .btn-logout, a.btn, a[class*="btn"], [onclick] {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* غیرفعال کردن transform در موبایل برای جلوگیری از چرخش */
    .btn:hover,
    .btn:active,
    .btn-icon:hover,
    .btn-icon:active {
        transform: none !important;
    }
}

/* Ensure inputs are tappable and don't zoom on iOS */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    pointer-events: auto;
}

/* Form elements should be interactive */
.form-group input,
.form-group textarea,
.form-group select {
    pointer-events: auto;
    touch-action: manipulation;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.sidebar-header h1 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-align: center;
    letter-spacing: 0.5px;
}

.sidebar-header .user-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

.sidebar-menu {
    padding: 12px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    border-right: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
    border-right-color: var(--primary);
}

.sidebar-menu a.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    border-right-color: var(--primary);
    font-weight: 600;
}

.sidebar-menu .menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-menu .menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 20px;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */

.main-content {
    margin-right: 260px;
    min-height: 100vh;
    background: var(--bg-body);
    transition: margin 0.3s ease;
}

/* ============================================
   TOP BAR
   ============================================ */

.top-bar {
    background: var(--bg-topbar);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.top-bar h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar .user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar .user-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.top-bar .btn-logout {
    background: var(--danger);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(239, 68, 68, 0.3);
    pointer-events: auto;
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.top-bar .btn-logout:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.top-bar .btn-logout:active {
    background: #B91C1C;
    transform: translateY(0);
}

/* ============================================
   CARDS & CONTENT BOXES
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 20px 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card h1,
.card h2,
.card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 700;
}

.card h1 {
    font-size: 22px;
}

.card h2 {
    font-size: 18px;
}

.card h3 {
    font-size: 16px;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    border-top: 3px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-top-color: var(--primary-light);
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--primary-light);
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.stat-card.success {
    border-top-color: var(--success);
}

.stat-card.success h3 {
    color: var(--success);
}

.stat-card.danger {
    border-top-color: var(--danger);
}

.stat-card.danger h3 {
    color: var(--danger);
}

.stat-card.warning {
    border-top-color: var(--warning);
}

.stat-card.warning h3 {
    color: var(--warning);
}

/* ============================================
   TABLES
   ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

.table-responsive table {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

thead {
    background: rgba(59, 130, 246, 0.1);
}

th {
    padding: 14px 16px;
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

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

/* ============================================
   FORMS
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input:disabled,
.form-group select:disabled {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-disabled);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn,
a.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    pointer-events: auto;
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #DC2626;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #D97706;
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:hover {
    background: #7C3AED;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--info);
    color: var(--info);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid var(--danger);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   INFO BOX
   ============================================ */

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border-right: 4px solid var(--primary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    color: var(--text-primary);
}

.info-box code {
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ============================================
   SEARCH BOX
   ============================================ */

.search-box {
    position: relative;
    margin: 20px 0;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-box input::placeholder {
    color: var(--text-disabled);
    font-family: 'Vazirmatn', sans-serif;
}

.search-box button {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 64px;
    opacity: 0.5;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   RESPONSIVE UTILITY CLASSES
   ============================================ */

.flex-responsive {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.flex-responsive-mobile {
    flex-direction: column;
}

@media (max-width: 768px) {
    .flex-responsive {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

.mobile-menu-toggle {
    display: none;
}

/* Sidebar Overlay برای موبایل */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none; /* مهم: جلوگیری از مسدود کردن کلیک‌ها */
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto; /* فقط وقتی فعال است، کلیک‌ها را بگیر */
}

/* Tablet و موبایل */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        right: 16px;
        background: var(--primary);
        color: #fff;
        border: none;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        font-size: 22px;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        z-index: 1001 !important;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.1);
        background: var(--primary-dark);
    }
    
    .card {
        margin: 15px;
        padding: 20px;
    }
    
    .stat-grid {
        margin: 15px;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .top-bar {
        padding: 16px 70px 16px 20px;
        flex-wrap: wrap;
    }
    
    .top-bar h2 {
        font-size: 18px;
    }
    
    /* Table Responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px;
    }
    
    .table-responsive table {
        min-width: 800px;
        margin: 0;
    }
    
    /* Form Responsive */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Search Box Responsive */
    .search-box {
        margin: 15px;
    }
    
    .search-box form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input {
        max-width: 100%;
        min-width: auto;
    }
    
    /* Top Bar Flex Responsive */
    .top-bar > div[style*="display:flex"] {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    /* Online Count Card Responsive */
    .online-count {
        min-width: auto !important;
    }
    
    div[style*="display:flex"][style*="gap:20px"] {
        flex-direction: column;
        gap: 15px !important;
    }
    
    div[style*="min-width:250px"] {
        min-width: auto !important;
        width: 100%;
    }
    
    /* Actions Responsive */
    .actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* موبایل کوچک */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .top-bar {
        padding: 14px 60px 14px 15px;
    }
    
    .top-bar h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .top-bar .user-menu {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        width: auto;
        flex-wrap: wrap;
    }
    
    .top-bar .user-name {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .top-bar .btn-logout {
        padding: 8px 14px;
        font-size: 12px;
        min-height: 44px;
        white-space: nowrap;
    }
    
    .card {
        margin: 10px;
        padding: 16px;
    }
    
    .card h1 {
        font-size: 18px;
    }
    
    .card h2 {
        font-size: 16px;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        margin: 10px;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card h3 {
        font-size: 28px;
    }
    
    .stat-card p {
        font-size: 13px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    th {
        font-size: 11px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Minimum touch target */
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
        min-height: 44px; /* Minimum touch target */
    }
    
    .btn-sm {
        padding: 10px 14px;
        font-size: 13px;
        width: auto;
        min-height: 40px; /* Minimum touch target */
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    /* Modal Responsive */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    /* Badge Responsive */
    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Status Indicator Responsive */
    .status-indicator {
        width: 12px;
        height: 12px;
    }
    
    /* Tooltip Responsive */
    .status-tooltip {
        font-size: 10px;
        padding: 6px 10px;
        margin-right: -40px;
    }
}

/* موبایل خیلی کوچک */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }
    
    .top-bar {
        padding: 12px 55px 12px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .top-bar h2 {
        font-size: 14px;
    }
    
    .top-bar .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .top-bar .user-name {
        font-size: 12px;
    }
    
    .top-bar .btn-logout {
        padding: 6px 12px;
        font-size: 11px;
        min-height: 44px;
    }
    
    .card {
        margin: 8px;
        padding: 12px;
        border-radius: 10px;
    }
    
    .card h1 {
        font-size: 16px;
    }
    
    .card h2 {
        font-size: 14px;
    }
    
    .card h3 {
        font-size: 13px;
    }
    
    .stat-grid {
        margin: 8px;
        gap: 10px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card h3 {
        font-size: 24px;
    }
    
    .stat-card p {
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 40px;
    }
    
    /* Form elements */
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
        min-height: 44px;
    }
}

/* ============================================
   MOBILE BUTTON FIXES IN MEDIA QUERY
   ============================================ */

@media (max-width: 480px) {
    .table-responsive {
        margin: 8px;
    }
    
    .table-responsive table {
        min-width: 600px;
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Minimum touch target */
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px; /* Minimum touch target */
    }
    
    .modal-content {
        width: 98%;
        margin: 10px auto;
        padding: 16px;
    }
    
    .search-box {
        margin: 10px;
    }
    
    /* Online Count Responsive */
    .online-count h2 {
        font-size: 2.5em !important;
    }
    
    .online-count p {
        font-size: 14px !important;
    }
    
    /* Top Bar Auto Refresh Responsive */
    .top-bar > div[style*="display:flex"] > div[style*="display:flex"] {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .top-bar select {
        width: 100%;
    }
}

/* ============================================
   USERS PAGE RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
    /* Search Form Responsive - Override inline styles */
    .search-box form[style*="display:flex"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .search-box form input[style*="max-width:400px"] {
        max-width: 100% !important;
        width: 100% !important;
        flex: none !important;
    }
    
    .search-box form .btn {
        width: 100% !important;
    }
    
    /* Add User Button Responsive */
    #toggleFormBtn {
        width: 100% !important;
        display: block !important;
    }
    
    /* Form Grid Responsive - Override all inline grid styles */
    #userFormContainer div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Form Buttons Container Responsive */
    #userFormContainer > form > div[style*="display:flex"][style*="gap:10px"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    #userFormContainer button[style*="min-width:180px"],
    #userFormContainer a[style*="min-width:180px"] {
        min-width: auto !important;
        width: 100% !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Simultaneous Use Input Container Responsive */
    #userFormContainer div[style*="display:flex"][style*="gap:8px"][style*="align-items:center"] {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    #userFormContainer div[style*="display:flex"][style*="gap:8px"] input[style*="flex:1"] {
        flex: none !important;
        width: 100% !important;
    }
    
    #userFormContainer button[style*="white-space:nowrap"] {
        width: 100% !important;
        white-space: normal !important;
    }
    
    /* Activation Cards Container Responsive */
    #userFormContainer div[style*="grid-column: 1 / -1"] > div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Activation Cards Internal Flex Responsive */
    #userFormContainer div[style*="display:flex"][style*="align-items:center"][style*="gap:12px"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    /* Label with inline flex - Responsive */
    #userFormContainer label[style*="display:flex"][style*="align-items:center"] {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    
    /* Small tag with inline flex - Responsive */
    #userFormContainer small[style*="display:flex"][style*="align-items:center"] {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    
    /* Users Table Responsive */
    .users-table {
        font-size: 12px !important;
    }
    
    .users-table th,
    .users-table td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }
    
    .users-table th {
        font-size: 11px !important;
    }
    
    /* Actions Column Responsive - Override inline styles */
    .users-table td .actions[style*="display:inline-flex"] {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
        white-space: normal !important;
        display: flex !important;
    }
    
    .users-table .btn-icon {
        width: 100% !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .users-table .actions form[style*="display:inline"] {
        display: block !important;
        width: 100% !important;
    }
    
    .users-table .actions form button {
        width: 100% !important;
    }
    
    /* Status Indicator Responsive */
    .users-table .status-indicator {
        width: 12px !important;
        height: 12px !important;
    }
    
    /* Badge Responsive */
    .users-table .badge {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    
    /* Modal Responsive */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    /* Search Form Extra Small */
    .search-box {
        margin: 8px !important;
    }
    
    .search-box form {
        margin-bottom: 15px !important;
    }
    
    /* Add User Button Extra Small */
    #toggleFormBtn {
        margin-bottom: 15px !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    /* Users Table Very Small */
    .users-table {
        font-size: 11px !important;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 6px !important;
        font-size: 11px !important;
    }
    
    .users-table th {
        font-size: 10px !important;
    }
    
    /* Hide some less important columns on very small screens */
    .users-table th:nth-child(4),
    .users-table td:nth-child(4),
    .users-table th:nth-child(5),
    .users-table td:nth-child(5) {
        display: none;
    }
    
    /* Form adjustments */
    #userFormContainer {
        padding: 15px !important;
    }
    
    #userFormContainer h2 {
        font-size: 16px !important;
        margin-bottom: 15px !important;
    }
    
    .form-group {
        margin-bottom: 15px !important;
    }
    
    .form-group label {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 44px !important; /* Minimum touch target */
    }
    
    /* Form Grid Extra Small */
    #userFormContainer div[style*="grid-template-columns:1fr 1fr"] {
        gap: 12px !important;
    }
    
    /* Activation Cards Extra Small */
    #userFormContainer div[style*="display:flex"][style*="align-items:center"][style*="gap:12px"] {
        padding: 12px !important;
        gap: 10px !important;
    }
    
    /* Form Buttons Extra Small */
    #userFormContainer button[style*="min-width:180px"],
    #userFormContainer a[style*="min-width:180px"] {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    /* Actions full width - Extra Small */
    .users-table .actions {
        gap: 6px !important;
    }
    
    .users-table .actions form {
        width: 100% !important;
    }
    
    .users-table .actions .btn-icon {
        height: 38px !important;
        font-size: 12px !important;
    }
    
    /* Modal Extra Small */
    .modal-content {
        padding: 16px !important;
    }
    
    .modal-body .form-group {
        margin-bottom: 12px !important;
    }
    
    .modal-footer {
        margin-top: 20px !important;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-disabled);
}

/* ============================================
   STATUS INDICATOR - Ultra Premium Unique Design
   ============================================ */

.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    will-change: transform, box-shadow;
}

/* آفلاین - خاکستری ظریف */
.status-indicator.status-offline {
    background: #6B7280;
    box-shadow: 
        0 0 0 0.5px rgba(107, 114, 128, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.1);
    border: 0.5px solid rgba(107, 114, 128, 0.2);
}

.status-indicator.status-offline::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 65%);
    pointer-events: none;
}

.status-indicator.status-offline:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 0 1px rgba(107, 114, 128, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

/* آنلاین - سبز ظریف با انیمیشن ملایم */
.status-indicator.status-online {
    background: #10B981;
    box-shadow: 
        0 0 0 0.5px rgba(16, 185, 129, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 1px 3px rgba(16, 185, 129, 0.2);
    border: 0.5px solid rgba(16, 185, 129, 0.3);
    animation: 
        pulse-subtle-green 3s ease-in-out infinite,
        glow-soft-green 4s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

.status-indicator.status-online::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 70%);
    pointer-events: none;
    animation: sparkle-subtle-green 4s ease-in-out infinite;
}

.status-indicator.status-online::after {
    content: '';
    position: absolute;
    width: 180%;
    height: 180%;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.2);
    top: -40%;
    left: -40%;
    animation: ripple-subtle-green 3s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

.status-indicator.status-online:hover {
    transform: scale(1.12);
    animation: 
        pulse-subtle-green 2s ease-in-out infinite,
        glow-soft-green-hover 2s ease-in-out infinite;
    box-shadow: 
        0 0 0 1px rgba(16, 185, 129, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.18),
        0 2px 6px rgba(16, 185, 129, 0.3),
        0 0 12px rgba(16, 185, 129, 0.15);
}

/* چند اتصال - قرمز ظریف با انیمیشن ملایم */
.status-indicator.status-multiple {
    background: #EF4444;
    box-shadow: 
        0 0 0 0.5px rgba(239, 68, 68, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 1px 3px rgba(239, 68, 68, 0.2);
    border: 0.5px solid rgba(239, 68, 68, 0.3);
    animation: 
        pulse-subtle-red 3s ease-in-out infinite,
        glow-soft-red 4s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

.status-indicator.status-multiple::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 70%);
    pointer-events: none;
    animation: sparkle-subtle-red 4s ease-in-out infinite;
}

.status-indicator.status-multiple::after {
    content: '';
    position: absolute;
    width: 180%;
    height: 180%;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.2);
    top: -40%;
    left: -40%;
    animation: ripple-subtle-red 3s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

.status-indicator.status-multiple:hover {
    transform: scale(1.12);
    animation: 
        pulse-subtle-red 2s ease-in-out infinite,
        glow-soft-red-hover 2s ease-in-out infinite;
    box-shadow: 
        0 0 0 1px rgba(239, 68, 68, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.18),
        0 2px 6px rgba(239, 68, 68, 0.3),
        0 0 12px rgba(239, 68, 68, 0.15);
}

/* انیمیشن‌های ظریف - سبز */
@keyframes pulse-subtle-green {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 0.5px rgba(16, 185, 129, 0.25),
            inset 0 1px 1px rgba(255, 255, 255, 0.15),
            0 1px 3px rgba(16, 185, 129, 0.2);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 
            0 0 0 1px rgba(16, 185, 129, 0.3),
            inset 0 1px 1px rgba(255, 255, 255, 0.18),
            0 2px 5px rgba(16, 185, 129, 0.25);
    }
}

@keyframes glow-soft-green {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.08);
    }
}

@keyframes glow-soft-green-hover {
    0%, 100% {
        filter: brightness(1.1);
    }
    50% {
        filter: brightness(1.15);
    }
}

@keyframes sparkle-subtle-green {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.05);
    }
}

@keyframes ripple-subtle-green {
    0% {
        transform: scale(0.85);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* انیمیشن‌های ظریف - قرمز */
@keyframes pulse-subtle-red {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 0.5px rgba(239, 68, 68, 0.25),
            inset 0 1px 1px rgba(255, 255, 255, 0.15),
            0 1px 3px rgba(239, 68, 68, 0.2);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 
            0 0 0 1px rgba(239, 68, 68, 0.3),
            inset 0 1px 1px rgba(255, 255, 255, 0.18),
            0 2px 5px rgba(239, 68, 68, 0.25);
    }
}

@keyframes glow-soft-red {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.08);
    }
}

@keyframes glow-soft-red-hover {
    0%, 100% {
        filter: brightness(1.1);
    }
    50% {
        filter: brightness(1.15);
    }
}

@keyframes sparkle-subtle-red {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.05);
    }
}

@keyframes ripple-subtle-red {
    0% {
        transform: scale(0.85);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* Tooltip ظریف و حرفه‌ای */
.status-tooltip {
    display: none;
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    margin-right: -45px;
    opacity: 0;
    transform: translateY(-3px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.status-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    right: 45px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(30, 41, 59, 0.95);
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.15));
}

.status-indicator:hover .status-tooltip {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.status-tooltip strong {
    color: var(--primary-light);
    font-weight: 600;
    margin: 0 1px;
    letter-spacing: 0;
}


