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

:root {
  font-synthesis-weight: none;
  --violet: #6A1BCE;
  --blue: #1E88E5;
  --indigo: #4A3BD1;
  --turquoise: #00B9AD;
  --ink: #172033;
  --muted: #6f7896;
  --soft: #9AA4D6;
  --line: #e7eaf5;
  --bg: #f5f7fb;
  --sidebar: #0f1428;
  --gold: #F5C542;
  --surface: #ffffff;
  --shadow: 0 18px 45px rgba(23,32,51,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); text-align: start; }
.admin-rtl { font-family: "Cairo", "Tahoma", sans-serif; }
.admin-icon { width: 18px; height: 18px; flex: 0 0 auto; }
a { color: inherit; text-decoration: none; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(106,27,206,.18), transparent 32%), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 32px; box-shadow: 0 24px 60px rgba(23,32,51,.12); }
.brand-mark { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--violet), var(--blue)); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: 0 14px 30px rgba(106,27,206,.28); }
.brand-mark .admin-icon { width: 22px; height: 22px; color: #fff; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 292px; background: radial-gradient(circle at 20% 0%, rgba(106,27,206,.34), transparent 28%), linear-gradient(180deg, #121935, var(--sidebar)); color: #dfe6ff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .2s ease, transform .2s ease; box-shadow: 18px 0 45px rgba(15,20,40,.16); }
.sidebar.collapsed { width: 82px; }
.sidebar-head { height: 72px; display: flex; align-items: center; gap: 12px; padding-inline: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-title { font-weight: 800; line-height: 1.1; white-space: nowrap; }
.sidebar.collapsed .sidebar-title, .sidebar.collapsed .nav-text, .sidebar.collapsed .nav-group { display: none; }
.nav-scroll { overflow: auto; padding: 14px 10px 24px; }
.nav-group { color: var(--soft); font-size: 12px; font-weight: 700; padding-block: 18px 8px; padding-inline: 12px; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding-block: 10px; padding-inline: 12px; border-radius: 8px; color: #dfe6ff; margin: 2px 0; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.11); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-link.active .nav-icon { background: linear-gradient(135deg, var(--gold), #ffeaa0); color: #392800; box-shadow: 0 8px 18px rgba(245,197,66,.2); }
.nav-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 13px; flex: 0 0 auto; color: #f5f7ff; }
.nav-icon .admin-icon { width: 17px; height: 17px; }
.main { flex: 1; min-width: 0; }
.topbar { min-height: 74px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-inline: 24px; position: sticky; top: 0; z-index: 10; box-shadow: 0 8px 24px rgba(23,32,51,.04); }
.icon-btn, .btn { border: 0; border-radius: 8px; min-height: 38px; padding: 9px 14px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; }
.icon-btn { width: 42px; padding: 0; background: #eef2ff; color: var(--indigo); }
.icon-btn:hover, .btn-secondary:hover { background: #e3e8ff; color: var(--violet); }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; }
.btn-secondary { background: #eef2ff; color: var(--indigo); }
.btn-danger { background: #ffe8ec; color: #c51f42; }
.btn-link { background: transparent; color: var(--indigo); padding: 0; }
.content { padding: 24px; max-width: 1440px; margin-inline: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-title { margin: 0; font-size: 26px; letter-spacing: 0; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 112px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; inset-inline-end: -28px; top: -32px; width: 92px; height: 92px; border-radius: 50%; background: rgba(106,27,206,.06); }
.stat-icon { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--violet), var(--blue)); box-shadow: 0 14px 28px rgba(74,59,209,.2); }
.stat-icon .admin-icon { width: 22px; height: 22px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.stat-label, .muted { color: var(--muted); }
.section-title { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.section-title .admin-icon { color: var(--indigo); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink); }
.textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-full { grid-column: 1 / -1; }
.label { display: block; font-weight: 700; margin-bottom: 7px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; background: #fafbff; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; background: #eef2ff; color: var(--indigo); }
.badge.ok { background: #e6fbf8; color: #00877e; }
.badge.warn { background: #fff4df; color: #a76700; }
.alert { padding: 13px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); background: #fff; font-weight: 650; }
.alert-success { border-color: #bff4e9; background: #edfffb; color: #00796f; }
.alert-warning { border-color: #ffe0a6; background: #fff8eb; color: #8b5a00; }
.alert-error { border-color: #ffc5d0; background: #fff0f3; color: #b31235; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.language-switcher { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.language-label, .user-pill { display: inline-flex; align-items: center; gap: 7px; }
.user-pill { min-height: 38px; padding-inline: 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.pagination { margin-top: 16px; }
.pagination nav > div:first-child { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 30; inset-inline-start: 0; transform: translateX(-100%); }
  .admin-rtl .sidebar { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: 280px; }
  .sidebar.collapsed .sidebar-title, .sidebar.collapsed .nav-text, .sidebar.collapsed .nav-group { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
