/* ============ الدخول ============ */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); }
.login-card { background: #fff; border-radius: 20px; padding: 34px 30px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }

/* ============ ترويسة الإدارة ============ */
.admin-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.admin-tag { background: var(--sand); color: #3a2600; font-size: 12px; padding: 2px 9px; border-radius: 8px; font-family: 'Tajawal'; }

/* ============ البطاقات الإحصائية ============ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--teal); }
.stat-card .num { font-size: 28px; font-weight: 700; font-family: 'Reem Kufi'; color: var(--ink); }
.stat-card .label { color: var(--muted); font-size: 13.5px; }
.stat-card.accent { border-color: var(--sand); }
.stat-card.new { border-color: var(--success); }

/* ============ التبويبات ============ */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab { background: none; border: none; padding: 11px 18px; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 22px; }

/* ============ جداول/بطاقات الإدارة ============ */
.admin-row { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-row .thumb-sm { width: 74px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--teal-light); flex-shrink: 0; }
.admin-row .main { flex: 1; min-width: 180px; }
.admin-row .main h3 { font-size: 17px; margin-bottom: 3px; }
.admin-row .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.admin-row .actions { display: flex; gap: 7px; flex-wrap: wrap; }

.pill { padding: 3px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.pill.published { background: #e4f6ee; color: #157a51; }
.pill.draft { background: #eef1f2; color: var(--muted); }
.pill.new { background: #fff3d6; color: var(--sand-dark); }
.pill.confirmed { background: #e4f6ee; color: #157a51; }
.pill.cancelled { background: #fdeaea; color: var(--danger); }
.pill.approved { background: #e4f6ee; color: #157a51; }
.pill.pending { background: #fff3d6; color: var(--sand-dark); }
.pill.hidden { background: #eef1f2; color: var(--muted); }

/* ============ منطقة الرفع ============ */
.upload-zone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph .rm { position: absolute; top: 4px; inset-inline-start: 4px; background: rgba(214,69,69,.92); color: #fff; border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.photo-grid .ph .cover-badge { position: absolute; bottom: 4px; inset-inline-end: 4px; background: var(--sand); color: #3a2600; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 700; }

.mini-empty { text-align: center; color: var(--muted); padding: 40px 20px; background: var(--card); border-radius: 14px; }

/* ملخّص الحجوزات عند الفلترة */
.bookings-summary {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
  background: var(--teal-light); border: 1px solid #cfe7e9; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px;
}
.bookings-summary .s-item { display: flex; flex-direction: column; }
.bookings-summary .s-item .n { font-size: 24px; font-weight: 700; font-family: 'Reem Kufi'; color: var(--teal-dark); }
.bookings-summary .s-item .l { font-size: 12.5px; color: var(--muted); }
.bookings-summary .s-title { font-weight: 700; color: var(--ink); font-size: 16px; margin-inline-end: auto; }

/* ============ الإعدادات ============ */
.settings-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; max-width: 720px; }
.settings-card h3 { font-size: 18px; margin-bottom: 14px; }
.settings-card label input[type=checkbox] { width: auto; margin-inline-end: 6px; transform: scale(1.2); vertical-align: middle; }
#heroPreview img, #heroPreview video { max-height: 140px; border-radius: 10px; border: 1px solid var(--line); }

/* ============ محرّر التصويت ============ */
.vote-editor { background: #fafcfc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.vote-editor label input[type=checkbox] { width: auto; margin-inline-end: 6px; transform: scale(1.2); vertical-align: middle; }
.vote-date-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vote-date-chips .vdc {
  display: inline-flex; align-items: center; gap: 8px; background: var(--teal-light);
  color: var(--teal-dark); padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 13.5px;
}
.vote-date-chips .vdc button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; }

/* ============ معرض الإدارة ============ */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-admin-item { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.gallery-admin-item .ga-media { aspect-ratio: 4/3; background: var(--teal-light); position: relative; }
.gallery-admin-item .ga-media img, .gallery-admin-item .ga-media video { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-item .ga-media .ga-vid { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.gallery-admin-item .ga-body { padding: 12px 14px; }
.gallery-admin-item .ga-body .ga-name { font-weight: 700; }
.gallery-admin-item .ga-body .ga-meta { color: var(--muted); font-size: 12.5px; margin: 2px 0 4px; }
.gallery-admin-item .ga-media .ga-star { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--sand); color: #3a2600; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.ga-note-row { display: flex; gap: 6px; margin: 8px 0; max-width: 460px; }
.ga-note-row .field { padding: 7px 10px; font-size: 13px; }
.gallery-admin-item .ga-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ المحادثة ============ */
.chat-thread { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; margin-bottom: 12px; background: #fafcfc; border: 1px solid var(--line); border-radius: 12px; }
.chat-thread .chat-empty { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.chat-msg { max-width: 80%; padding: 9px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.chat-msg.me { align-self: flex-start; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.them { align-self: flex-end; background: #eef2f3; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-msg.system { align-self: center; max-width: 92%; background: #fff3d6; color: var(--sand-dark); font-size: 13px; text-align: center; border-radius: 10px; font-weight: 500; }
.chat-msg .t { display: block; font-size: 10.5px; opacity: .75; margin-top: 4px; }
.chat-input { display: flex; gap: 8px; }
.chat-input .field { flex: 1; }
.tab .tab-badge, .btn .tab-badge { background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 20px; margin-inline-start: 4px; font-family: 'Tajawal'; }

/* نتائج التصويت في مودال الإدارة */
.vote-results { margin: 6px 0 16px; }
.vote-results .vr-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vote-results .vr-date { min-width: 130px; font-weight: 700; font-size: 14px; }
.vote-results .vr-bar { flex: 1; height: 10px; background: #e9eff0; border-radius: 6px; overflow: hidden; }
.vote-results .vr-bar > span { display: block; height: 100%; background: var(--teal); }
.vote-results .vr-row.lead .vr-bar > span { background: var(--sand); }
.vote-results .vr-count { min-width: 64px; text-align: end; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .admin-row { padding: 12px; }
  .tab { padding: 10px 12px; font-size: 14px; }
}
