/* ============================================================
   BINAYED — Admin Panel CSS  (v3 · Light Mode · 2026-10)
   ============================================================ */

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

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

/* ── Variables ─────────────────────────────────────────────*/
:root {
  --adm-bg:          #f0f2f5;
  --adm-sidebar:     #ffffff;
  --adm-card:        #ffffff;
  --adm-card2:       #f8f9fb;
  --adm-border:      #e4e7ec;
  --adm-border2:     #c8cdd8;
  --adm-gold:        #b8922e;
  --adm-gold2:       #d4a843;
  --adm-teal:        #0284c7;
  --adm-teal2:       #0369a1;
  --adm-green:       #16a34a;
  --adm-red:         #dc2626;
  --adm-yellow:      #d97706;
  --adm-purple:      #7c3aed;
  --adm-text:        #111827;
  --adm-text2:       #374151;
  --adm-muted:       #6b7280;
  --adm-muted2:      #9ca3af;
  --adm-sidebar-w:   260px;
  --adm-radius:      14px;
  --adm-radius-sm:   9px;
  --adm-shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --adm-shadow-lg:   0 4px 24px rgba(0,0,0,.12);
  --adm-trans:       .2s cubic-bezier(.4,0,.2,1);
}

/* ── Body ──────────────────────────────────────────────────*/
body.adm-body {
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  background: var(--adm-bg);
  color: var(--adm-text);
  direction: rtl;
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ────────────────────────────────────────────────*/
.adm-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--adm-sidebar-w);
  height: 100vh;
  background: var(--adm-sidebar);
  border-left: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e4e7ec transparent;
  box-shadow: -2px 0 12px rgba(0,0,0,.04);
}
.adm-sidebar::-webkit-scrollbar { width: 4px; }
.adm-sidebar::-webkit-scrollbar-thumb { background: #dde0e7; border-radius: 4px; }

/* Brand */
.adm-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--adm-border);
  text-decoration: none; color: var(--adm-text);
  transition: background var(--adm-trans);
}
.adm-brand:hover { background: var(--adm-card2); }
.adm-brand img { width: 36px; height: 36px; object-fit: contain; }
.adm-brand-name { font-weight: 900; font-size: 15px; color: var(--adm-gold); letter-spacing: .2px; }
.adm-brand-sub  { font-size: 10px; color: var(--adm-muted); font-weight: 500; }

/* Nav */
.adm-nav { flex: 1; padding: 10px 0; }
.adm-nav-section {
  padding: 10px 18px 4px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--adm-muted2);
}
.adm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: var(--adm-muted);
  text-decoration: none;
  font-size: 13.5px; font-weight: 600;
  border-right: 3px solid transparent;
  transition: all var(--adm-trans);
  border-radius: 0;
}
.adm-nav-item:hover { color: var(--adm-teal2); background: #eff8ff; border-right-color: #93c5fd; }
.adm-nav-item.active {
  color: var(--adm-teal2);
  background: linear-gradient(90deg, #eff8ff, #f0f9ff);
  border-right-color: var(--adm-teal);
  font-weight: 700;
}
.adm-nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.adm-nav-badge {
  margin-right: auto;
  background: var(--adm-red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}

/* Nav Dividers (section labels) */
.adm-nav-divider {
  padding: 10px 18px 4px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--adm-muted2);
  margin-top: 4px;
}

/* Sub nav items (indented) */
.adm-nav-item.adm-nav-sub {
  padding-right: 36px;
  font-size: 12.5px;
  color: var(--adm-muted2);
}
.adm-nav-item.adm-nav-sub:hover { color: var(--adm-teal2); }
.adm-nav-item.adm-nav-sub.active { color: var(--adm-teal2); border-right-color: var(--adm-teal); }

/* Collapsible nav group */
.adm-nav-group-wrap { }
.adm-nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 9px 18px;
  background: none; border: none; cursor: pointer;
  color: var(--adm-muted); font-size: 13.5px; font-weight: 600;
  font-family: inherit;
  transition: all var(--adm-trans);
}
.adm-nav-group-toggle:hover { color: var(--adm-teal2); background: #eff8ff; }
.adm-nav-group-toggle.open { color: var(--adm-teal2); }
.adm-nav-chevron {
  font-size: 18px; line-height: 1;
  transition: transform 0.2s ease;
  transform: rotate(0deg);
}
.adm-nav-group-toggle.open .adm-nav-chevron { transform: rotate(90deg); }
.adm-nav-group { display: none; }
.adm-nav-group.open { display: block; }

/* Page admin header banner */
.adm-page-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--adm-teal), #0369a1);
  color: #fff; padding: 16px 22px; border-radius: 12px;
  margin-bottom: 22px;
}
.adm-page-banner-title { font-size: 18px; font-weight: 800; }
.adm-page-banner-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.adm-page-banner-link {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); color: #fff;
  padding: 7px 14px; border-radius: 8px;
  text-decoration: none; font-size: 12px; font-weight: 600;
  transition: background 0.2s;
}
.adm-page-banner-link:hover { background: rgba(255,255,255,0.32); color: #fff; }

/* Two-column page admin layout */
.adm-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.adm-page-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 900px) { .adm-page-grid, .adm-page-grid-3 { grid-template-columns: 1fr; } }

