/* ============================================================
   ADMIN PANEL STYLES
   ============================================================ */

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --admin-bg: #f0f2f5;
  --admin-sidebar: #0f1225;
  --admin-sidebar-hover: rgba(255,255,255,0.06);
  --admin-card: #ffffff;
  --admin-border: #e2e5ea;
  --admin-accent: #7c3aed;
  --admin-accent-light: rgba(124,58,237,0.08);
  --admin-accent-hover: #6d28d9;
  --admin-text: #1a1d2e;
  --admin-text-sec: #64748b;
  --admin-text-muted: #94a3b8;
  --admin-danger: #ef4444;
  --admin-success: #22c55e;
  --admin-radius: 10px;
  --sidebar-w: 260px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==================== LOGIN ==================== */
#login-screen,
#register-screen,
#otp-screen,
#forgot-screen,
#reset-otp-screen,
#new-pass-screen,
#sa-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0d17 0%, #12152a 50%, #0a0d17 100%);
  padding: 24px;
}

.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  text-align: center;
}

.login-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 20px;
}

.login-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 0.9rem;
  color: #8892b0;
  margin-bottom: 32px;
}

.input-group {
  text-align: left;
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
}

#login-screen .input-group input,
#register-screen .input-group input,
#otp-screen .input-group input,
#forgot-screen .input-group input,
#new-pass-screen .input-group input,
#sa-login-screen .input-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #f1f5f9;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.3s;
}

#login-screen .input-group input:focus,
#register-screen .input-group input:focus,
#otp-screen .input-group input:focus,
#forgot-screen .input-group input:focus,
#new-pass-screen .input-group input:focus,
#sa-login-screen .input-group input:focus {
  border-color: var(--admin-accent);
}

.password-wrap {
  position: relative;
}

.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.login-error i { flex-shrink: 0; font-size: 0.9rem; }

@keyframes loginShake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-6px); }
  30%      { transform: translateX(6px); }
  45%      { transform: translateX(-4px); }
  60%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
  90%      { transform: translateX(2px); }
}

.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.3s, transform 0.2s;
}

.login-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.auth-switch a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
}
.auth-switch a:hover {
  text-decoration: underline;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* OTP Inputs */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  direction: ltr; /* OTP codes are always LTR regardless of page language */
}
.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.otp-digit:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.reset-otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Inter', monospace;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.reset-otp-digit:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* ==================== DASHBOARD LAYOUT ==================== */
#dashboard {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--admin-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 24px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header i {
  color: var(--admin-accent);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #8892b0;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--admin-sidebar-hover);
  color: #f1f5f9;
}

.sidebar-link.active {
  background: var(--admin-accent-light);
  color: #c4b5fd;
}

.sidebar-link.active i {
  color: var(--admin-accent);
}

.sidebar-link i.link-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-link .drag-handle {
  cursor: grab;
  opacity: 0;
  font-size: 0.7rem;
  color: #64748b;
  transition: opacity 0.2s;
  margin-right: 2px;
}

html[dir="rtl"] .sidebar-link .drag-handle {
  margin-right: 0;
  margin-left: 2px;
}

.sidebar-nav:hover .sidebar-link .drag-handle {
  opacity: 0.5;
}

.sidebar-link:hover .drag-handle {
  opacity: 1 !important;
}

.sidebar-link.dragging {
  opacity: 0.4;
  background: rgba(124,58,237,0.1);
}

.sidebar-link.drag-over {
  border-top: 2px solid var(--admin-accent);
}

html[dir="rtl"] .sidebar-link.drag-over {
  border-top: 2px solid var(--admin-accent);
}

.sidebar-footer {
  padding: 16px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  color: #8892b0;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-action:hover {
  background: var(--admin-sidebar-hover);
  color: #f1f5f9;
}

.sidebar-action.view-site:hover {
  color: #60a5fa;
}

.sidebar-action.export:hover {
  color: #22c55e;
  background: rgba(34,197,94,0.08);
}

.sidebar-action.import:hover {
  color: #3b82f6;
  background: rgba(59,130,246,0.08);
}

.sidebar-action.danger:hover {
  color: var(--admin-danger);
  background: rgba(239,68,68,0.08);
}

.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--admin-sidebar);
  color: #f1f5f9;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0;
  min-height: 100vh;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--admin-card);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--admin-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.save-btn:hover {
  background: var(--admin-accent-hover);
  transform: translateY(-1px);
}

