@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --navy: #304873;
    --navy-deep: #233858;
    --gold: #c9a45c;
    --ink: #1f2d3d;
    --muted: #748196;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --line: #e5eaf1;
    --danger: #b94a48;
    font-family: Cairo, Tahoma, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); direction: rtl; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; direction: ltr; }
.admin-sidebar { background: var(--navy-deep); color: #fff; padding: 28px 20px; direction: rtl; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 50%; }
.brand strong { display: block; font-size: 15px; line-height: 1.6; }
.brand small { color: #bac7db; }
.side-nav { display: grid; gap: 8px; margin-top: 26px; }
.side-nav a { padding: 12px 14px; border-radius: 6px; color: #dce5f3; transition: .2s ease; }
.side-nav a:hover, .side-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.side-nav .logout { color: #f4c2c0; margin-top: 20px; }
.admin-main { direction: rtl; padding: 30px clamp(18px, 4vw, 54px); max-width: 1500px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.topbar h1 { margin: 0; color: var(--navy-deep); font-size: clamp(22px, 3vw, 32px); }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; padding: 11px 18px; cursor: pointer; background: var(--navy); color: #fff; font-weight: 700; }
.btn:hover { background: var(--navy-deep); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.light { background: #eef2f7; color: var(--navy); }
.btn.danger { background: #f9e8e7; color: var(--danger); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(35,56,88,.05); }
.stat-card { padding: 22px; }
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 8px; color: var(--navy); font-size: 32px; }
.panel { padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 20px; color: var(--navy-deep); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 14px 10px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
td { font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 14px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,.12); }
.field textarea { min-height: 145px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.alert { padding: 13px 16px; border-radius: 5px; margin-bottom: 18px; background: #e8f4ee; color: #276749; }
.alert.error { background: #f9e8e7; color: var(--danger); }
.thumb { width: 60px; height: 45px; border-radius: 4px; object-fit: cover; background: #edf1f6; }
.upload-preview { width: 180px; height: 120px; border-radius: 6px; object-fit: cover; background: #edf1f6; border: 1px solid var(--line); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--navy-deep), var(--navy)); }
.login-box { width: min(100%, 450px); background: #fff; padding: 36px; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.login-box .brand { color: var(--ink); border: 0; padding: 0 0 24px; }
.login-box .brand small { color: var(--muted); }
.login-box h1 { margin: 0 0 8px; font-size: 24px; color: var(--navy-deep); }
.login-box p { color: var(--muted); margin: 0 0 24px; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { padding: 18px; } .side-nav { display: flex; flex-wrap: wrap; } .side-nav .logout { margin-top: 0; } .cards { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .topbar, .panel-head { align-items: stretch; flex-direction: column; } .form-grid { grid-template-columns: 1fr; } .field.full { grid-column: auto; } .admin-main { padding: 22px 14px; } }