/* Section separator inside card */
.adm-section-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--adm-teal2);
  padding: 14px 0 8px;
  border-top: 1px solid var(--adm-border); margin-top: 8px;
}
.adm-section-title:first-child { border-top: none; margin-top: 0; padding-top: 0; }


.adm-sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--adm-border);
  display: flex; align-items: center; gap: 10px;
  background: var(--adm-card2);
}
.adm-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--adm-gold), var(--adm-teal));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0;
}
.adm-user-info { flex: 1; min-width: 0; }
.adm-user-name { font-weight: 700; font-size: 13px; color: var(--adm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-role { font-size: 10px; color: var(--adm-muted); font-weight: 500; }
.adm-logout-btn {
  background: none; border: none;
  color: var(--adm-muted); cursor: pointer;
  font-size: 17px; padding: 5px;
  border-radius: 8px;
  transition: color var(--adm-trans), background var(--adm-trans);
}
.adm-logout-btn:hover { color: var(--adm-red); background: #fef2f2; }

/* ── Main ──────────────────────────────────────────────────*/
.adm-main { margin-right: var(--adm-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Topbar ─────────────────────────────────────────────────*/
.adm-topbar {
  background: var(--adm-sidebar);
  border-bottom: 1px solid var(--adm-border);
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.adm-topbar-title { font-weight: 800; font-size: 16px; color: var(--adm-text); }
.adm-topbar-path  { font-size: 11px; color: var(--adm-muted); font-weight: 500; margin-top: 1px; }
.adm-topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Content ───────────────────────────────────────────────*/
.adm-content { flex: 1; padding: 24px; }

/* ── Cards ─────────────────────────────────────────────────*/
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 22px 24px;
  box-shadow: var(--adm-shadow);
}
.adm-card + .adm-card { margin-top: 18px; }

.adm-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.adm-card-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--adm-teal); margin-bottom: 3px;
}
.adm-card-title   { font-size: 18px; font-weight: 800; color: var(--adm-text); }
.adm-card-desc    { margin-top: 3px; font-size: 12.5px; color: var(--adm-muted); line-height: 1.6; }

/* ── Stats Grid ────────────────────────────────────────────*/
.adm-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr));
  gap: 14px; margin-bottom: 20px;
}
.adm-stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--adm-trans);
  text-decoration: none; color: inherit;
  box-shadow: var(--adm-shadow);
  position: relative; overflow: hidden;
}
.adm-stat-card:hover { transform: translateY(-2px); box-shadow: var(--adm-shadow-lg); border-color: var(--adm-border2); }
.adm-stat-card::after {
  content: ''; position: absolute;
  top: 0; right: 0; width: 4px; height: 100%;
  border-radius: 0 var(--adm-radius) var(--adm-radius) 0;
}
.adm-stat-card.gold::after   { background: var(--adm-gold); }
.adm-stat-card.teal::after   { background: var(--adm-teal); }
.adm-stat-card.green::after  { background: var(--adm-green); }
.adm-stat-card.red::after    { background: var(--adm-red); }
.adm-stat-card.purple::after { background: var(--adm-purple); }

