/* القوى العاملة - مستشفى بئر العبد التخصصي */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --teal: #0f5f5c;
  --teal-d: #0a4745;
  --teal-l: #14706c;
  --gold: #c8a24a;
  --bg: #eef3f2;
  --ink: #16211f;
  --muted: #6b7c79;
  --line: #d7e0de;
  --white: #fff;
  --radius: 14px;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  padding: 28px 18px 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, #17716c 0%, rgba(23,113,108,0) 60%),
    linear-gradient(180deg, var(--teal) 0%, var(--teal-d) 100%);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 460px; margin-bottom: 26px; }
.seal {
  width: 76px; height: 76px; flex: 0 0 76px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.06);
}
.seal span { font-weight: 700; letter-spacing: 1px; font-size: 20px; color: #fff; }
.seal.photo { padding: 0; overflow: hidden; border-color: var(--gold); }
.seal.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { min-width: 0; }
.brand-text .mini { font-size: 12.5px; opacity: .85; line-height: 1.5; }
.brand-text .mini.strong { opacity: 1; font-weight: 600; }
.brand-text h1 { font-size: 21px; line-height: 1.45; margin: 8px 0 0; font-weight: 700; }

.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(3,32,30,.18);
}
.login-card { width: 100%; max-width: 460px; padding: 22px; color: var(--ink); }
.login-card label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

input[type=password], input[type=search], input[type=text] {
  width: 100%; padding: 14px 16px; font-size: 17px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 11px; background: #f8fbfa; color: var(--ink);
  outline: none;
}
input:focus { border-color: var(--teal); background: #fff; }
#pwd { letter-spacing: 6px; text-align: center; font-size: 22px; margin-bottom: 14px; }

.btn {
  font-family: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 11px;
  padding: 13px 20px; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-l); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--teal); border: 1.5px solid var(--teal); }
.btn.ghost:hover { background: #eff7f6; }

.err { color: #b3261e; font-size: 14px; margin-top: 12px; text-align: center; }
.credit {
  margin-top: 22px; font-size: 13.5px; text-align: center; max-width: 460px; line-height: 1.7;
  color: rgba(255,255,255,.9); border-top: 1px solid rgba(255,255,255,.22); padding-top: 16px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-d) 100%);
  color: #fff; padding: 12px 14px 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  box-shadow: 0 2px 10px rgba(3,32,30,.16);
}
.topbar-title { font-size: 15.5px; font-weight: 700; flex: 1 1 auto; }
.back {
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 9px;
  width: 34px; height: 34px; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 0 3px;
}
.filechip {
  flex: 0 0 100%; order: 3;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl;
}
.filechip b { font-weight: 600; opacity: .8; }

/* ---------- body ---------- */
.body { padding: 18px 14px 40px; max-width: 820px; margin: 0 auto; }

.tabs { display: flex; gap: 8px; background: #dde7e5; padding: 5px; border-radius: 12px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 11px 8px; border: 0; border-radius: 9px; background: transparent;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tab.active { background: #fff; color: var(--teal); box-shadow: 0 2px 6px rgba(3,32,30,.12); }

.searchrow { display: flex; gap: 10px; }
.searchrow input { flex: 1; }
.searchrow .btn { flex: 0 0 auto; padding: 13px 26px; }

.upload-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); }

.msg { margin-top: 18px; font-size: 14.5px; color: var(--muted); line-height: 1.8; }
.msg.warn { color: #9a5b00; background: #fff6e6; border: 1px solid #f2d9a8; padding: 12px 14px; border-radius: 10px; }
.msg.err { color: #b3261e; background: #fdeceb; border: 1px solid #f6c9c6; padding: 12px 14px; border-radius: 10px; }

/* ---------- results ---------- */
.results-head { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.results-list { display: flex; flex-direction: column; gap: 10px; }
.result {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; font-family: inherit;
  box-shadow: 0 1px 3px rgba(3,32,30,.05);
}
.result:hover { border-color: var(--teal); background: #f7fcfb; }
.result .r-main { flex: 1; min-width: 0; }
.result .r-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.result .r-name { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.result .r-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.result .r-go { color: var(--teal); font-size: 22px; line-height: 1; }
.badge {
  display: inline-block; flex: 0 0 auto; font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  background: #eaf3f2; color: var(--teal); margin-inline-start: 6px; vertical-align: 2px;
}
.badge.warn { background: #fdf1e0; color: #96601a; }

/* ---------- paper form ---------- */
.paper {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 18px 16px; box-shadow: 0 4px 18px rgba(3,32,30,.07);
}
.paper-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.paper-head .ministry { font-size: 12.5px; line-height: 1.8; text-align: right; color: #2b3a37; }
.paper-head .ministry div:first-child { font-weight: 700; }
.paper-seal {
  width: 62px; height: 62px; border-radius: 50%; border: 2px solid var(--teal);
  color: var(--teal); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px; flex: 0 0 62px;
  box-shadow: inset 0 0 0 4px rgba(15,95,92,.08);
}
.paper-title {
  text-align: center; font-size: 19px; font-weight: 700; margin: 6px 0 18px;
  padding-bottom: 10px; border-bottom: 2px solid var(--teal);
}
.frow { display: grid; gap: 4px 22px; margin-bottom: 16px; grid-template-columns: 1fr; }
.frow.c3 { grid-template-columns: 2.2fr 1.5fr 1.1fr; }
.frow.c2 { grid-template-columns: 1fr 1fr; }
.frow.c2w { grid-template-columns: 1.6fr 1fr; }
.fcell { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.flabel { font-size: 13.5px; font-weight: 700; color: #35463f; white-space: nowrap; }
.fval {
  flex: 1; min-width: 0; font-size: 15px; color: var(--ink);
  border-bottom: 1px dotted #9fb3af; padding: 0 4px 3px; min-height: 22px;
  word-break: break-word; line-height: 1.5;
}
.fval.empty { color: transparent; }
.foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; font-size: 13px; color: #35463f; }
.foot div { text-align: center; }
.foot .line { display: block; margin-top: 22px; color: var(--muted); }

/* ---------- extra data ---------- */
#extra { margin-top: 18px; }
.extra-head { font-size: 14px; font-weight: 700; color: var(--teal); margin: 0 0 10px; }
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xcell {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.xcell .k { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.xcell .v { font-size: 14.5px; color: var(--ink); word-break: break-word; line-height: 1.5; }
.xcell .v.empty { color: #b6c3c0; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 14px; line-height: 1.8; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 18px; right: 50%; transform: translateX(50%);
  background: #12211f; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; max-width: 90vw; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  line-height: 1.6; text-align: center;
}
.toast.err { background: #7f1d1a; }

@media (max-width: 560px) {
  .frow.c3, .frow.c2, .frow.c2w { grid-template-columns: 1fr; gap: 12px; }
  .extra-grid { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 19px; }
  .body { padding: 14px 12px 36px; }
  .searchrow { flex-wrap: nowrap; }
  .searchrow .btn { padding: 13px 18px; }
}

.vh { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; border: 0; padding: 0; }

.version { margin-top: 10px; font-size: 11.5px; letter-spacing: .3px; color: rgba(255,255,255,.55); }
