/* Admin Console Styles (Complete Arabic RTL Version) */

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

html, body {
    direction: rtl;
    text-align: right;
}

.admin-body {
    background-color: #0f172a;
    color: #f8fafc;
    min-height: 100vh;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
}

.admin-header {
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
}

.admin-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

.admin-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    direction: rtl;
    text-align: right;
}

.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    direction: rtl;
}

.page-title-bar h1 {
    font-size: 1.65rem;
    font-weight: 800;
    text-align: right;
}

.page-title-bar p {
    text-align: right;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    direction: rtl;
}

.stat-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-align: right;
}

.stat-card .num {
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
    text-align: right;
}

.stat-card .label {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 600;
    text-align: right;
}

/* Data Table */
.table-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    direction: rtl;
    text-align: right;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    direction: rtl;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    direction: rtl;
}

.data-table th {
    background: #0f172a;
    padding: 14px 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: right !important;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    font-size: 0.95rem;
    text-align: right !important;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
    text-align: right;
}

.table-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #334155;
    flex-shrink: 0;
}

.user-meta .name {
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
    text-align: right;
}

.user-meta .token {
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
    text-align: right;
    direction: ltr;
    display: inline-block;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #475569;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    right: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(-21px);
}

/* Badges & Actions */
.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

.badge-status-active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-status-inactive { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-status-expired { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.action-btns {
    display: flex;
    gap: 8px;
    direction: rtl;
    justify-content: flex-start;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

/* Login Form Card */
.login-box {
    max-width: 400px;
    margin: 80px auto;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
    direction: rtl;
}

.login-box h2 {
    margin-bottom: 8px;
    font-weight: 800;
}

.login-box p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 24px;
}