.adm-stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; flex-shrink: 0;
}
.adm-stat-card.gold   .adm-stat-icon { background: #fef9ee; }
.adm-stat-card.teal   .adm-stat-icon { background: #eff8ff; }
.adm-stat-card.green  .adm-stat-icon { background: #f0fdf4; }
.adm-stat-card.red    .adm-stat-icon { background: #fef2f2; }
.adm-stat-card.purple .adm-stat-icon { background: #faf5ff; }

.adm-stat-value { font-size: 28px; font-weight: 900; line-height: 1; }
.adm-stat-card.gold   .adm-stat-value { color: var(--adm-gold); }
.adm-stat-card.teal   .adm-stat-value { color: var(--adm-teal2); }
.adm-stat-card.green  .adm-stat-value { color: var(--adm-green); }
.adm-stat-card.red    .adm-stat-value { color: var(--adm-red); }
.adm-stat-card.purple .adm-stat-value { color: var(--adm-purple); }
.adm-stat-label { font-size: 12px; color: var(--adm-muted); font-weight: 600; margin-top: 2px; }

/* ── Quick Actions ─────────────────────────────────────────*/
.adm-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.adm-quick-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  background: var(--adm-card2);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  color: var(--adm-text2); text-decoration: none;
  font-size: 13px; font-weight: 700;
  transition: all var(--adm-trans); cursor: pointer;
}
.adm-quick-btn:hover { background: #eff8ff; border-color: #93c5fd; color: var(--adm-teal2); transform: translateY(-1px); }
.adm-quick-btn .qi { font-size: 18px; }

/* ── Forms ─────────────────────────────────────────────────*/
.adm-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px;
}
.adm-form-full { grid-column: 1 / -1; }

.adm-field { display: flex; flex-direction: column; gap: 6px; }
.adm-label {
  font-size: 12.5px; font-weight: 700;
  color: var(--adm-text2);
}
.adm-label-hint { font-size: 11px; font-weight: 400; color: var(--adm-muted); margin-right: 4px; }

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  color: var(--adm-text);
  font-family: 'Cairo', sans-serif;
  font-size: 13.5px; font-weight: 500;
  padding: 10px 13px;
  outline: none;
  transition: border-color var(--adm-trans), box-shadow var(--adm-trans);
  -webkit-appearance: none;
}
.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  border-color: var(--adm-teal);
  box-shadow: 0 0 0 3px rgba(2,132,199,.12);
}
.adm-input:hover:not(:focus),
.adm-select:hover:not(:focus),
.adm-textarea:hover:not(:focus) { border-color: var(--adm-border2); }
.adm-input::placeholder { color: var(--adm-muted2); }
.adm-textarea { resize: vertical; min-height: 100px; line-height: 1.7; }
.adm-input[type="color"] { height: 44px; padding: 4px 8px; cursor: pointer; }

/* Input with icon */
.adm-input-group { position: relative; }
.adm-input-group .adm-input { padding-left: 40px; }
.adm-input-group .adm-input-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--adm-muted); font-size: 15px; pointer-events: none;
}

/* Checkbox */
.adm-check-wrap { display: flex; align-items: center; gap: 9px; padding: 9px 0; }
.adm-check-wrap input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--adm-teal); cursor: pointer; }
.adm-check-label { font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--adm-text2); }

.adm-form-actions {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  padding-top: 6px; border-top: 1px solid var(--adm-border);
  margin-top: 4px;
}