.content-area {
  padding: 32px;
}

/* ==================== FORM ELEMENTS ==================== */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 28px;
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-header h3 i {
  color: var(--admin-accent);
  font-size: 0.95rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field-row.single {
  grid-template-columns: 1fr;
}

.field-group {
  margin-bottom: 16px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.field-label .lang-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.lang-badge.en {
  background: #dbeafe;
  color: #2563eb;
}

.lang-badge.ar {
  background: #dcfce7;
  color: #16a34a;
}

/* Bilingual toggle */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.bilingual-toggle {
  display: flex;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.bi-toggle-btn {
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.bi-toggle-btn:hover {
  color: var(--admin-text-sec);
}

.bi-toggle-btn.active {
  background: var(--admin-accent);
  color: #fff;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--admin-text);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-light);
}

textarea.field-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}

.field-input[dir="rtl"] {
  text-align: right;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

/* Tags input */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  min-height: 42px;
  cursor: text;
  transition: border-color 0.2s;
}

.tags-input-wrap:focus-within {
  border-color: var(--admin-accent);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--admin-accent-light);
  color: var(--admin-accent);
  border-radius: 6px;
}

.tag-pill button {
  background: none;
  border: none;
  color: var(--admin-accent);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  opacity: 0.6;
}

.tag-pill button:hover {
  opacity: 1;
}

/* Draggable tags & cards */
.tag-drag-handle {
  cursor: grab;
  font-size: 0.6rem;
  color: var(--admin-text-muted);
  opacity: 0.4;
  transition: opacity 0.2s;
}

.draggable-tag:hover .tag-drag-handle {
  opacity: 1;
}

.draggable-tag {
  cursor: default;
  user-select: none;
}

.dragging-tag {
  opacity: 0.3;
}

.tag-drag-over {
  box-shadow: -2px 0 0 0 var(--admin-accent);
}

html[dir="rtl"] .tag-drag-over {
  box-shadow: 2px 0 0 0 var(--admin-accent);
}

.card-drag-handle {
  cursor: grab;
  color: var(--admin-text-muted);
  opacity: 0.4;
  transition: opacity 0.2s;
  margin-right: 6px;
}

html[dir="rtl"] .card-drag-handle {
  margin-right: 0;
  margin-left: 6px;
}

.entry-card:hover .card-drag-handle {
  opacity: 1;
}

.skill-card.dragging,
.project-card.dragging,
.exp-card.dragging {
  opacity: 0.3;
  border-style: dashed;
}

.skill-card.drag-over,
.project-card.drag-over,
.exp-card.drag-over {
  border-top: 3px solid var(--admin-accent);
}

/* ==================== COLLAPSIBLE CARDS ==================== */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

.collapsible-header h3 {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collapse-preview {
  font-weight: 400;
  opacity: 0.65;
  font-size: 0.85em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

html[dir="rtl"] .header-actions {
  margin-left: 0;
  margin-right: 12px;
}

.visibility-toggle {
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--admin-success);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.visibility-toggle:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.visibility-toggle.is-off {
  color: var(--admin-text-muted);
  opacity: 0.6;
}

.visibility-toggle.is-off:hover {
  opacity: 1;
  color: var(--admin-success);
}

.project-card.is-hidden {
  opacity: 0.55;
  border-style: dashed;
}

.project-card.is-hidden .admin-card-header h3 {
  color: var(--admin-text-muted);
}

.hidden-badge {
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  margin-left: 6px;
}

html[dir="rtl"] .hidden-badge {
  margin-left: 0;
  margin-right: 6px;
}

.collapse-toggle {
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--admin-text-muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s, color 0.2s;
}

.collapse-toggle:hover {
  color: var(--admin-accent);
}

.collapsed .collapse-toggle i {
  transform: rotate(-90deg);
}

html[dir="rtl"] .collapsed .collapse-toggle i {
  transform: rotate(90deg);
}

.collapsible-body {
  transition: opacity 0.2s;
}

.collapsed .collapsible-body {
  display: none;
}

/* List item drag */
.list-drag-handle {
  cursor: grab;
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  padding: 10px 4px 10px 0;
}

html[dir="rtl"] .list-drag-handle {
  padding: 10px 0 10px 4px;
}

.draggable-list-item:hover .list-drag-handle {
  opacity: 1;
}

.draggable-list-item {
  user-select: none;
}

.dragging-list-item {
  opacity: 0.3;
}

.list-drag-over {
  border-top: 2px solid var(--admin-accent) !important;
}

.tags-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  font-family: inherit;
  flex: 1;
  min-width: 100px;
  padding: 2px 4px;
  color: var(--admin-text);
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-light);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone i {
  font-size: 1.8rem;
  color: var(--admin-text-muted);
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--admin-text-sec);
}

.upload-zone .upload-hint {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  margin-top: 10px;
}

.upload-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.upload-preview .file-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--admin-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.upload-preview .file-info {
  flex: 1;
  min-width: 0;
}

.upload-preview .file-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview .file-size {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

.upload-preview .file-dimensions {
  font-size: 0.7rem;
  color: var(--admin-text-sec);
}

.upload-preview .remove-file {
  background: none;
  border: none;
  color: var(--admin-danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.upload-preview .remove-file:hover {
  background: rgba(239,68,68,0.08);
}

/* Draggable image previews */
.draggable-image {
  cursor: default;
  transition: opacity 0.2s, border-color 0.2s;
}

.image-drag-handle {
  cursor: grab;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  padding: 4px;
}

.draggable-image:hover .image-drag-handle {
  opacity: 1;
}

.draggable-image.dragging {
  opacity: 0.3;
  border-style: dashed;
}

.draggable-image.drag-over-top {
  border-top: 3px solid var(--admin-accent);
  margin-top: -1px;
}

.draggable-image.drag-over-bottom {
  border-bottom: 3px solid var(--admin-accent);
  margin-bottom: -1px;
}

/* ==================== ICON PICKER ==================== */
.icon-picker-field {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.icon-picker-preview {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--admin-accent);
  flex-shrink: 0;
}

.icon-picker-preview:empty {
  color: var(--admin-text-muted);
}

.icon-picker-btn {
  padding: 8px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
  color: var(--admin-text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.icon-picker-btn:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-light);
}

.icon-picker-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  padding: 12px;
  margin-top: 6px;
  min-width: 340px;
  max-width: 500px;
}

.icon-picker-header {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.icon-picker-search {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 0.85rem;
  outline: none;
}

.icon-picker-search:focus {
  border-color: var(--admin-accent);
}

.icon-picker-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
  color: var(--admin-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.icon-picker-close:hover {
  color: var(--admin-danger);
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

.icon-picker-item {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--admin-text);
  transition: background 0.15s, color 0.15s;
  border: 2px solid transparent;
}

.icon-picker-item:hover {
  background: var(--admin-accent-light);
  color: var(--admin-accent);
}

.icon-picker-item.selected {
  background: var(--admin-accent);
  color: #fff;
  border-color: var(--admin-accent);
}

.icon-picker-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--admin-border);
}

.icon-picker-clear {
  padding: 6px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.icon-picker-clear:hover {
  color: var(--admin-danger);
}

/* Dynamic entries */
.entry-card {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
}

.entry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entry-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--admin-accent);
}

.entry-delete {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--admin-danger);
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.entry-delete:hover {
  background: rgba(239,68,68,0.12);
}

.add-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--admin-accent);
  background: var(--admin-accent-light);
  border: 2px dashed rgba(124,58,237,0.2);
  border-radius: var(--admin-radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 16px;
}

.add-entry-btn:hover {
  background: rgba(124,58,237,0.12);
  border-color: var(--admin-accent);
}

/* Responsibilities / list items */
.list-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item-row {
  display: flex;
  gap: 8px;
  align-items: start;
}

.list-item-row .field-input {
  flex: 1;
}

.list-item-remove {
  padding: 10px;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.list-item-remove:hover {
  color: var(--admin-danger);
}

.add-list-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--admin-accent);
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 4px;
}

.add-list-item:hover {
  text-decoration: underline;
}

/* Gallery preview */
.gallery-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gallery-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb .remove-thumb {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icon selector */
.icon-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icon-option {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--admin-bg);
  border: 2px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--admin-text-sec);
  transition: all 0.2s;
}

