/* ==========================================================================
   CURIOSITY | فضول — Admin Panel Stylesheet (RTL)
   ========================================================================== */

:root {
    --fa-indigo: #1E1B4B;
    --fa-orange: #F97316;
    --fa-yellow: #FBBF24;
    --fa-bg: #F8FAFC;
    --fa-surface: #FFFFFF;
    --fa-border: #E2E8F0;
    --fa-font: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body.admin-body {
    margin: 0;
    font-family: var(--fa-font);
    background: var(--fa-bg);
    color: #0F172A;
    direction: rtl;
    text-align: right;
    line-height: 1.65;
}
a { color: #EA580C; text-decoration: none; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--fa-indigo);
    color: #E0E7FF;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.admin-brand {
    padding: 6px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    margin-bottom: 14px;
}
.admin-brand strong { color: #FFFFFF; font-size: 1.15rem; display: block; }
.admin-brand span { color: var(--fa-yellow); font-size: 0.82rem; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav-sec { font-size: 0.74rem; color: #A5B4FC; padding: 12px 12px 4px; font-weight: 700; }
.admin-nav a {
    color: #E0E7FF;
    padding: 9px 13px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.91rem;
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(249, 115, 22, 0.25);
    color: #FFFFFF;
}

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    background: var(--fa-surface);
    border-bottom: 1px solid var(--fa-border);
    padding: 14px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.admin-content { padding: 24px 26px; flex: 1; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--fa-surface);
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    padding: 16px 18px;
}
.stat-card .label { font-size: 0.84rem; color: #64748B; font-weight: 700; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--fa-indigo); margin-top: 4px; }

.panel {
    background: var(--fa-surface);
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.12rem; color: var(--fa-indigo); }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--fa-border);
    text-align: right;
    vertical-align: middle;
}
table.data-table th { background: #F8FAFC; color: #475569; font-weight: 800; font-size: 0.82rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px; font-family: inherit; font-weight: 700;
    font-size: 0.88rem; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--fa-orange); color: #FFFFFF; }
.btn-primary:hover { background: #EA580C; color: #FFFFFF; }
.btn-outline { background: #FFFFFF; color: #0F172A; border-color: var(--fa-border); }
.btn-danger { background: #FEE2E2; color: #991B1B; }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 700; font-size: 0.86rem; }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid var(--fa-border);
    border-radius: 9px; font-family: inherit; font-size: 0.92rem; background: #fff;
}
textarea.form-control { min-height: 100px; resize: vertical; }

.status-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.77rem; font-weight: 800; }
.badge-published   { background: #DCFCE7; color: #166534; }
.badge-review      { background: #DBEAFE; color: #1E40AF; }
.badge-draft       { background: #F1F5F9; color: #334155; }
.badge-archived    { background: #E2E8F0; color: #475569; }
.badge-unavailable { background: #FEE2E2; color: #991B1B; }

.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%); padding: 20px;
}
.login-card { width: 100%; max-width: 420px; background: #FFFFFF; border-radius: 18px; padding: 32px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35); }

@media (max-width: 900px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
}