/* ── Image Picker ───────────────────────────────────────────*/
.adm-img-picker {
  border: 2px dashed var(--adm-border2);
  border-radius: var(--adm-radius-sm);
  padding: 0;
  background: var(--adm-card2);
  overflow: hidden;
  transition: border-color var(--adm-trans);
}
.adm-img-picker:focus-within { border-color: var(--adm-teal); }
.adm-img-picker-preview {
  position: relative;
  width: 100%; height: 160px;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.adm-img-picker-preview img {
  width: 100%; height: 100%; object-fit: cover;
  display: none;
}
.adm-img-picker-preview video { display: none; }
.adm-img-picker-preview img.has-src,
.adm-img-picker-preview video.has-src {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.adm-img-picker-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--adm-muted); font-size: 12px; font-weight: 600;
}
.adm-img-picker-empty .icon { font-size: 32px; }
.adm-img-picker-preview.has-img .adm-img-picker-empty { display: none; }
.adm-img-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity var(--adm-trans);
}
.adm-img-picker-preview:hover .adm-img-overlay { opacity: 1; }
.adm-img-overlay button {
  background: #fff; border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; color: var(--adm-text);
  transition: background var(--adm-trans);
}
.adm-img-overlay button:hover { background: #eff8ff; color: var(--adm-teal2); }
.adm-img-picker-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--adm-border);
  background: #fff;
}
.adm-img-picker-input input {
  flex: 1;
  border: none; outline: none;
  font-family: 'Cairo', monospace;
  font-size: 12px; color: var(--adm-text2);
  background: transparent;
}
.adm-img-picker-input input::placeholder { color: var(--adm-muted2); }
.adm-img-picker-input .adm-img-browse {
  background: var(--adm-card2); border: 1px solid var(--adm-border);
  border-radius: 7px; padding: 5px 10px;
  font-size: 11px; font-weight: 700; color: var(--adm-teal2);
  cursor: pointer; white-space: nowrap;
  transition: background var(--adm-trans);
}
.adm-img-picker-input .adm-img-browse:hover { background: #eff8ff; }

/* Gallery Input */
.adm-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); gap: 10px;
  margin-bottom: 10px;
}
.adm-gallery-thumb {
  position: relative;
  border-radius: 8px; overflow: hidden;
  aspect-ratio: 1;
  background: var(--adm-card2);
  border: 1px solid var(--adm-border);
}
.adm-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-gallery-thumb .adm-gallery-remove {
  position: absolute; top: 4px; left: 4px;
  background: rgba(255,255,255,.9); border: none;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--adm-red); opacity: 0; transition: opacity var(--adm-trans);
}
.adm-gallery-thumb:hover .adm-gallery-remove { opacity: 1; }

