/* ============================================================
   حضور الدبلومة — التنسيقات
   كحلي #1b2a4a · ذهبي #c8962e · خلفية #f6f8fc
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #e9edf5;
  color: #1b2a4a;
  direction: rtl;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f6f8fc;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px #1b2a4a1a;
}

/* ---------- الهيدر ---------- */
.hd {
  background: #1b2a4a;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.hd img {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  padding: 1px;
  flex: 0 0 38px;
  object-fit: contain;
}
.hd .hdt { flex: 1; min-width: 0; }
.hd .ht { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hd .hs { font-size: 8.5px; color: #dcc07a; margin-top: 1px; line-height: 1.35; }
.hd .hsub { font-size: 10px; color: #ffffffa8; margin-top: 1px; }
.hd .out {
  background: #ffffff1a;
  color: #fff;
  border: 1px solid #ffffff33;
  border-radius: 9px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.hd .out:active { background: #ffffff2e; }
.hd .out.back {
  background: #c8962e;
  border-color: #c8962e;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
}
.hd .out.back:active { background: #b0841f; }

/* ---------- المحتوى ---------- */
.bd { padding: 14px; flex: 1; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px #0002;
}
.card .t { font-weight: 700; margin-bottom: 6px; font-size: 13.5px; }
.card small, .hint { color: #667; font-size: 11.5px; line-height: 1.6; }

label.fld { display: block; margin-bottom: 8px; font-size: 12px; color: #445; }
label.fld span { display: block; margin-bottom: 4px; }

input[type="text"], input[type="tel"], input[type="password"], input[type="search"], select {
  width: 100%;
  background: #fff;
  border: 1px solid #ccd3e0;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  color: #1b2a4a;
}
input:focus, select:focus { outline: 2px solid #c8962e55; border-color: #c8962e; }
input[dir="ltr"] { text-align: left; }

.btn {
  display: block;
  width: 100%;
  background: #c8962e;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
}
.btn:active { background: #b0841f; }
.btn:disabled { background: #c8c9d0; cursor: default; }
.btn.g { background: #fff; color: #1b2a4a; border: 1px solid #1b2a4a; }
.btn.g:active { background: #eef1f8; }
.btn.sm { padding: 8px; font-size: 12.5px; }

.err { color: #c43b3b; font-size: 12px; margin-top: 8px; min-height: 16px; }
.ok { color: #1c8a4b; }
.no { color: #c43b3b; }
.wr { color: #c8962e; }

/* ---------- الدخول ---------- */
.brand { text-align: center; padding: 18px 0 10px; }
.brand img { width: 96px; height: 96px; }
.brand h1 { font-size: 17px; margin-top: 8px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #445; margin: 4px 0 2px; }
.chk input { width: 16px; height: 16px; accent-color: #1c8a4b; }

/* ---------- القوائم ---------- */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu .item {
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: 0 1px 3px #0002;
  border: 0;
  text-align: right;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #1b2a4a;
  cursor: pointer;
}
.menu .item .ic { font-size: 20px; display: block; margin-bottom: 6px; }
.menu .item small { display: block; font-weight: 400; color: #889; font-size: 10.5px; margin-top: 3px; }
.menu .item:active { background: #f0f3fa; }
.menu .item.soon { opacity: .55; }

.li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 13px;
}
.li:last-child { border-bottom: 0; }
.li small { color: #889; font-size: 11px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  color: #fff;
  white-space: nowrap;
}
.p1 { background: #1c8a4b; }
.p2 { background: #c8962e; }
.p3 { background: #c43b3b; }
.p4 { background: #778; }


.picklist { max-height: 260px; overflow: auto; margin-top: 6px; }
.pickitem { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 4px; border-bottom: 1px solid #eef; cursor: pointer; }
.pickitem:active { background: #f4f4fa; }
.pickitem small { color: #889; font-size: 11px; }

.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.toolbar input, .toolbar select { flex: 1; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.toast {
  position: fixed;
  bottom: 18px;
  right: 50%;
  transform: translateX(50%);
  background: #1b2a4a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  box-shadow: 0 6px 18px #0003;
  z-index: 60;
  max-width: 90vw;
}
.toast.bad { background: #c43b3b; }

.boot { padding: 40px; text-align: center; color: #889; font-size: 13px; }

/* الكاميرا */
.cam {
  position: relative;
  background: #111;
  border-radius: 16px;
  height: 230px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .fr {
  position: absolute;
  width: 150px; height: 150px;
  border: 3px solid #c8962e;
  border-radius: 18px;
  pointer-events: none;
}

table.list { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.list th { text-align: right; color: #889; font-weight: 400; font-size: 11px; padding: 6px 4px; border-bottom: 1px solid #e6e9f0; }
table.list td { padding: 8px 4px; border-bottom: 1px solid #eef0f5; }
table.list tr:last-child td { border-bottom: 0; }

.note {
  background: #fff3d6;
  color: #8a5b00;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.note.bad { background: #fde8e8; color: #a33; }
.note.good { background: #e6f6ec; color: #1c7a45; }

@media (max-width: 420px) {
  .menu { grid-template-columns: 1fr; }
}

/* ---------- بطاقات الباركود ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scard {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 1px 3px #0002;
  page-break-inside: avoid;
}
.scard-logo { width: 42px; height: 42px; }
.scard-name { font-weight: 700; font-size: 12.5px; margin-top: 4px; }
.scard-code { font-size: 11px; color: #667; }
.scard-qr { width: 108px; margin: 6px auto; }
.scard-qr svg { width: 100%; height: auto; display: block; }
.scard-org { font-size: 9px; color: #889; }

/* ---------- الطباعة / PDF ---------- */
@media print {
  body { background: #fff; }
  #app { max-width: none; box-shadow: none; }
  .hd, .nav, .btn, .toolbar, .note, .toast, .noprint { display: none !important; }
  .bd { padding: 0; }
  .card, .scard { box-shadow: none; border: 1px solid #ccd; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .li { page-break-inside: avoid; }
}