.icon-option:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.icon-option.selected {
  border-color: var(--admin-accent);
  background: var(--admin-accent-light);
  color: var(--admin-accent);
}

/* ==================== ADMIN LANGUAGE TOGGLE ==================== */
.admin-lang-toggle {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 3px;
  margin: 8px 10px 4px;
}

.admin-lang-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  color: #8892b0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  position: relative;
  z-index: 2;
  transition: color 0.3s;
  border-radius: 6px;
}

.admin-lang-btn.active {
  color: #fff;
}

.admin-lang-slider {
  position: absolute;
  top: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--admin-accent);
  border-radius: 6px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* Login screen language toggle */
.login-lang-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
  width: 100px;
  backdrop-filter: blur(10px);
}

.login-lang-toggle .admin-lang-btn {
  color: #8892b0;
}

.login-lang-toggle .admin-lang-btn.active {
  color: #fff;
}

.login-lang-toggle .admin-lang-slider {
  background: var(--admin-accent);
}

/* ==================== RTL SUPPORT ==================== */
html[dir="rtl"] body {
  font-family: 'Tajawal', 'Inter', -apple-system, sans-serif;
}

/* --- Layout --- */
html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

html[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-w);
}

html[dir="rtl"] .sidebar-mobile-toggle {
  left: auto;
  right: 16px;
}