/* ── Buttons ────────────────────────────────────────────────*/
.adm-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--adm-radius-sm);
  font-family: 'Cairo', sans-serif; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; text-decoration: none;
  transition: all var(--adm-trans); line-height: 1;
  white-space: nowrap;
}
.adm-btn-gold {
  background: linear-gradient(135deg, #c9973b, #b07d28);
  color: #fff; box-shadow: 0 2px 6px rgba(176,125,40,.25);
}
.adm-btn-gold:hover { background: linear-gradient(135deg, #d4a843, #c9973b); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(176,125,40,.35); }
.adm-btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff; box-shadow: 0 2px 6px rgba(2,132,199,.25);
}
.adm-btn-primary:hover { background: linear-gradient(135deg, #0369a1, #075985); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(2,132,199,.35); }
.adm-btn-teal { background: #eff8ff; color: var(--adm-teal2); border: 1px solid #bae6fd; }
.adm-btn-teal:hover { background: #e0f2fe; transform: translateY(-1px); }
.adm-btn-ghost { background: transparent; color: var(--adm-muted); border: 1.5px solid var(--adm-border); }
.adm-btn-ghost:hover { color: var(--adm-text); background: var(--adm-card2); border-color: var(--adm-border2); }
.adm-btn-danger { background: #fef2f2; color: var(--adm-red); border: 1px solid #fecaca; }
.adm-btn-danger:hover { background: #fee2e2; transform: translateY(-1px); }
.adm-btn-sm { padding: 6px 13px; font-size: 12px; }
.adm-btn-icon { padding: 8px; border-radius: 8px; }

/* ── Notices ────────────────────────────────────────────────*/
.adm-notice {
  padding: 12px 16px; border-radius: var(--adm-radius-sm);
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.adm-notice.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.adm-notice.error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Table ─────────────────────────────────────────────────*/
.adm-table-wrap { overflow-x: auto; border-radius: var(--adm-radius-sm); border: 1px solid var(--adm-border); }
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  padding: 10px 14px;
  background: var(--adm-card2);
  border-bottom: 1px solid var(--adm-border);
  color: var(--adm-muted);
  font-size: 11px; font-weight: 700; text-align: right;
  text-transform: uppercase; letter-spacing: .7px; white-space: nowrap;
}
.adm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--adm-border);
  font-size: 13px; vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #fafbfc; }

/* ── Badges ────────────────────────────────────────────────*/
.adm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.adm-badge.published  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.adm-badge.draft      { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.adm-badge.archived   { background: #f9fafb; color: var(--adm-muted); border: 1px solid var(--adm-border); }
.adm-badge.new        { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.adm-badge.in_progress{ background: #eff8ff; color: #075985; border: 1px solid #bae6fd; }
.adm-badge.closed     { background: #f9fafb; color: var(--adm-muted); border: 1px solid var(--adm-border); }
.adm-badge.admin      { background: #faf5ff; color: #6d28d9; border: 1px solid #e9d5ff; }
.adm-badge.editor     { background: #eff8ff; color: #075985; border: 1px solid #bae6fd; }
.adm-badge.active     { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.adm-badge.inactive   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Accordion ─────────────────────────────────────────────*/
.adm-accordion {
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  margin-bottom: 10px; overflow: hidden;
}
.adm-accordion summary {
  padding: 13px 16px;
  background: var(--adm-card2);
  cursor: pointer; font-weight: 700; font-size: 13.5px;
  list-style: none; display: flex; align-items: center; gap: 8px;
  user-select: none; transition: background var(--adm-trans);
}
.adm-accordion summary:hover { background: #eff8ff; }
.adm-accordion summary::-webkit-details-marker { display: none; }
.adm-accordion summary::after {
  content: '▾'; margin-right: auto; color: var(--adm-muted);
  transition: transform var(--adm-trans);
}
.adm-accordion[open] summary::after { transform: rotate(-180deg); }
.adm-accordion[open] summary { background: #eff8ff; color: var(--adm-teal2); }
.adm-accordion-body { padding: 18px; border-top: 1px solid var(--adm-border); background: #fff; }

/* ── Media Library ─────────────────────────────────────────*/
.adm-media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 12px; margin-top: 20px;
}
.adm-media-item {
  background: var(--adm-card2); border: 1.5px solid var(--adm-border);
  border-radius: 10px; padding: 8px; overflow: hidden;
  transition: all var(--adm-trans); cursor: pointer;
}
.adm-media-item:hover { border-color: var(--adm-teal); transform: translateY(-2px); box-shadow: var(--adm-shadow-lg); }
.adm-media-img { display: block; width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: #f3f4f6; }
.adm-media-path { display: block; overflow-wrap: anywhere; margin-top: 7px; font-size: 10px; color: var(--adm-teal2); font-family: monospace; }
.adm-media-size { font-size: 10px; color: var(--adm-muted2); margin-top: 2px; }
.adm-media-item.selected { border-color: var(--adm-teal); background: #eff8ff; }
.adm-media-item.selected .adm-media-path { color: var(--adm-teal2); font-weight: 700; }

/* ── Logo Preview ──────────────────────────────────────────*/
.adm-logo-preview { max-width: 110px; max-height: 45px; object-fit: contain; background: var(--adm-card2); border-radius: 6px; padding: 4px; border: 1px solid var(--adm-border); }

/* ── Divider ───────────────────────────────────────────────*/
.adm-divider { height: 1px; background: var(--adm-border); margin: 20px 0; }

/* ── Section Label ─────────────────────────────────────────*/
.adm-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--adm-teal);
  padding: 0 0 8px; border-bottom: 2px solid #bae6fd;
  margin-bottom: 16px; display: inline-block;
}

/* ── Filter Bar ────────────────────────────────────────────*/
.adm-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.adm-filter .adm-field { min-width: 200px; }

/* ── Empty State ───────────────────────────────────────────*/
.adm-empty { text-align: center; padding: 44px 24px; color: var(--adm-muted); }
.adm-empty-icon { font-size: 38px; margin-bottom: 10px; }
.adm-empty h3 { font-size: 15px; font-weight: 700; color: var(--adm-text); margin-bottom: 5px; }
.adm-empty p  { font-size: 13px; }

/* ── Table Inputs ──────────────────────────────────────────*/
.adm-table input:not([type=checkbox]),
.adm-table select {
  background: #fff; border: 1.5px solid var(--adm-border);
  border-radius: 7px; color: var(--adm-text);
  font-family: 'Cairo', sans-serif; font-size: 12px;
  padding: 6px 9px; width: 100%; min-width: 90px; outline: none;
  transition: border-color var(--adm-trans);
}
.adm-table input:focus, .adm-table select:focus { border-color: var(--adm-teal); }
.adm-table input[type=checkbox] { accent-color: var(--adm-teal); }

/* ── Msg Items ─────────────────────────────────────────────*/
.adm-msg-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--adm-border); }
.adm-msg-item:last-child { border-bottom: none; }
.adm-msg-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--adm-teal), var(--adm-gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0;
}
.adm-msg-name  { font-weight: 700; font-size: 13px; }
.adm-msg-meta  { font-size: 11px; color: var(--adm-muted); margin-top: 1px; }
.adm-msg-text  { font-size: 12px; color: var(--adm-muted); margin-top: 4px; line-height: 1.5; }

/* ── Login ─────────────────────────────────────────────────*/
body.adm-login-body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f0f8 100%);
  color: var(--adm-text); direction: rtl;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.adm-login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(2,132,199,.08) 0%, transparent 50%),
              radial-gradient(ellipse at 30% 80%, rgba(198,161,107,.07) 0%, transparent 50%);
  pointer-events: none;
}
.adm-login-grid { position: relative; z-index: 1; width: min(440px, calc(100vw - 32px)); }
.adm-login-card {
  background: #fff; border: 1px solid var(--adm-border);
  border-radius: 20px; padding: 34px 34px 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
}
.adm-login-brand {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 26px; padding-bottom: 20px;
  border-bottom: 1px solid var(--adm-border);
}
.adm-login-logo { width: 44px; height: 44px; object-fit: contain; }
.adm-login-brand-name { font-size: 16px; font-weight: 800; color: var(--adm-gold); }
.adm-login-brand-sub  { font-size: 11px; color: var(--adm-muted); font-weight: 500; margin-top: 1px; }
.adm-login-title     { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.adm-login-subtitle  { font-size: 13px; color: var(--adm-muted); margin-bottom: 22px; }
.adm-input-wrap { position: relative; }
.adm-input-wrap .adm-input { padding-right: 42px; }
.adm-input-icon { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--adm-muted); pointer-events: none; }
.adm-login-footer {
  margin-top: 18px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.adm-login-back { font-size: 12px; color: var(--adm-muted); text-decoration: none; }
.adm-login-back:hover { color: var(--adm-teal2); }
.adm-login-security { font-size: 10.5px; color: var(--adm-muted2); }

/* ── Setup Screen ──────────────────────────────────────────*/
.adm-setup-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--adm-bg); font-family: 'Cairo', sans-serif;
  direction: rtl; padding: 32px;
}
.adm-setup-card {
  max-width: 540px; background: #fff;
  border: 1px solid var(--adm-border); border-radius: 20px;
  padding: 36px; box-shadow: var(--adm-shadow-lg);
}
.adm-setup-icon { font-size: 44px; margin-bottom: 14px; }
.adm-setup-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.adm-setup-card p  { font-size: 13.5px; color: var(--adm-muted); line-height: 1.7; margin-bottom: 10px; }
.adm-setup-card code { background: #f3f4f6; padding: 2px 7px; border-radius: 5px; font-family: monospace; font-size: 13px; color: var(--adm-teal2); }

/* ── Image Modal ────────────────────────────────────────────*/
.adm-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
  align-items: center; justify-content: center;
}
.adm-modal-backdrop.open { display: flex; }
.adm-modal {
  background: #fff; border-radius: 16px;
  width: min(900px, calc(100vw - 32px));
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  overflow: hidden;
}
.adm-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--adm-border);
}
.adm-modal-head h3 { font-size: 16px; font-weight: 800; }
.adm-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--adm-muted); padding: 4px;
  border-radius: 6px; transition: color var(--adm-trans);
}
.adm-modal-close:hover { color: var(--adm-red); }
.adm-modal-search { padding: 12px 20px; border-bottom: 1px solid var(--adm-border); }
.adm-modal-search input {
  width: 100%; border: 1.5px solid var(--adm-border);
  border-radius: 9px; padding: 9px 13px;
  font-family: 'Cairo', sans-serif; font-size: 13px; outline: none;
}
.adm-modal-search input:focus { border-color: var(--adm-teal); }
.adm-media-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.adm-media-filter {
  border: 1px solid var(--adm-border); border-radius: 999px; padding: 5px 13px;
  background: #fff; color: var(--adm-text2); font: 600 12px 'Cairo', sans-serif;
  cursor: pointer; transition: all var(--adm-trans);
}
.adm-media-filter:hover,
.adm-media-filter.is-active { border-color: var(--adm-teal); background: #eff8ff; color: var(--adm-teal2); }
.adm-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.adm-modal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px;
}
.adm-modal-img-item {
  border: 2px solid var(--adm-border); border-radius: 8px;
  overflow: hidden; cursor: pointer;
  transition: all var(--adm-trans); padding: 0;
}
.adm-modal-img-item:hover { border-color: var(--adm-teal); transform: scale(1.02); }
.adm-modal-img-item.selected { border-color: var(--adm-teal); box-shadow: 0 0 0 3px rgba(2,132,199,.2); }
.adm-modal-img-item.is-unavailable { cursor: not-allowed; opacity: .58; }
.adm-modal-img-item.is-unavailable:hover { border-color: var(--adm-border); transform: none; }
.adm-modal-img-item img,
.adm-modal-img-item video { width: 100%; height: 85px; object-fit: cover; display: block; }
.adm-modal-img-info { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 5px 7px; background: #f9fafb; }
.adm-modal-img-info code { font-size: 9px; color: var(--adm-muted); word-break: break-all; }
.adm-media-type-badge { flex: 0 0 auto; border-radius: 999px; padding: 1px 6px; background: #e5e7eb; color: #4b5563; font-size: 9px; }
.adm-modal-img-item[data-media-type="video"] .adm-media-type-badge { background: #ede9fe; color: #6d28d9; }
.adm-media-item[hidden] { display: none !important; }
.adm-modal-foot {
  padding: 12px 20px; border-top: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.adm-modal-selected-path { font-size: 12px; color: var(--adm-teal2); font-family: monospace; }

/* ── Responsive ─────────────────────────────────────────────*/
@media (max-width: 900px) {
  .adm-sidebar { transform: translateX(100%); transition: transform var(--adm-trans); }
  .adm-sidebar.open { transform: translateX(0); }
  .adm-main { margin-right: 0; }
  .adm-topbar { padding: 0 16px; }
  .adm-content { padding: 14px; }
  .adm-stats-grid { grid-template-columns: repeat(2,1fr); }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-card { padding: 16px; }
  .adm-menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 1.5px solid var(--adm-border);
    border-radius: 9px; background: transparent; cursor: pointer;
    color: var(--adm-text); font-size: 18px;
  }
}
@media (min-width: 901px) { .adm-menu-toggle { display: none; } }
@media (max-width: 600px) {
  .adm-stats-grid { grid-template-columns: 1fr; }
  .adm-quick-grid { grid-template-columns: repeat(2,1fr); }
  .adm-login-card { padding: 22px 16px; }
}

.adm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 90;
}
.adm-overlay.visible { display: block; }

/* Scrollbar */
.adm-main ::-webkit-scrollbar { width: 6px; height: 6px; }
.adm-main ::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }
.adm-modal-body::-webkit-scrollbar { width: 5px; }
.adm-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }
