/* رواد — internal admin styles (RTL, Arabic). Plain CSS, no build step. */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --brand: #0f172a;
  --brand-ink: #ffffff;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --amber: #b45309;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--border); background: var(--card);
  padding: .5rem .9rem; border-radius: 10px; font-size: .9rem;
  cursor: pointer; font-family: inherit; color: var(--ink);
}
.btn:hover { background: #f1f5f9; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: #1e293b; }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Forms */
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .4rem; }
.input {
  width: 100%; padding: .6rem .75rem; border: 1px solid #cbd5e1;
  border-radius: 10px; font-family: inherit; font-size: .95rem; background: #fff;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.field { margin-bottom: 1rem; }
.hint { font-size: .78rem; color: var(--muted-2); margin-top: .3rem; }
.ltr { direction: ltr; text-align: left; }

/* Alerts */
.alert { border-radius: 10px; padding: .6rem .85rem; font-size: .88rem; margin-bottom: 1rem; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); }

/* Auth (centered) */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 26rem; }
.auth-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.brand-badge { width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.6rem; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head p { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: .78rem; margin-top: 1.25rem; }

/* App shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 16rem; flex-shrink: 0; background: var(--card); border-inline-start: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-head .badge { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.sidebar-head small { color: var(--muted-2); display: block; font-size: .72rem; }
.nav { flex: 1; padding: .75rem; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 10px; font-size: .9rem; color: var(--muted); margin-bottom: .15rem; }
.nav a:hover { background: #f1f5f9; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .group-label { padding: 1.1rem .75rem .4rem; font-size: .72rem; color: var(--muted-2); }
.sidebar-foot { border-top: 1px solid var(--border); padding: .75rem; }
.sidebar-foot .who { padding: 0 .5rem .5rem; }
.sidebar-foot .who .nm { font-weight: 600; font-size: .9rem; }
.sidebar-foot .who .em { color: var(--muted-2); font-size: .76rem; }
.main { flex: 1; padding: 1.5rem; overflow-x: hidden; }
@media (max-width: 768px) { .shell { flex-direction: column; } .sidebar { width: 100%; } }

.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }

/* Cards / stats */
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.stat { padding: 1.1rem; display: block; }
.stat:hover { border-color: #cbd5e1; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .icon { width: 40px; height: 40px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.stat .num { font-size: 1.9rem; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .88rem; margin-top: .6rem; }

/* Tables */
.tablecard { overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: #f8fafc; color: var(--muted); }
th { text-align: start; font-weight: 600; padding: .75rem 1rem; }
td { padding: .75rem 1rem; border-top: 1px solid #f1f5f9; }
.section-title { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.empty { text-align: center; color: var(--muted-2); padding: 2rem; }

.badge-chip { display: inline-block; background: #f1f5f9; color: #334155; padding: .1rem .5rem; border-radius: 7px; font-size: .76rem; margin: 0 0 .2rem; }
.tag { font-size: .8rem; padding: .15rem .55rem; border-radius: 7px; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-gray { background: #f1f5f9; color: #334155; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }

/* Expandable panel in users table */
.panel { background: #f8fafc; }
.panel-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; padding: 1rem; }
@media (max-width: 768px) { .panel-grid { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.checks label { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: #fff; padding: .35rem .65rem; border-radius: 9px; font-weight: 400; margin: 0; }
.row-inline { display: flex; gap: .5rem; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; } .mt-3 { margin-top: .75rem; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; }
.icon-dashed { width: 56px; height: 56px; border-radius: 16px; background: #f1f5f9; color: var(--muted-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.placeholder-box { border: 1px dashed #cbd5e1; border-radius: var(--radius); background: #fff; text-align: center; padding: 3.5rem 1.5rem; }
