/* =============================================================
   Thaat ACP — admin panel theme (Sneat-style, matches v1 acp)
   ============================================================= */
:root {
  --acp-primary: #696cff;
  --acp-primary-dark: #5f61e6;
  --acp-bg: #f5f5f9;
  --acp-card: #ffffff;
  --acp-text: #566a7f;
  --acp-head: #384551;
  --acp-muted: #a1acb8;
  --acp-border: #eceef1;
  --acp-shadow: 0 2px 6px rgba(67, 89, 113, .12);
  --acp-radius: 10px;
  --acp-green: #71dd37; --acp-green-bg: #e8fadf;
  --acp-orange: #ffab00; --acp-orange-bg: #fff2d6;
  --acp-red: #ff3e1d; --acp-red-bg: #ffe0db;
  --acp-info: #03c3ec; --acp-info-bg: #d7f5fc;
  --acp-purple-bg: #e7e7ff;
}

.acp {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--acp-bg);
  color: var(--acp-text);
  font-family: "Tajawal", "Public Sans", -apple-system, "Segoe UI", sans-serif;
  direction: rtl;
}

/* ---------- sidebar ---------- */
.acp-side {
  background: var(--acp-card);
  border-inline-start: 1px solid var(--acp-border);
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.acp-brand { display: flex; align-items: center; gap: 10px; padding: 8px 12px 22px; }
.acp-brand img { height: 30px; }
.acp-brand span { font-size: 1.35rem; font-weight: 800; color: var(--acp-head); }
.acp-navlabel { font-size: .72rem; font-weight: 700; color: var(--acp-muted); text-transform: uppercase; padding: 14px 12px 6px; letter-spacing: .5px; }
.acp-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 3px;
  color: var(--acp-text); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: .2s;
}
.acp-link svg { width: 20px; height: 20px; opacity: .8; flex: none; }
.acp-link:hover { background: #f2f2fb; color: var(--acp-primary); }
.acp-link.is-active {
  background: linear-gradient(72deg, var(--acp-primary) 0%, #8082ff 100%);
  color: #fff; box-shadow: 0 3px 10px rgba(105, 108, 255, .4);
}
.acp-link.is-active svg { opacity: 1; }

/* ---------- main ---------- */
.acp-main { display: flex; flex-direction: column; min-width: 0; }
.acp-top {
  background: var(--acp-card); margin: 14px 16px; border-radius: var(--acp-radius);
  box-shadow: var(--acp-shadow);
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
}
.acp-top__title { font-size: 1.1rem; font-weight: 700; color: var(--acp-head); }
.acp-top__user { display: flex; align-items: center; gap: 10px; }
.acp-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--acp-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.acp-body { padding: 8px 16px 40px; }

/* breadcrumb */
.acp-crumb { color: var(--acp-muted); font-size: .9rem; margin: 6px 4px 18px; }
.acp-crumb b { color: var(--acp-head); }

/* ---------- stat cards ---------- */
.acp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.acp-stat { background: var(--acp-card); border-radius: var(--acp-radius); box-shadow: var(--acp-shadow); padding: 20px 22px; }
.acp-stat__icon { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.acp-stat__icon svg { width: 22px; height: 22px; }
.acp-stat__num { font-size: 1.7rem; font-weight: 800; color: var(--acp-head); line-height: 1; }
.acp-stat__label { color: var(--acp-muted); font-size: .88rem; margin-top: 6px; }

/* ---------- generic card ---------- */
.acp-panel { background: var(--acp-card); border-radius: var(--acp-radius); box-shadow: var(--acp-shadow); margin-bottom: 20px; overflow: hidden; }
.acp-panel__head { padding: 18px 22px; font-weight: 700; color: var(--acp-head); font-size: 1.05rem; border-bottom: 1px solid var(--acp-border); display: flex; align-items: center; justify-content: space-between; }

/* ---------- filters ---------- */
.acp-filters { padding: 20px 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.acp-input, .acp-select {
  width: 100%; padding: 9px 13px; font: inherit; font-size: .92rem; color: var(--acp-head);
  background: #fff; border: 1px solid #d9dee3; border-radius: 7px; outline: none; transition: .2s;
}
.acp-input:focus, .acp-select:focus { border-color: var(--acp-primary); box-shadow: 0 0 0 3px rgba(105,108,255,.12); }

/* ---------- buttons ---------- */
.acp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border: 0; border-radius: 7px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: .2s; }
.acp-btn--primary { background: var(--acp-primary); color: #fff; box-shadow: 0 3px 8px rgba(105,108,255,.35); }
.acp-btn--primary:hover { background: var(--acp-primary-dark); }
.acp-btn--ghost { background: #f2f2fb; color: var(--acp-primary); }
.acp-btn--ghost:hover { background: #e7e7ff; }
.acp-btn--sm { padding: 6px 14px; font-size: .82rem; }

/* ---------- table ---------- */
.acp-table-wrap { overflow-x: auto; }
.acp-table { width: 100%; border-collapse: collapse; }
.acp-table th { text-align: start; padding: 12px 22px; font-size: .78rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #8a94a6; background: #f9f9fb; border-bottom: 1px solid var(--acp-border); white-space: nowrap; }
.acp-table td { padding: 13px 22px; font-size: .92rem; color: var(--acp-text); border-bottom: 1px solid var(--acp-border); white-space: nowrap; }
.acp-table tr:last-child td { border-bottom: 0; }
.acp-table tr:hover td { background: #fafafc; }
.acp-table__name { color: var(--acp-head); font-weight: 600; }

.acp-avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--acp-purple-bg); color: var(--acp-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }

.acp-badge { display: inline-block; padding: 3px 11px; border-radius: 6px; font-size: .76rem; font-weight: 700; }
.acp-badge--green { background: var(--acp-green-bg); color: #5aad1e; }
.acp-badge--orange { background: var(--acp-orange-bg); color: #b47d00; }
.acp-badge--red { background: var(--acp-red-bg); color: #d43219; }
.acp-badge--info { background: var(--acp-info-bg); color: #068ba8; }
.acp-badge--purple { background: var(--acp-purple-bg); color: var(--acp-primary); }

.acp-check { color: var(--acp-green); }
.acp-empty { padding: 40px; text-align: center; color: var(--acp-muted); }

/* pager */
.acp-pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--acp-border); color: var(--acp-muted); font-size: .88rem; }
.acp-pager__btns { display: flex; gap: 8px; }

/* ---------- login ---------- */
.acp-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--acp-bg); direction: rtl; font-family: "Tajawal", sans-serif; padding: 20px; }
.acp-login__card { background: #fff; border-radius: 14px; box-shadow: var(--acp-shadow); padding: 40px 38px; width: 100%; max-width: 400px; }
.acp-login__brand { text-align: center; margin-bottom: 8px; }
.acp-login__brand img { height: 40px; }
.acp-login h1 { text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--acp-head); margin-bottom: 4px; }
.acp-login p { text-align: center; color: var(--acp-muted); font-size: .9rem; margin-bottom: 24px; }
.acp-field { margin-bottom: 16px; }
.acp-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--acp-head); margin-bottom: 6px; }

@media (max-width: 900px) {
  .acp { grid-template-columns: 1fr; }
  .acp-side { position: static; height: auto; }
}

/* ---------- modal + forms ---------- */
.acp-modal-bg { position: fixed; inset: 0; background: rgba(30,36,55,.55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.acp-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.acp-modal__head { padding: 18px 22px; border-bottom: 1px solid var(--acp-border); font-weight: 700; color: var(--acp-head); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; }
.acp-modal__close { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--acp-muted); }
.acp-modal__body { padding: 22px; }
.acp-modal__foot { padding: 16px 22px; border-top: 1px solid var(--acp-border); display: flex; gap: 10px; position: sticky; bottom: 0; background: #fff; }
.acp-field { margin-bottom: 14px; }
.acp-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--acp-head); margin-bottom: 6px; }
textarea.acp-input { min-height: 84px; resize: vertical; font-family: inherit; }
.acp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acp-msg { padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
.acp-msg--ok { background: var(--acp-green-bg); color: #5aad1e; }
.acp-msg--err { background: var(--acp-red-bg); color: #d43219; }
/* switch */
.acp-switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.acp-switch input { display: none; }
.acp-switch span { position: absolute; inset: 0; background: #d9dee3; border-radius: 20px; transition: .2s; }
.acp-switch span::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; inset-inline-start: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.acp-switch input:checked + span { background: var(--acp-primary); }
.acp-switch input:checked + span::before { inset-inline-start: 21px; }
/* settings sections */
.acp-set-group { padding: 22px; border-bottom: 1px solid var(--acp-border); }
.acp-set-group:last-child { border-bottom: 0; }
.acp-set-group h4 { font-size: 1rem; font-weight: 800; color: var(--acp-head); margin-bottom: 16px; }

/* ── Settings hub: gear in the top bar + small side sub-menu (dnet-ACP style) ── */
.acp-top__gear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #697a8d;
  transition: background .15s ease, color .15s ease, transform .3s ease;
  margin-inline-end: 4px;
}
.acp-top__gear:hover { background: #eef1f6; color: var(--acp-primary); transform: rotate(45deg); }
.acp-top__gear.is-active { background: var(--acp-primary); color: #fff; }

.acp-settings {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 20px;
  align-items: start;
}
.acp-settings__nav {
  background: #fff;
  border: 1px solid var(--acp-border);
  border-radius: 12px;
  padding: 8px;
  position: sticky;
  top: 90px;
}
.acp-settings__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 9px;
  color: #697a8d;
  font-size: .88rem;
  font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.acp-settings__link svg { width: 16px; height: 16px; flex: none; }
.acp-settings__link:hover { background: #f2f5f9; color: var(--acp-head); }
.acp-settings__link.is-active {
  background: rgba(105, 108, 255, .12);
  color: var(--acp-primary);
  box-shadow: inset 3px 0 0 var(--acp-primary);
}
[dir='rtl'] .acp-settings__link.is-active { box-shadow: inset -3px 0 0 var(--acp-primary); }

@media (max-width: 900px) {
  .acp-settings { grid-template-columns: 1fr; }
  .acp-settings__nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
}
