/* PRIMIX_THEME_CSS_V2 */
:root{
  --bg:#f6f7fb; --card:#ffffff; --card2:#fbfcff;
  --text:#0f172a; --muted:#64748b;
  --border:rgba(15,23,42,.10);
  --accent:#2563eb; --accent2:#7c3aed;
  --ok:#16a34a; --warn:#f59e0b; --bad:#ef4444;
  --shadow:0 16px 36px rgba(2,6,23,.08);
  --radius:18px;
  --topbar-h:72px;
}

html[data-theme="dark"]{
  --bg:#0b1220; --card:#0f172a; --card2:#0b1324;
  --text:#e5e7eb; --muted:#94a3b8;
  --border:rgba(148,163,184,.18);
  --shadow:0 18px 44px rgba(0,0,0,.35);
}

html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* مساعدات عامة */
.muted,.pmx-muted{color:var(--muted)}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

/* حقول */
input, select, textarea{
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.15);
}

/* أزرار */
button, .btn, .button{
  border:1px solid var(--border);
  background:var(--card2);
  color:var(--text);
  border-radius:14px;
  cursor:pointer;
}
button:hover, .btn:hover, .button:hover{ border-color:rgba(37,99,235,.35); }

.pmx-btn-primary{
  background:linear-gradient(135deg, rgba(37,99,235,.95), rgba(124,58,237,.95));
  border:1px solid rgba(255,255,255,.12);
  color:white !important;
  box-shadow:0 14px 30px rgba(37,99,235,.20);
}
.pmx-btn-primary:hover{ filter:brightness(1.03); }

/* كروت/حاويات */
.pmx-card, .card, .panel, .box, .container-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* جداول */
table{ border-collapse:collapse; width:100%; }
th,td{ border-bottom:1px solid var(--border); }
thead th{ color:var(--muted); font-weight:800; }
.pmx-table-wrap{ overflow:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--card); }

/* Topbar موحّد */
.pmx-topbar{
  position:sticky;
  top:0;
  z-index:999;
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .pmx-topbar{ background:rgba(15,23,42,.72); }

.pmx-topbar-inner{
  width:100%;
  max-width:1240px;
  margin:0 auto;
  padding:0 14px;
  display:flex;
  align-items:center;
  gap:12px;
}

.pmx-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 220px;
}
.pmx-brand-link{
  font-weight:900;
  color:var(--text);
  text-decoration:none !important;
}
.pmx-sep{ color:var(--muted); }
.pmx-page{ color:var(--muted); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:280px; }

.pmx-nav{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:center;
  flex:1;
}
.pmx-navlink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  color:var(--muted) !important;
  text-decoration:none !important;
  border:1px solid transparent;
}
.pmx-navlink:hover{
  background:rgba(37,99,235,.08);
  border-color:rgba(37,99,235,.18);
  color:var(--text) !important;
}
.pmx-navlink[aria-current="page"]{
  background:rgba(37,99,235,.14);
  border-color:rgba(37,99,235,.22);
  color:var(--text) !important;
}

.pmx-top-actions{
  display:flex;
  align-items:center;
  gap:8px;
  min-width: 220px;
  justify-content:flex-end;
}
.pmx-user{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card2);
  color:var(--muted);
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pmx-iconbtn{
  width:40px; height:40px;
  display:inline-flex;
  align-items:center; justify-content:center;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--card2);
  color:var(--text);
}
.pmx-iconbtn:hover{ border-color:rgba(37,99,235,.35); }

.pmx-main{
  max-width:1240px;
  margin:0 auto;
  padding:22px 14px 64px;
}

/* شاشات صغيرة */
@media (max-width: 900px){
  .pmx-page{ display:none; }
  .pmx-brand{ min-width:auto; }
  .pmx-top-actions{ min-width:auto; }
}