html[dir="rtl"] .login-lang-toggle {
  right: auto;
  left: 24px;
}

html[dir="rtl"] .pass-toggle {
  right: auto;
  left: 12px;
}

html[dir="rtl"] .toast {
  right: auto;
  left: 32px;
}

/* --- Text alignment --- */
html[dir="rtl"] .input-group {
  text-align: right;
}

html[dir="rtl"] .field-label {
  justify-content: flex-start;
  text-align: right;
  direction: rtl;
}

/* UI-level inputs (no explicit dir, or select) follow admin direction */
html[dir="rtl"] .field-input:not([dir]) {
  text-align: right;
  direction: rtl;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

html[dir="rtl"] select.field-input {
  text-align: right;
  direction: rtl;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

/* Content EN fields always stay LTR */
html[dir="rtl"] .field-content-en {
  text-align: left !important;
  direction: ltr !important;
  font-family: 'Inter', sans-serif !important;
}

/* Content AR fields always stay RTL */
html[dir="rtl"] .field-content-ar,
.field-content-ar {
  text-align: right;
  direction: rtl;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

html[dir="rtl"] .tags-input {
  text-align: right;
  direction: rtl;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

html[dir="rtl"] .content-header h2 {
  text-align: right;
}

html[dir="rtl"] .admin-card-header h3 {
  text-align: right;
}

html[dir="rtl"] .entry-number {
  text-align: right;
}

html[dir="rtl"] .upload-zone {
  direction: rtl;
}

html[dir="rtl"] .upload-zone p,
html[dir="rtl"] .upload-zone .upload-hint {
  text-align: center;
  direction: rtl;
}

html[dir="rtl"] .upload-preview .file-name,
html[dir="rtl"] .upload-preview .file-size {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .login-card h1,
html[dir="rtl"] .login-sub {
  text-align: center;
  direction: rtl;
}

html[dir="rtl"] .login-card label {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] #login-screen .input-group input,
html[dir="rtl"] #register-screen .input-group input,
html[dir="rtl"] #otp-screen .input-group input,
html[dir="rtl"] #forgot-screen .input-group input,
html[dir="rtl"] #new-pass-screen .input-group input {
  text-align: right;
  direction: rtl;
  font-family: 'Tajawal', 'Inter', sans-serif;
}

html[dir="rtl"] .login-error {
  text-align: right;
  direction: rtl;
}

/* --- Sidebar text --- */
html[dir="rtl"] .sidebar-header {
  direction: rtl;
}

html[dir="rtl"] .sidebar-link {
  direction: rtl;
}

html[dir="rtl"] .sidebar-action {
  direction: rtl;
}

html[dir="rtl"] .sidebar-link span,
html[dir="rtl"] .sidebar-action span {
  text-align: right;
}

/* --- Buttons --- */
html[dir="rtl"] .login-btn {
  direction: rtl;
}

html[dir="rtl"] .save-btn {
  direction: rtl;
}

html[dir="rtl"] .add-entry-btn {
  direction: rtl;
}

html[dir="rtl"] .entry-delete {
  direction: rtl;
}

html[dir="rtl"] .add-list-item {
  direction: rtl;
}

/* --- Gallery thumb remove button flip --- */
html[dir="rtl"] .gallery-thumb .remove-thumb {
  right: auto;
  left: 4px;
}

/* --- Messages --- */
.message-card {
  margin-bottom: 12px;
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.message-card.message-unread {
  border-left: 3px solid var(--admin-accent);
  background: var(--admin-accent-light);
}

html[dir="rtl"] .message-card.message-unread {
  border-left: none;
  border-right: 3px solid var(--admin-accent);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.message-sender-name {
  font-weight: 600;
  color: var(--admin-text);
  font-size: 0.95rem;
}

.message-sender-email {
  color: var(--admin-text-sec);
  font-size: 0.82rem;
  margin-left: 8px;
}

html[dir="rtl"] .message-sender-email {
  margin-left: 0;
  margin-right: 8px;
}

.message-date {
  color: var(--admin-text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.message-subject {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.message-body {
  color: var(--admin-text-sec);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.message-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--admin-border);
  padding-top: 12px;
}

.message-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--admin-border);
  background: none;
  color: var(--admin-text-sec);
  transition: all 0.2s;
}

.message-action-btn:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.delete-msg-btn:hover {
  border-color: var(--admin-danger);
  color: var(--admin-danger);
  background: rgba(239,68,68,0.06);
}

.mark-read-btn:hover {
  border-color: var(--admin-success);
  color: var(--admin-success);
  background: rgba(34,197,94,0.06);
}

.unread-badge {
  background: var(--admin-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
}

html[dir="rtl"] .unread-badge {
  margin-left: 0;
  margin-right: auto;
}

/* --- Responsive RTL --- */
@media (max-width: 900px) {
  html[dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  html[dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }
  html[dir="rtl"] .main-content {
    margin-right: 0;
  }
  html[dir="rtl"] .content-header {
    padding-left: 20px;
    padding-right: 64px;
  }
}

/* ==================== CONFIRM MODAL ==================== */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: confirmFadeIn 0.15s ease;
}
@keyframes confirmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.confirm-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: 360px;
  max-width: calc(100vw - 40px);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  animation: confirmSlideUp 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes confirmSlideUp {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239,68,68,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.3rem;
  color: #f87171;
}
.confirm-msg {
  font-size: 0.95rem;
  color: var(--admin-text);
  margin: 0 0 24px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-btn {
  flex: 1;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.confirm-cancel {
  background: var(--admin-bg-input);
  color: var(--admin-text-sec);
  border: 1px solid var(--admin-border);
}
.confirm-cancel:hover { background: var(--admin-hover); color: var(--admin-text); }
.confirm-ok {
  background: #ef4444;
  color: #fff;
}
.confirm-ok:hover { background: #dc2626; }

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #1a1d2e;
  color: #f1f5f9;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  color: var(--admin-success);
  font-size: 1.1rem;
}

.toast.error i {
  color: var(--admin-danger);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
  }

  .content-area {
    padding: 20px 16px;
  }

  .content-header {
    padding: 16px 20px;
    padding-left: 64px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .login-card {
    padding: 32px 24px;
  }

  .content-header h2 {
    font-size: 1rem;
  }
}

/* ==================== ANALYTICS DASHBOARD ==================== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.analytics-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.analytics-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.analytics-card-wide {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
}

.analytics-card-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.analytics-card-info {
  display: flex;
  flex-direction: column;
  position: relative;
}

.analytics-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1.2;
}

.analytics-card-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--admin-text-sec);
  margin-top: 4px;
}

.analytics-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  position: absolute;
  top: 8px;
  right: -16px;
  animation: livePulse 2s ease-in-out infinite;
}

html[dir="rtl"] .analytics-live-dot {
  right: auto;
  left: -16px;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.social-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.social-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--admin-bg);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text);
}

.social-stat i {
  font-size: 1.3rem;
}

.analytics-chart-bars {
  padding: 8px 0 0;
}

.chart-wrapper {
  display: flex;
  gap: 10px;
  height: 240px;
  padding-bottom: 24px;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
  width: 28px;
  padding: 0 0 2px;
}

.chart-y-tick {
  font-size: 0.65rem;
  color: var(--admin-text-muted);
  line-height: 1;
}

.chart-plot {
  flex: 1;
  position: relative;
  min-width: 0;
}

.chart-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chart-grid-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--admin-border);
  opacity: 0.6;
}

.chart-grid-line:first-child { opacity: 0; }

.chart-bars-inner {
  position: absolute;
  inset: 0;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
  position: relative;
  cursor: default;
}

.chart-bar-count {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--admin-accent);
  margin-bottom: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  min-height: 12px;
  line-height: 1;
}

.chart-bar-col:hover .chart-bar-count {
  opacity: 1;
}

.chart-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--admin-accent) 0%, rgba(124,58,237,0.3) 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s cubic-bezier(0.4,0,0.2,1), background 0.15s;
}

.chart-bar.empty {
  background: var(--admin-border);
  opacity: 0.4;
}

.chart-bar-col:hover .chart-bar:not(.empty) {
  background: linear-gradient(180deg, #9333ea 0%, rgba(124,58,237,0.5) 100%);
}

.chart-bar-label {
  font-size: 0.58rem;
  color: var(--admin-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: absolute;
  bottom: -18px;
  text-align: center;
  width: 100%;
}

/* Country stats */
.country-stats-list {
  padding: 8px 0;
}

.country-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  transition: background 0.15s;
}

.country-stat-row:hover {
  background: rgba(124,58,237,0.05);
}

.country-flag {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.country-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--admin-text);
  min-width: 100px;
  flex-shrink: 0;
}

.country-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--admin-border);
  border-radius: 4px;
  overflow: hidden;
}

.country-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--admin-accent), rgba(124,58,237,0.5));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.country-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--admin-text);
  min-width: 40px;
  text-align: right;
}

.country-pct {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  min-width: 45px;
  text-align: right;
}

.analytics-card.loading {
  min-height: 90px;
  position: relative;
  overflow: hidden;
}

.analytics-card-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(124,58,237,0.05) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .social-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Admin Buttons (shared) --- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text-sec);
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-btn:hover {
  background: var(--admin-hover);
  border-color: var(--admin-accent);
  color: var(--admin-text);
  transform: translateY(-1px);
}

