/* ================================================================
   لوحة تحكم الظُّلْمِيّ — Admin Panel Styles
================================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --adm-bg:          #f1f5f9;
  --adm-sidebar:     #1e293b;
  --adm-accent:      #5d7a44;
  --adm-accent-dark: #485e34;
  --adm-border:      #e2e8f0;
  --adm-text:        #1e293b;
  --adm-muted:       #64748b;
  --adm-card:        #fff;
  --adm-mob-top-h:   56px;
  --adm-mob-nav-h:   64px;
}

/* ── Visibility helpers ──────────────────────────────────── */
.adm-mob-only  { display: none  !important; }
.adm-desk-only { display: block !important; }

/* ── Reset & Base ────────────────────────────────────────── */
.adm-root * { box-sizing: border-box; }
.adm-root { font-family: 'Tajawal', sans-serif; font-size: 14px; direction: rtl; text-align: right; }

/* ── Not Configured Screen ───────────────────────────────── */
.adm-unconfigured {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; padding: 24px;
}
.adm-unconfigured-card {
  background: #fff; border-radius: 20px; padding: 48px 40px; max-width: 560px; width: 100%;
  border: 1px solid #e2e8f0; box-shadow: 0 4px 32px rgba(0,0,0,.07); text-align: center;
}
.adm-unconfigured-card h2 { font-family: 'El Messiri',serif; font-size: 26px; color: #1e293b; margin: 16px 0 8px; }
.adm-unconfigured-card p  { color: #64748b; line-height: 1.8; margin: 0 0 20px; }
.adm-cfg-steps { text-align: right; background: #f8fafc; border-radius: 12px; padding: 18px 20px; margin: 0 0 24px; }
.adm-cfg-steps li { color: #475569; line-height: 2; font-size: 13.5px; }
.adm-cfg-steps code { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-size: 12px; direction: ltr; display: inline-block; }

/* ── Login ───────────────────────────────────────────────── */
.adm-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4f0 0%, #f8fafc 100%);
}
.adm-login-card {
  background: #fff; border-radius: 20px; padding: 44px 40px; width: min(440px, 94vw);
  border: 1px solid #e2e8f0; box-shadow: 0 8px 40px rgba(0,0,0,.09); text-align: center;
}
.adm-login-logo { height: 64px; width: auto; margin: 0 auto 16px; display: block; }
.adm-login-card h1 { font-family: 'El Messiri',serif; font-size: 22px; color: #1e293b; margin: 0 0 4px; }
.adm-login-card > p { color: #64748b; margin: 0 0 28px; font-size: 13px; }
.adm-login-card input {
  display: block; width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; font-family: inherit; font-size: 14px;
  margin-bottom: 12px; text-align: right; direction: rtl;
  transition: border-color .2s, box-shadow .2s;
}
.adm-login-card input:focus { outline: none; border-color: #5d7a44; box-shadow: 0 0 0 3px rgba(93,122,68,.12); }
.adm-login-btn {
  width: 100%; padding: 13px; background: #5d7a44; color: #fff; border: none;
  border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 4px; transition: background .2s, transform .1s;
}
.adm-login-btn:hover   { background: #485e34; }
.adm-login-btn:active  { transform: scale(.98); }
.adm-login-btn:disabled{ opacity: .6; cursor: not-allowed; }
.adm-login-error { background: #fef2f2; color: #dc2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 10px; }

/* ── Dashboard Layout ────────────────────────────────────── */
.adm-dashboard {
  display: flex; min-height: 100vh;
  background: #f1f5f9;
}
.adm-sidebar {
  width: 240px; flex-shrink: 0; background: #1e293b; color: #e2e8f0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.adm-sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.adm-sidebar-header img { height: 40px; width: auto; filter: brightness(1.15); }
.adm-site-name { font-family: 'El Messiri',serif; font-size: 16px; font-weight: 700; }
.adm-site-sub  { font-size: 11px; opacity: .5; margin-top: 1px; }
.adm-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.adm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; font-family: inherit;
  font-size: 13.5px; color: #94a3b8; cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: right;
  transition: background .2s, color .2s;
}
.adm-nav-item:hover  { background: rgba(255,255,255,.07); color: #e2e8f0; }
.adm-nav-item.active { background: rgba(93,122,68,.25); color: #86efac; }
.adm-nav-icon { font-size: 16px; flex-shrink: 0; }
.adm-nav-badge {
  margin-right: auto; background: #dc2626; color: #fff;
  border-radius: 99px; font-size: 10px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.adm-sidebar-footer {
  padding: 16px 10px 20px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 6px;
}
.adm-user-email { font-size: 11px; color: #64748b; padding: 0 6px; word-break: break-all; }
.adm-logout-btn, .adm-site-btn {
  padding: 8px 14px; border-radius: 8px; font-family: inherit; font-size: 12.5px;
  cursor: pointer; border: none; display: flex; align-items: center; gap: 8px;
}
.adm-logout-btn { background: rgba(239,68,68,.15); color: #f87171; }
.adm-logout-btn:hover { background: rgba(239,68,68,.25); }
.adm-site-btn   { background: rgba(255,255,255,.06); color: #94a3b8; }
.adm-site-btn:hover { background: rgba(255,255,255,.12); color: #e2e8f0; }

/* ── Main Content Area ───────────────────────────────────── */
.adm-main { flex: 1; overflow-y: auto; min-width: 0; }
.adm-page { padding: 28px 28px 40px; max-width: 1100px; }
.adm-page-full { max-width: none; width: 100%; padding: 22px 20px 36px; }
.adm-page-title { font-family: 'El Messiri',serif; font-size: 22px; color: #1e293b; margin: 0 0 6px; }
.adm-page-sub   { color: #64748b; font-size: 13px; margin: 0 0 24px; }

/* ── Cards / Panels ──────────────────────────────────────── */
.adm-card {
  background: #fff; border-radius: 14px; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.adm-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.adm-card-title { font-family: 'El Messiri',serif; font-size: 16px; color: #1e293b; margin: 0; }
.adm-card-body  { padding: 20px; }

/* ── Buttons ─────────────────────────────────────────────── */
.adm-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all .2s; white-space: nowrap;
}
.adm-btn svg { flex-shrink: 0; }
.adm-btn-primary   { background: #5d7a44; color: #fff; }
.adm-btn-primary:hover { background: #485e34; }
.adm-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.adm-btn-secondary:hover { background: #e2e8f0; }
.adm-btn-danger    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.adm-btn-danger:hover { background: #fee2e2; }
.adm-btn-ghost     { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.adm-btn-ghost:hover { background: #f8fafc; }
.adm-btn-outline   { background: transparent; color: #5d7a44; border: 1px solid #5d7a44; }
.adm-btn-outline:hover { background: #f0f5eb; }
.adm-btn-sm        { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.adm-btn-icon      { padding: 7px; border-radius: 8px; }
.adm-btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Form Fields ─────────────────────────────────────────── */
.adm-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.adm-field label { font-size: 12.5px; font-weight: 600; color: #475569; }
.adm-field input, .adm-field select, .adm-field textarea {
  padding: 9px 12px; border-radius: 9px; border: 1.5px solid #e2e8f0;
  font-family: inherit; font-size: 13.5px; color: #1e293b;
  transition: border-color .2s, box-shadow .2s; background: #fff;
  direction: rtl; text-align: right;
}
.adm-field input:focus, .adm-field select:focus, .adm-field textarea:focus {
  outline: none; border-color: #5d7a44; box-shadow: 0 0 0 3px rgba(93,122,68,.1);
}
.adm-field textarea { resize: vertical; min-height: 80px; }
.adm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .adm-field-row { grid-template-columns: 1fr; } }

/* ── Table ───────────────────────────────────────────────── */
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th {
  text-align: right; padding: 10px 14px; background: #f8fafc;
  border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #64748b; font-weight: 600;
}
.adm-table td {
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px; color: #334155; vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #f8fafc; }
.adm-table .adm-actions { display: flex; gap: 6px; justify-content: flex-start; }

/* ── Search Bar ──────────────────────────────────────────── */
.adm-search {
  position: relative; display: flex; align-items: center;
}
.adm-search svg {
  position: absolute; right: 12px; color: #94a3b8; pointer-events: none;
}
.adm-search input {
  padding: 9px 40px 9px 12px; border-radius: 9px; border: 1.5px solid #e2e8f0;
  font-family: inherit; font-size: 13.5px; width: 100%;
  transition: border-color .2s; direction: rtl;
}
.adm-search input:focus { outline: none; border-color: #5d7a44; }

/* ── Modal ───────────────────────────────────────────────── */
.adm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: admFadeIn .15s ease;
}
.adm-modal {
  background: #fff; border-radius: 18px; width: min(640px, 100%); max-height: 90vh;
  overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: admSlideUp .2s ease;
}
.adm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; background: #fff; z-index: 1;
}
.adm-modal-title { font-family: 'El Messiri',serif; font-size: 18px; color: #1e293b; margin: 0; }
.adm-modal-body  { padding: 20px 24px 4px; }
.adm-modal-footer{
  display: flex; gap: 10px; justify-content: flex-start;
  padding: 14px 24px 20px;
  position: sticky; bottom: 0;       /* نفس مبدأ الـ header الثابت */
  background: #fff; z-index: 1;
  border-top: 1px solid #f1f5f9;
}
@keyframes admFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes admSlideUp  { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* زر الحفظ في header المودال — يظهر فقط على الجوال */
.adm-modal-header-save { display: none; }

/* ── Milestones Editor ───────────────────────────────────── */
.adm-milestones { display: flex; flex-direction: column; gap: 8px; }
.adm-milestone-row { display: flex; gap: 8px; align-items: center; }
.adm-milestone-row input:first-child { width: 90px; flex-shrink: 0; }
.adm-milestone-row input:last-of-type { flex: 1; }

/* ── Category CRUD ───────────────────────────────────────── */
.adm-cat-list { display: flex; flex-direction: column; gap: 8px; }

.adm-cat-item {
  border: 1px solid var(--adm-border); border-radius: 12px; overflow: hidden;
  transition: box-shadow .15s;
}
.adm-cat-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.adm-cat-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; padding: 10px 14px;
}
.adm-cat-edit-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #f8fafc; padding: 12px 14px;
  border-bottom: 1px solid var(--adm-border);
}
.adm-cat-edit-row input[type="text"], .adm-cat-edit-row input:not([type="color"]) {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--adm-border);
  font-family: inherit; font-size: 13px;
}

.adm-cat-add-form {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: #f0f9f0;
  border-bottom: 1px solid #c8e6c9;
}
.adm-cat-add-form input:not([type="color"]) {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--adm-border);
  font-family: inherit; font-size: 13px;
}

.adm-cat-color-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--adm-muted);
}
.adm-cat-color-lbl input[type="color"] {
  width: 34px; height: 30px; padding: 2px; cursor: pointer;
  border: 1.5px solid var(--adm-border); border-radius: 6px;
}

.adm-cat-row-drag { color: #cbd5e1; cursor: grab; flex-shrink: 0; }
.adm-cat-row-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.adm-cat-row-name { flex: 1; font-size: 14px; color: #334155; }
.adm-cat-row-count { display: flex; align-items: center; gap: 6px; }
.adm-cat-row-count input {
  width: 50px; padding: 4px 6px; border-radius: 7px; border: 1px solid var(--adm-border);
  font-family: inherit; font-size: 13px; text-align: center;
}

.adm-cat-members-panel {
  padding: 0 16px 14px; border-top: 1px solid var(--adm-border); background: #fafbfc;
}
.adm-cat-members-panel p { font-size: 12px; color: var(--adm-muted); margin: 10px 0 8px; }

/* ── Tree Admin Redesign ─────────────────────────────────── */
.atr-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.atr-save-btn { padding: 11px 22px; font-size: 14px; border-radius: 10px; }

.atr-legend {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.atr-legend-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; border: 1.5px solid;
  font-size: 12px; font-weight: 600;
}

.atr-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start;
}
@media (max-width: 860px) { .atr-layout { grid-template-columns: 1fr; } }

.atr-tree-card { overflow: hidden; }
.atr-tree-body { padding: 20px; max-height: calc(100vh - 220px); overflow: auto; }
.atr-hint { font-size: 12px; color: #94a3b8; }

/* ── Column Browser ── */
.atb-browser {
  display: flex;
  flex-direction: row;
  direction: rtl;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  min-height: 160px;
}
.atb-col {
  min-width: 195px;
  max-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.atb-col-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px 8px;
  border-bottom: 2px solid;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.atb-col-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.atb-sep {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 8px 0;
  flex-shrink: 0;
  gap: 2px;
}
.atb-sep-line {
  width: 1px;
  flex: 1;
  background: #e5e7eb;
  min-height: 18px;
}
.atb-sep-arr {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1;
  flex-shrink: 0;
}
.atb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s;
  direction: rtl;
}
.atb-item:hover { box-shadow: 0 1px 8px rgba(0,0,0,.07); border-color: #cbd5e1; }
.atb-sel { box-shadow: 0 2px 10px rgba(0,0,0,.09) !important; }
.atb-edit-hi { border-style: dashed !important; }
.atb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.atb-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.atb-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 7px 2px 4px;
  border-radius: 99px;
  border: 1px solid;
  font-size: 10.5px;
  font-weight: 600;
}
.atb-av {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.atb-chev {
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
  margin-inline-start: auto;
  line-height: 1;
}

/* ── Tree Nodes ── */
.atn-wrap { position: relative; }
.atn-children {
  margin-right: 22px;
  padding-right: 18px;
  border-right: 2px solid #e5e7eb;
  margin-top: 4px;
}
.atn-root > .atn-children { margin-right: 18px; }

.atn-node {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 6px;
  border-radius: 10px; border: 1.5px solid #e2e8f0;
  cursor: pointer; transition: all .18s; background: #fff;
  position: relative;
}
.atn-node:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); border-color: #cbd5e1; }
.atn-selected { box-shadow: 0 2px 12px rgba(0,0,0,.1) !important; }

.atn-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.atn-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.atn-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.atn-badge {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  padding: 2px 8px 2px 4px; border-radius: 99px; border: 1px solid;
  font-size: 11px; font-weight: 600;
}
.atn-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.atn-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.atn-count {
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; border: 1.5px solid;
}
.atn-toggle {
  width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid #e2e8f0;
  background: #f8fafc; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.atn-toggle:hover { background: #f1f5f9; }

/* ── Edit Panel ── */
.atr-panel { display: flex; flex-direction: column; gap: 14px; }
.atr-node-id {
  font-size: 10.5px; background: #f1f5f9; color: #64748b;
  padding: 3px 8px; border-radius: 6px; font-family: monospace;
}
.atr-input-row { display: flex; gap: 6px; }
.atr-input-row input { flex: 1; }

.atr-linked {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1.5px solid #86efac;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
.atr-linked-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: #22c55e; color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.atr-linked-name { font-size: 13.5px; font-weight: 700; color: #166534; }
.atr-linked-sub  { font-size: 11px; color: #4ade80; margin-top: 1px; }
.atr-unlink {
  margin-right: auto; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid #86efac; background: transparent; color: #16a34a;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.atr-unlink:hover { background: #dcfce7; }

.atr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.atr-btn-add {
  background: #eff6ff; color: #1d4ed8; border: 1.5px solid #bfdbfe;
  justify-content: center;
}
.atr-btn-add:hover { background: #dbeafe; }

.atr-empty-card { border: 2px dashed #e2e8f0; background: #fafafa; }
.atr-empty-body { text-align: center; padding: 52px 20px; color: #94a3b8; }
.atr-empty-ico {
  width: 72px; height: 72px; border-radius: 50%;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: #cbd5e1;
}
.atr-empty-title { font-family: 'El Messiri',serif; font-size: 16px; color: #475569; margin: 0 0 6px; }
.atr-empty-sub   { font-size: 13px; color: #94a3b8; margin: 0; line-height: 1.7; }

/* ── Action Bar ── */
.atr-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  min-height: 50px;
  flex-wrap: wrap;
}
.atr-sel-info {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.atr-sel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}
.atr-sel-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atr-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.atr-ab-edit {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.atr-ab-edit:hover { background: #dbeafe; }
.atr-ab-add {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}
.atr-ab-add:hover { background: #dcfce7; }
.atr-ab-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #94a3b8;
}

/* ── Node Edit Modal ── */
.atn-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.atn-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  width: 440px;
  max-width: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  direction: rtl;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);     }
}
.atn-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 18px 18px 0 0;
}
.atn-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  font-family: 'El Messiri', serif;
}
.atn-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.atn-modal-close:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.atn-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Photo Cropper ───────────────────────────────────────── */
.pc-wrap {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 10px; padding: 12px;
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
}
.pc-preview {
  width: 114px; height: 114px; border-radius: 14px;
  overflow: hidden; position: relative;
  cursor: grab; flex-shrink: 0;
  border: 2px solid #e2e8f0; background: #f1f5f9;
  user-select: none;
}
.pc-preview:active { cursor: grabbing; }
.pc-drag-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); color: #fff;
  opacity: 0; transition: opacity .2s, background .2s;
  pointer-events: none;
}
.pc-preview:hover .pc-drag-hint { opacity: 1; background: rgba(0,0,0,.22); }
.pc-controls {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.pc-zoom-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: #475569;
}
.pc-zoom-val {
  background: #e2e8f0; padding: 1px 6px; border-radius: 5px;
  font-size: 11.5px; font-family: monospace; color: #334155;
}
.pc-zoom-row {
  display: flex; align-items: center; gap: 6px;
}
.pc-slider {
  flex: 1; height: 4px; cursor: pointer; accent-color: #5d7a44;
}
.pc-zoom-btn {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid #e2e8f0; background: #fff; color: #475569;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1;
  flex-shrink: 0; transition: all .15s;
}
.pc-zoom-btn:hover { background: #e2e8f0; color: #1e293b; }
.pc-reset {
  font-size: 11.5px; color: #64748b;
  background: none; border: 1px solid #e2e8f0; border-radius: 7px;
  padding: 4px 10px; cursor: pointer; transition: all .15s;
  align-self: flex-start;
}
.pc-reset:hover { color: #1e293b; border-color: #94a3b8; }
.pc-hint {
  font-size: 11px; color: #94a3b8; margin: 0; line-height: 1.5;
}

/* ── Tree Picker Modal ───────────────────────────────────── */
.tpk-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.tpk-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  width: min(740px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex; flex-direction: column;
  direction: rtl;
  animation: modal-in .18s ease;
}
.tpk-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px 13px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tpk-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'El Messiri', serif; font-size: 15px; font-weight: 700; color: #1e293b;
  margin: 0;
}
.tpk-title svg { color: #5d7a44; }
.tpk-picked-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  background: #f0fdf4; border-bottom: 1px solid #86efac;
  font-size: 13px; color: #166534; flex-shrink: 0;
}
.tpk-picked-bar svg { color: #16a34a; flex-shrink: 0; width:13px; height:13px; }
.tpk-picked-bar strong { font-weight: 700; }
.tpk-hint-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px; color: #64748b; flex-shrink: 0;
}
.tpk-hint-bar svg { color: #94a3b8; flex-shrink: 0; }
.tpk-browser {
  flex: 1; overflow: auto; padding: 16px;
  min-height: 180px;
}
.tpk-footer {
  display: flex; gap: 8px; align-items: center;
  padding: 13px 20px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tpk-field { display: flex; flex-direction: column; gap: 8px; }
.tpk-current {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #f0fdf4; border: 1.5px solid #86efac;
  border-radius: 10px;
}
.tpk-current-name {
  flex: 1; font-size: 13px; font-weight: 600; color: #166534;
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.tpk-current-name svg { flex-shrink: 0; }
.tpk-empty { font-size: 13px; color: #94a3b8; font-style: italic; padding: 2px 0; }

/* ── Messages ────────────────────────────────────────────── */
.adm-msg-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-msg-filter {
  padding: 6px 14px; border-radius: 99px; border: 1.5px solid #e2e8f0;
  background: #fff; font-family: inherit; font-size: 12.5px; color: #64748b;
  cursor: pointer; transition: all .2s;
}
.adm-msg-filter.active { border-color: #5d7a44; background: #f0fdf4; color: #166534; }
.adm-msg-list { display: flex; flex-direction: column; gap: 8px; }
.adm-msg-item {
  background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
  overflow: hidden; transition: box-shadow .2s;
}
.adm-msg-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.adm-msg-item.status-new { border-right: 3px solid #3b82f6; }
.adm-msg-item.status-read { border-right: 3px solid #94a3b8; }
.adm-msg-item.status-done { border-right: 3px solid #22c55e; opacity: .7; }
.adm-msg-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
}
.adm-msg-from { font-weight: 600; color: #1e293b; font-size: 13.5px; flex: 1; }
.adm-msg-topic { font-size: 11.5px; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 99px; }
.adm-msg-member-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  color: #1d4ed8; background: #dbeafe;
  padding: 2px 9px; border-radius: 99px; flex-shrink: 0;
}
.adm-msg-date  { font-size: 11.5px; color: #94a3b8; }
.adm-msg-status-badge {
  font-size: 10.5px; padding: 2px 8px; border-radius: 99px; flex-shrink: 0;
}
.adm-msg-status-badge.new  { background: #dbeafe; color: #1d4ed8; }
.adm-msg-status-badge.read { background: #f1f5f9; color: #64748b; }
.adm-msg-status-badge.done { background: #dcfce7; color: #166534; }
.adm-msg-body {
  padding: 0 16px 14px; border-top: 1px solid #f1f5f9;
  font-size: 13px; color: #475569; line-height: 1.8;
}
.adm-msg-body .adm-msg-field { display: flex; gap: 8px; margin-top: 8px; }
.adm-msg-body .adm-msg-field .k { font-weight: 600; color: #334155; min-width: 100px; flex-shrink: 0; }
.adm-msg-actions { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid #f8fafc; }

/* ── Content Editor ──────────────────────────────────────── */
.adm-section-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.adm-section-tab {
  padding: 7px 16px; border-radius: 8px; background: #f1f5f9; border: none;
  font-family: inherit; font-size: 13px; color: #64748b; cursor: pointer; transition: all .2s;
}
.adm-section-tab.active { background: #5d7a44; color: #fff; }

/* ── Toast ───────────────────────────────────────────────── */
.adm-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); animation: admFadeIn .25s ease;
  white-space: nowrap;
}
.adm-toast-success { background: #166534; color: #fff; }
.adm-toast-error   { background: #dc2626; color: #fff; }
.adm-toast-info    { background: #1d4ed8; color: #fff; }

/* ── Loading ─────────────────────────────────────────────── */
.adm-loading {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; flex-direction: column; gap: 16px;
}
.adm-spinner {
  width: 40px; height: 40px; border: 3px solid #e2e8f0;
  border-top-color: #5d7a44; border-radius: 50%;
  animation: admSpin .8s linear infinite;
}
@keyframes admSpin { to { transform: rotate(360deg); } }
.adm-loading p { color: #64748b; font-size: 14px; }

/* ── Stats Row ───────────────────────────────────────────── */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.adm-stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px;
}
.adm-stat-num { font-family: 'El Messiri',serif; font-size: 28px; font-weight: 700; color: #1e293b; }
.adm-stat-lbl { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ── Empty State ─────────────────────────────────────────── */
.adm-empty { text-align: center; padding: 48px 20px; color: #94a3b8; }
.adm-empty p { margin-top: 8px; font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   شريط قوة كلمة المرور
══════════════════════════════════════════════════════════ */
.pwd-strength { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; text-align: right; }
.pwd-bars { display: flex; gap: 4px; }
.pwd-bar { flex: 1; height: 5px; border-radius: 99px; transition: background .3s; }
.pwd-label { font-size: 11.5px; font-weight: 700; }
.pwd-checks { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.pwd-check { font-size: 11.5px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.pwd-check.ok { color: #22c55e; }

/* ══════════════════════════════════════════════════════════
   إدارة المستخدمين
══════════════════════════════════════════════════════════ */
.usr-list { display: flex; flex-direction: column; }
.usr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.usr-item:last-child { border-bottom: none; }
.usr-item:hover { background: #f8fafc; }
.usr-item.usr-disabled { opacity: .55; }
.usr-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #5d7a44, #3e5a2a);
  color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.usr-info { flex: 1; min-width: 0; }
.usr-name  { font-weight: 700; font-size: 14px; color: #1e293b; }
.usr-email { font-size: 12px; color: #64748b; margin-top: 1px; }
.usr-meta  { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.usr-status {
  font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 2px 9px;
}
.usr-role {
  font-size: 10.5px; background: #f1f5f9; color: #475569;
  border-radius: 99px; padding: 2px 9px; font-weight: 600;
}
.usr-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; align-items: center; }
.usr-role-select {
  padding: 5px 8px; border-radius: 7px; border: 1.5px solid #e2e8f0;
  font-family: inherit; font-size: 12px; direction: rtl;
}
@media (max-width: 640px) {
  .usr-item { flex-wrap: wrap; }
  .usr-actions { width: 100%; justify-content: flex-end; }
}


/* ══════════════════════════════════════════════════════════
   MOBILE — شامل (≤ 768px)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── الرؤية ── */
  .adm-mob-only            { display: block !important; }
  .adm-desk-only,
  .adm-card.adm-desk-only  { display: none  !important; }

  /* ── هيكل اللوحة ── */
  .adm-dashboard {
    flex-direction: column;
    padding-top:    var(--adm-mob-top-h);
    padding-bottom: var(--adm-mob-nav-h);
  }
  .adm-sidebar { display: none !important; }
  .adm-main {
    min-height: calc(100vh - var(--adm-mob-top-h) - var(--adm-mob-nav-h));
  }
  .adm-page { padding: 14px 12px 28px; }
  .adm-page-full { padding: 14px 12px 28px; }

  /* ── حقول ── */
  .adm-field-row { grid-template-columns: 1fr; }

  /* ── توست في الأعلى ── */
  .adm-toast {
    top: calc(var(--adm-mob-top-h) + 10px);
    bottom: auto;
    left: 12px; right: 12px;
    transform: none;
    white-space: normal;
    font-size: 13px;
    text-align: center;
  }

  /* ── المودال كـ Bottom Sheet ── */
  .adm-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .adm-modal {
    width: 100%;
    max-height: 95vh;
    border-radius: 22px 22px 0 0;
    animation: admSheetUp .25s ease;
    /* نُبقي overflow-y:auto من الـ base — يُبقي sticky يعمل */
  }
  @keyframes admSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .adm-modal-header { border-radius: 22px 22px 0 0; }
  .adm-modal-body   { padding: 14px 14px 4px; }
  .adm-modal-footer {
    gap: 8px;
    padding: 12px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    box-shadow: 0 -3px 14px rgba(0,0,0,.07);
  }
  .adm-modal-footer > .adm-btn {
    flex: 1;
    justify-content: center;
    padding: 13px 10px;
    font-size: 14px;
  }

  /* ── زر الحفظ في الـ header — مرئي دائماً على الجوال ── */
  .adm-modal-header-save { display: inline-flex !important; }
  .adm-modal-title { font-size: 15px; }

  /* ── تأكيد الحذف — مودال صغير ── */
  .adm-modal[style*="max-width: 400"] { max-height: 72vh; }

  /* ── شريط أدوات عام ── */
  .adm-toolbar {
    flex-direction: column;
    gap: 8px;
  }
  .adm-toolbar .adm-search { min-width: 0; }
  .adm-toolbar select,
  .adm-toolbar .adm-btn { width: 100%; justify-content: center; }

  /* ── رأس البطاقة ── */
  .adm-card-header { flex-wrap: wrap; gap: 8px; }
  .adm-card-header > div { flex-wrap: wrap; gap: 6px; }

  /* ── صف الفئة ── */
  .adm-cat-row { flex-wrap: wrap; row-gap: 8px; }
  .adm-cat-edit-row { flex-wrap: wrap; }
  .adm-cat-add-form { flex-wrap: wrap; }

  /* ── رسائل ── */
  .adm-msg-header { flex-wrap: wrap; }
  .adm-msg-date { width: 100%; order: 10; }
  .adm-msg-actions { flex-wrap: wrap; }

  /* ── الشجرة (أفقي مع تمرير) ── */
  .atr-top { flex-direction: column; gap: 10px; }
  .atr-save-btn { width: 100%; justify-content: center; }
  .atr-tree-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .atb-browser { min-width: max-content; }

  /* ── محرر الصور ── */
  .pc-wrap { flex-direction: column; align-items: center; }
  .pc-preview { width: 150px; height: 150px; }
  .pc-controls { width: 100%; }

  /* ── منتقي الشجرة ── */
  .tpk-modal { max-height: 88vh; border-radius: 22px 22px 0 0; }
  .tpk-browser { overflow-x: auto; }

  /* ── إجراءات الشجرة ── */
  .atr-action-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .atr-action-btns { flex-wrap: wrap; }

  /* ── إحصائيات الرئيسية ── */
  .adm-stats { grid-template-columns: 1fr 1fr; }

  /* ── تبويبات المحتوى ── */
  .adm-section-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .adm-section-tab { flex-shrink: 0; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE — شريط الرأس العلوي
══════════════════════════════════════════════════════════ */
.adm-mob-topbar {
  display: none;
}
@media (max-width: 768px) {
  .adm-mob-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0; right: 0; left: 0;
    height: var(--adm-mob-top-h);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0 14px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
  }
  .adm-mob-topbar-logo {
    height: 30px; width: auto; flex-shrink: 0;
  }
  .adm-mob-topbar-breadcrumb {
    flex: 1;
    display: flex; align-items: center; gap: 5px;
    min-width: 0; overflow: hidden;
  }
  .adm-mob-topbar-root {
    font-family: 'El Messiri', serif;
    font-size: 13px; font-weight: 500;
    color: #64748b;
    white-space: nowrap; flex-shrink: 0;
  }
  .adm-mob-topbar-sep {
    font-size: 13px; color: #475569; flex-shrink: 0;
  }
  .adm-mob-topbar-page {
    font-family: 'El Messiri', serif;
    font-size: 15px; font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .adm-mob-topbar-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.07);
    color: #cbd5e1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: background .15s;
    position: relative;
  }
  .adm-mob-topbar-btn:active { background: rgba(255,255,255,.18); }
  .adm-mob-top-badge {
    position: absolute; top: 4px; left: 4px;
    background: #dc2626; color: #fff;
    border-radius: 99px; font-size: 9px; line-height: 15px;
    width: 15px; height: 15px; text-align: center;
    border: 1.5px solid #1e293b;
  }
}

/* ══════════════════════════════════════════════════════════
   MOBILE — شريط التنقل السفلي
══════════════════════════════════════════════════════════ */
.adm-mob-bottomnav {
  display: none;
}
@media (max-width: 768px) {
  .adm-mob-bottomnav {
    display: flex;
    position: fixed;
    bottom: 0; right: 0; left: 0;
    height: var(--adm-mob-nav-h);
    background: #1e293b;
    border-top: 1px solid rgba(255,255,255,.08);
    z-index: 100;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .adm-mob-nav-btn {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    border: none; background: transparent;
    color: #475569;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 10px; font-weight: 500;
    position: relative;
    transition: color .2s, background .2s;
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
  }
  .adm-mob-nav-btn.active {
    color: #86efac;
    background: rgba(134,239,172,.06);
  }
  .adm-mob-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0; right: 12px; left: 12px;
    height: 2px;
    background: #86efac;
    border-radius: 0 0 4px 4px;
  }
  .adm-mob-nav-badge {
    position: absolute;
    top: 6px;
    left: calc(50% - 18px);
    background: #dc2626; color: #fff;
    border-radius: 99px;
    font-size: 9px; line-height: 15px;
    width: 15px; height: 15px; text-align: center;
    border: 1.5px solid #1e293b;
  }
}

/* ══════════════════════════════════════════════════════════
   MOBILE — الدرج الجانبي
══════════════════════════════════════════════════════════ */
.adm-mob-drawer-overlay { display: none; }
@media (max-width: 768px) {
  .adm-mob-drawer-overlay {
    display: flex;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 300;
    justify-content: flex-end;
    animation: admFadeIn .2s ease;
  }
  .adm-mob-drawer {
    width: min(290px, 85vw);
    height: 100%;
    background: #1e293b;
    color: #e2e8f0;
    display: flex; flex-direction: column;
    overflow-y: auto;
    animation: slideInMob .25s cubic-bezier(.4,0,.2,1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  @keyframes slideInMob {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }
}
.adm-mob-drawer-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.adm-mob-drawer-close {
  margin-right: auto;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.adm-mob-drawer-nav {
  flex: 1; padding: 10px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.adm-mob-drawer-item {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: 10px;
  font-family: 'Tajawal', sans-serif; font-size: 14px;
  color: #94a3b8; cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: right;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.adm-mob-drawer-item:hover,
.adm-mob-drawer-item:active { background: rgba(255,255,255,.07); color: #e2e8f0; }
.adm-mob-drawer-item.active { background: rgba(93,122,68,.25); color: #86efac; }
.adm-mob-drawer-badge {
  margin-right: auto;
  background: #dc2626; color: #fff;
  border-radius: 99px; font-size: 10px; padding: 1px 6px;
  min-width: 18px; text-align: center;
}
.adm-mob-drawer-footer {
  padding: 14px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}
.adm-mob-drawer-action {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: 10px;
  font-family: 'Tajawal', sans-serif; font-size: 13px;
  background: rgba(255,255,255,.06); color: #94a3b8;
  border: none; width: 100%; text-align: right; cursor: pointer;
  transition: background .15s, color .15s;
}
.adm-mob-drawer-action:hover { background: rgba(255,255,255,.12); color: #e2e8f0; }
.adm-mob-drawer-action.danger { background: rgba(239,68,68,.12); color: #f87171; }
.adm-mob-drawer-action.danger:hover { background: rgba(239,68,68,.22); }

/* ══════════════════════════════════════════════════════════
   MOBILE — بطاقات الأعضاء
══════════════════════════════════════════════════════════ */
.adm-mob-cards {
  display: flex; flex-direction: column; gap: 10px;
}
.adm-mob-member-card {
  background: #fff; border-radius: 14px;
  border: 1px solid var(--adm-border);
  padding: 14px 12px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .15s;
}
.adm-mob-member-card:active { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.admc-info { flex: 1; min-width: 0; }
.admc-name { font-weight: 700; font-size: 14px; color: #1e293b; }
.admc-title { font-size: 12.5px; color: var(--adm-accent); margin-top: 2px; font-weight: 500; }
.admc-work {
  font-size: 12px; color: var(--adm-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admc-meta {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.admc-cat {
  font-size: 10.5px; border: 1.5px solid;
  border-radius: 99px; padding: 1px 9px; font-weight: 600;
}
.admc-tree-badge {
  font-size: 10.5px; background: #dcfce7; color: #166534;
  border-radius: 99px; padding: 1px 9px; font-weight: 600;
}
.admc-actions {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   MOBILE — شريط الأدوات العام
══════════════════════════════════════════════════════════ */
.adm-toolbar {
  display: flex; gap: 10px; margin-bottom: 16px;
  flex-wrap: wrap; align-items: center;
}
.adm-toolbar .adm-search { flex: 1; min-width: 180px; }
.adm-toolbar .adm-select {
  padding: 9px 12px; border-radius: 9px;
  border: 1.5px solid var(--adm-border);
  font-family: inherit; font-size: 13px; direction: rtl;
  background: #fff; color: #1e293b;
}

/* ══════════════════════════════════════════════════════════
   SMALL SCREENS ≤ 480px — لمسات إضافية
══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .adm-stats { grid-template-columns: 1fr 1fr; }
  .adm-stat-card { padding: 12px 14px; }
  .adm-stat-num { font-size: 24px; }

  .adm-milestone-row { flex-wrap: wrap; }
  .adm-milestone-row input:first-child { width: 100%; }

  .adm-msg-header { padding: 10px 12px; }
  .adm-msg-body { padding: 0 12px 12px; }
  .adm-msg-actions { padding: 8px 12px; gap: 6px; }

  .adm-mob-member-card { padding: 12px 10px; }

  .tpk-modal { max-height: 95vh; }
  .tpk-browser { padding: 12px; }

  .adm-cat-row-count input { width: 40px; }
}

/* ── Color Swatch ────────────────────────────────────────── */
.adm-color-wrap { display: flex; align-items: center; gap: 10px; }
.adm-color-wrap input[type="color"] { width: 40px; height: 36px; border: none; border-radius: 8px; cursor: pointer; padding: 2px; }
.adm-color-wrap input[type="text"] { flex: 1; }

/* ── Avatar Preview in Member List ──────────────────────────*/
.adm-member-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #5d7a44; overflow: hidden; flex-shrink: 0;
}
.adm-member-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Home Members Picker ─────────────────────────────────── */
.adm-members-picker { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.adm-members-picker label {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #334155;
  border: 1.5px solid transparent; transition: all .15s;
}
.adm-members-picker label:hover { background: #f8fafc; border-color: #e2e8f0; }
.adm-members-picker label input[type="checkbox"] { accent-color: #5d7a44; width: 15px; height: 15px; }
.adm-members-picker label.checked { background: #f0fdf4; border-color: #86efac; }
