/* Maliki Books Admin (web) — plain CSS, close to the native admin look.
   Emerald #0B6B4A, gold #C9A227, paper #FDF8EC. */
:root {
  --emerald: #0b6b4a;
  --emerald-deep: #084c38;
  --gold: #c9a227;
  --paper: #fdf8ec;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #5d6b63;
  --line: #e3dcc6;
  --danger: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: var(--emerald); }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.error {
  color: var(--danger);
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: var(--radius);
  padding: 10px 12px;
}
.status {
  border: 1px solid var(--line);
  background: #eef6f1;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.status.error { background: #fdecea; border-color: #f5c6c2; color: var(--danger); }

.topbar { background: var(--emerald-deep); color: #fff; }
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-ar { font-family: Amiri, serif; font-size: 1.5em; line-height: 1.2; }
.brand-en { font-size: 0.85em; letter-spacing: 0.04em; opacity: 0.9; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 0.9em; flex-wrap: wrap; }
.role-badge {
  background: var(--gold); color: #231f00; border-radius: 999px;
  padding: 2px 10px; font-size: 0.8em; font-weight: 700; text-transform: capitalize;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 18px 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.login-card { max-width: 480px; margin: 30px auto; }
.login-card h1 { margin: 0 0 6px; color: var(--emerald-deep); }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.92em; }
.field.inline { display: inline-block; margin: 0 12px 0 0; vertical-align: bottom; }
.field.grow { flex: 1; }
.field.grow input { width: 100%; }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid #b9c4bb;
  border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
textarea { resize: vertical; }
.btn {
  font: inherit; font-weight: 600; border: 1px solid transparent;
  border-radius: 999px; padding: 10px 18px; cursor: pointer;
  background: #eef0ea; color: var(--ink);
}
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }
.btn-ghost { background: transparent; border-color: #b9c4bb; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-small { padding: 6px 12px; font-size: 0.88em; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tab {
  font: inherit; font-weight: 600; background: none; border: none; cursor: pointer;
  padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--emerald-deep); border-bottom-color: var(--gold); }
.count {
  background: var(--gold); color: #231f00; border-radius: 999px;
  padding: 1px 8px; font-size: 0.8em; font-weight: 700;
}
.list { display: grid; gap: 8px; }
.list-item {
  display: block; width: 100%; text-align: left; font: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer;
}
.list-item:hover { border-color: var(--emerald); }
.list-item .t1 { font-weight: 700; }
.list-item .t2 { color: var(--muted); font-size: 0.92em; }
.list-item .ar { font-family: Amiri, serif; font-size: 1.25em; }

.line-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.line-card.draft { border-left: 5px solid var(--gold); background: #fffdf4; }
.line-card.approved { border-left: 5px solid var(--emerald); }
.line-card.superseded { opacity: 0.55; }
.line-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.line-head .no { font-weight: 700; }
.badge {
  font-size: 0.78em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  border-radius: 999px; padding: 2px 9px; background: #e8ece7; color: #37413a;
}
.badge.published { background: #dcefe4; color: var(--emerald-deep); }
.badge.draft { background: #fdf3d0; color: #6d5600; }
.badge.approved { background: #dcefe4; color: var(--emerald-deep); }
.badge.superseded { background: #eee; color: #777; }
.arabic { font-family: Amiri, serif; font-size: 1.45em; line-height: 2; margin: 6px 0; }
.urdu { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-size: 1.15em; line-height: 2.1; margin: 6px 0; }
.english { margin: 6px 0; }
.draft-note { font-size: 0.88em; color: #6d5600; margin: 8px 0 0; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.notice {
  background: #fdf3d0; border: 1px solid #ecd27a; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px;
  overflow-y: auto; z-index: 10;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 640px;
}
.modal-card h2 { margin-top: 0; color: var(--emerald-deep); }
.foot { text-align: center; padding-bottom: 30px; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  .arabic { font-size: 1.3em; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
}