.admin-btn-primary {
  background: var(--admin-accent);
  color: #fff;
  border-color: var(--admin-accent);
}

.admin-btn-primary:hover {
  background: #6d28d9;
  border-color: #6d28d9;
  box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}

.admin-btn-secondary {
  background: var(--admin-bg-input);
  color: var(--admin-text-sec);
  border-color: var(--admin-border);
}
.admin-btn-secondary:hover {
  background: var(--admin-hover);
  color: var(--admin-text);
}

/* --- Themes --- */
.theme-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.theme-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.theme-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.1);
}

.theme-card.theme-active {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 1px var(--admin-accent), 0 8px 30px rgba(124,58,237,0.2);
}

/* Theme preview mini */
.theme-preview {
  padding: 0;
  height: 180px;
  overflow: hidden;
  position: relative;
}

.theme-preview-nav {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.theme-preview-dots {
  display: flex;
  gap: 4px;
}

.theme-preview-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.theme-preview-body {
  padding: 12px 16px;
}

.theme-preview-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.theme-preview-line {
  height: 6px;
  border-radius: 3px;
  margin-bottom: 6px;
  width: 80%;
  opacity: 0.5;
}

.theme-preview-line.short {
  width: 50%;
}

.theme-preview-card {
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

.theme-preview-btn {
  width: 50px;
  height: 18px;
  border-radius: 4px;
}

/* Theme card info */
.theme-card-info {
  padding: 16px;
}

.theme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.theme-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-text);
  margin: 0;
}

