/* Maghzeto shared panel shell styles. Canonical: MaghzetoEngine/shared/shell/shell.css (copied by sync.py).
   Self-contained: every colour falls back to a neutral value if the panel's own CSS does not define the token,
   so it can sit next to panel.css / pro.css / partner.css without touching their look. */

:root {
  --sh-panel: var(--panel, var(--card, #fff));
  --sh-ink: var(--ink, #17191C);
  --sh-muted: var(--muted, #5F636D);
  --sh-border: var(--border, #E6E8EC);
  --sh-surface: var(--surface, #F2F2F3);
  --sh-ring: var(--sh-focus, #4d7c62);
}

/* ---- dialogs (replace native confirm/alert) ---- */
.mz-dlg { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 20, 30, .5); animation: sh-fade .12s ease-out; }
.mz-dlg__box { width: 100%; max-width: 420px; background: var(--sh-panel); color: var(--sh-ink); border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); padding: 24px; animation: sh-pop .14s ease-out; font-family: inherit; }
.mz-dlg__msg { margin: 0 0 22px; font-size: 15px; line-height: 1.9; white-space: pre-wrap; }
.mz-dlg__act { display: flex; gap: 10px; justify-content: flex-start; }
.mz-dlg__btn { font: inherit; font-size: 14px; font-weight: 600; min-width: 96px; min-height: 40px; padding: 8px 18px; border-radius: 999px; cursor: pointer; border: 1px solid var(--sh-ink); background: var(--sh-ink); color: #fff; }
.mz-dlg__btn--ghost { background: transparent; color: var(--sh-ink); border-color: var(--sh-border); }
.mz-dlg__btn--danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.mz-dlg__btn:focus-visible { outline: 2px solid var(--sh-ring); outline-offset: 2px; }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sh-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- quick-jump palette ---- */
kbd { font: 600 10.5px/1 inherit; direction: ltr; padding: 3px 6px; border-radius: 6px; background: var(--sh-surface); border: 1px solid var(--sh-border); color: var(--sh-muted); }
.cmdk { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(10, 14, 22, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cmdk[hidden] { display: none; }
body.cmdk-open { overflow: hidden; }
.cmdk__box { width: min(520px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--sh-panel); color: var(--sh-ink); border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); overflow: hidden; font-family: inherit; }
.cmdk__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--sh-border); }
.cmdk__head input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--sh-ink); box-shadow: none; padding: 4px 0; }
.cmdk__list { overflow-y: auto; padding: 6px; }
.cmdk__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--sh-ink); font-size: 14px; text-decoration: none; }
.cmdk__item small { margin-inline-start: auto; color: var(--sh-muted); font-size: 11.5px; }
.cmdk__item.is-sel { background: var(--sh-surface); }
.cmdk__empty { padding: 22px; text-align: center; color: var(--sh-muted); font-size: 13px; }
.cmdk-btn { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 12.5px; white-space: nowrap; color: var(--sh-muted); background: var(--sh-panel); border: 1px solid var(--sh-border); border-radius: 12px; }
.cmdk-btn:hover { color: var(--sh-ink); }
.cmdk-btn:focus-visible { outline: 2px solid var(--sh-ring); outline-offset: 2px; }
@media (max-width: 1100px) { .cmdk-btn span, .cmdk-btn kbd { display: none; } }
@media (max-width: 820px) { .cmdk-btn { display: none; } .cmdk { padding-top: 8vh; } }

/* ---- utilities ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.u-inline { display: inline; }
.u-m0 { margin: 0; }

/* ---- icon rail: specialist panel sidebar (desktop only) ---- */
.sidebar__rail { display: none; }
@media (min-width: 861px) {
  .sidebar .sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .sidebar__rail { display: grid; place-items: center; width: 32px; height: 32px; flex: none; cursor: pointer; border-radius: 10px; color: rgba(255, 255, 255, .62); background: transparent; border: 1px solid rgba(255, 255, 255, .12); }
  .sidebar__rail:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  .sidebar__rail:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .nav-rail { --sidebar-w: 72px; }
  .nav-rail .sidebar { width: 72px; flex-basis: 72px; }
  .nav-rail .sidebar__rail svg { transform: scaleX(-1); }
  .nav-rail .sidebar .sidebar__brand { flex-direction: column; padding: 16px 0 12px; gap: 10px; }
  .nav-rail .sidebar__home b { font-size: 0; }
  .nav-rail .sidebar__home b::before { content: "م"; font-size: 26px; font-weight: 800; line-height: 1; }
  .nav-rail .sidebar__home span { display: none; }
  .nav-rail .sidebar__nav { padding-inline: 8px; }
  .nav-rail .navgroup { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .nav-rail .navgroup:first-child { border-top: 0; padding-top: 0; }
  .nav-rail .navgroup__title { display: none; }
  .nav-rail .navitem { justify-content: center; padding: 10px 0; position: relative; }
  .nav-rail .navitem > span:not(.navitem__icon):not(.navitem__badge) { display: none; }
  .nav-rail .navitem__badge { position: absolute; top: 3px; inset-inline-end: 5px; margin: 0; }
  .nav-rail .sidebar__foot { display: flex; flex-direction: column; align-items: center; padding: 12px 8px; }
  .nav-rail .sidebar__foot b { display: none; }
  .nav-rail .sidebar__foot a { font-size: 0; gap: 0; padding: 10px; }
}
.sidebar { transition: width .2s ease, flex-basis .2s ease; }
@media (prefers-reduced-motion: reduce) { .sidebar, .mz-dlg, .mz-dlg__box { transition: none; animation: none; } }