.theme-active-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34,197,94,0.1);
  padding: 3px 10px;
  border-radius: 12px;
}

.theme-color-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.1);
}

.theme-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.admin-btn-danger {
  color: #ef4444;
  border-color: rgba(239,68,68,0.2);
  background: rgba(239,68,68,0.05);
}

.admin-btn-danger:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  box-shadow: 0 4px 15px rgba(239,68,68,0.15);
}

/* Theme editor */
.theme-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
}

.theme-editor-header .admin-input {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
}

.theme-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.theme-editor-vars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-var-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-var-row:hover {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.1);
}

.theme-var-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--admin-text-sec);
  white-space: nowrap;
}

.theme-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-color-input {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 2px;
  background: transparent;
}

.theme-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.theme-color-input::-webkit-color-swatch {
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.theme-hex-input {
  width: 90px !important;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem !important;
  text-align: center;
  background: var(--admin-bg) !important;
  border: 1px solid var(--admin-border) !important;
  color: var(--admin-text) !important;
  border-radius: 8px !important;
  padding: 8px !important;
}

.theme-editor-preview {
  position: sticky;
  top: 80px;
  align-self: start;
}

.theme-preview-large {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .themes-grid {
    grid-template-columns: 1fr;
  }
  .theme-editor-grid {
    grid-template-columns: 1fr;
  }
  .theme-editor-header {
    flex-wrap: wrap;
  }
}

/* ==================== MOBILE APP SETTINGS ==================== */
.app-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--admin-border);
  border-radius: 28px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--admin-accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--admin-text-sec);
}

.app-settings-save {
  margin-top: 16px;
  width: auto;
  padding: 12px 32px;
}

/* Wallet Card Preview */
.wallet-card-preview {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.wallet-card {
  width: 340px;
  background: #1e40af;
  border-radius: 16px;
  padding: 24px;
  color: white;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  overflow: hidden;
}


.wallet-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.wallet-card-logo {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-right: auto;
}

.wallet-card-position {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.wallet-card-position-val {
  font-size: 0.8rem;
  font-weight: 600;
}

.wallet-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.wallet-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-field-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.wallet-field-value {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.9;
}

.wallet-card-back-hint {
  margin-top: 16px;
  font-size: 0.7rem;
  opacity: 0.5;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Wallet Editor Layout */
.wallet-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.wallet-color-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
}

.wallet-color-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wallet-color-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text-sec);
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrap input[type="color"] {
  width: 40px;
  height: 40px;
  border: 2px solid var(--admin-border);
  border-radius: 10px;
  cursor: pointer;
  padding: 2px;
  background: var(--admin-card);
}

.color-input-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrap input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.color-hex {
  width: 100px !important;
  font-family: 'SF Mono', monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .wallet-editor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .wallet-card {
    width: 100%;
  }
}

/* ==================== LANGUAGES SECTION ==================== */
.lang-name-dropdown { position: relative; }
.lang-name-selected {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--admin-card);
  border: 1px solid var(--admin-border); border-radius: 10px;
  cursor: pointer; color: var(--admin-text); font-size: 0.875rem;
  transition: border-color 0.2s;
}
.lang-name-selected:hover { border-color: var(--admin-accent); }
.lang-name-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--admin-card); border: 1px solid var(--admin-border);
  border-radius: 10px; overflow-y: auto; max-height: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.lang-name-option {
  padding: 9px 14px; font-size: 0.85rem; color: var(--admin-text-sec); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-name-option:hover { background: var(--admin-accent-light); color: var(--admin-text); }
.lang-name-option.selected { color: var(--admin-accent); background: var(--admin-accent-light); }
.lang-custom-opt { color: var(--admin-text-muted); border-top: 1px solid var(--admin-border); }

/* Level selector — 4 cards */
.lang-level-select {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
@media (max-width: 600px) { .lang-level-select { grid-template-columns: repeat(2, 1fr); } }
.lang-level-option {
  padding: 10px 10px 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--admin-border); background: var(--admin-bg);
  transition: border-color 0.2s, background 0.2s;
}
.lang-level-option:hover { background: var(--admin-accent-light); border-color: var(--admin-accent); }
.lang-level-option.selected { background: var(--admin-accent-light); border-color: var(--admin-accent); }
.lang-level-label { font-size: 0.78rem; font-weight: 600; color: var(--admin-text-sec); margin-bottom: 6px; }
.lang-level-option.selected .lang-level-label { color: var(--admin-accent); }
.lang-level-bar { height: 4px; background: var(--admin-border); border-radius: 2px; overflow: hidden; }
.lang-level-fill { height: 100%; background: linear-gradient(90deg, #7c3aed, #3b82f6); border-radius: 2px; }

/* ==================== YEAR PICKER ==================== */
.year-picker {
  position: relative;
  flex: 1;
  min-width: 120px;
}
.yp-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--admin-text);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}
.yp-btn:hover, .yp-btn.open {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-light);
}
.yp-chevron {
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.yp-btn.open .yp-chevron { transform: rotate(180deg); }
.yp-display { color: var(--admin-text); }
.yp-display.placeholder { color: var(--admin-text-muted); }
.yp-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  padding: 10px;
  width: 220px;
}
.yp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--admin-border) transparent;
}
.yp-year-btn {
  padding: 8px 4px;
  font-size: 0.82rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--admin-text-sec);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}
.yp-year-btn:hover {
  background: var(--admin-accent-light);
  color: var(--admin-accent);
  border-color: rgba(124,58,237,0.3);
}
.yp-year-btn.selected {
  background: var(--admin-accent);
  color: #fff;
  font-weight: 600;
}
.yp-clear {
  margin-top: 8px;
  width: 100%;
  padding: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.yp-clear:hover { border-color: #f87171; color: #f87171; }

/* ==================== DATE PICKER ==================== */
.date-picker { position: relative; }
.dp-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--admin-text);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}
.dp-btn:hover, .dp-btn.open {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-light);
}
.dp-display { color: var(--admin-text); }
.dp-display.placeholder { color: var(--admin-text-muted); }
.dp-chevron { font-size: 0.7rem; color: var(--admin-text-muted); transition: transform 0.2s; flex-shrink: 0; }
.dp-btn.open .dp-chevron { transform: rotate(180deg); }
.dp-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  padding: 12px;
  width: 260px;
}
.dp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dp-nav-btn {
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--admin-text);
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-family: inherit;
}
.dp-nav-btn:hover { background: var(--admin-accent-light); border-color: var(--admin-accent); color: var(--admin-accent); }
.dp-month-year {
  font-size: 0.85rem; font-weight: 600; color: var(--admin-text);
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; font-family: inherit; transition: background 0.15s, color 0.15s;
  flex: 1; text-align: center;
}
.dp-month-year:hover { background: var(--admin-accent-light); color: var(--admin-accent); }
.dp-weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.dp-weekday { font-size: 0.68rem; color: var(--admin-text-muted); text-align: center; padding: 3px 0; }
.dp-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.dp-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 2px;
}
.dp-year-grid::-webkit-scrollbar { width: 4px; }
.dp-year-grid::-webkit-scrollbar-track { background: transparent; }
.dp-year-grid::-webkit-scrollbar-thumb { background: var(--admin-border); border-radius: 2px; }
.dp-yr-btn {
  padding: 6px 4px; font-size: 0.78rem; font-family: inherit;
  background: none; border: 1px solid transparent;
  border-radius: 6px; color: var(--admin-text-sec);
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.dp-yr-btn:hover { background: var(--admin-accent-light); color: var(--admin-accent); border-color: rgba(124,58,237,0.3); }
.dp-yr-btn.selected { background: var(--admin-accent); color: #fff; font-weight: 600; border-color: var(--admin-accent); }

/* Month-year picker month grid */
.myp-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.myp-month-btn {
  padding: 9px 4px;
  font-size: 0.82rem;
  font-family: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--admin-text-sec);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.myp-month-btn:hover { background: var(--admin-accent-light); color: var(--admin-accent); border-color: rgba(124,58,237,0.3); }
.myp-month-btn.selected { background: var(--admin-accent); color: #fff; font-weight: 600; border-color: var(--admin-accent); }

.dp-day {
  padding: 6px 2px;
  font-size: 0.8rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--admin-text-sec);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
}
.dp-day:hover { background: var(--admin-accent-light); color: var(--admin-accent); border-color: rgba(124,58,237,0.3); }
.dp-day.selected { background: var(--admin-accent); color: #fff; font-weight: 600; border-color: var(--admin-accent); }
.dp-day.empty { pointer-events: none; visibility: hidden; }
.dp-clear {
  margin-top: 8px; width: 100%; padding: 6px;
  font-size: 0.78rem; font-family: inherit;
  background: none; border: 1px solid var(--admin-border);
  border-radius: 6px; color: var(--admin-text-muted); cursor: pointer; transition: all 0.15s;
}
.dp-clear:hover { border-color: #f87171; color: #f87171; }

/* ==================== SEX SELECTION ==================== */
.sex-select {
  display: flex;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.sex-opt {
  padding: 9px 22px;
  font-size: 0.85rem;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--admin-text-sec);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}
.sex-opt:first-child { border-right: 1px solid var(--admin-border); }
.sex-opt:hover { background: var(--admin-accent-light); color: var(--admin-accent); }
.sex-opt.selected { background: var(--admin-accent); color: #fff; }
