/* منصة نور — التصميم */
:root {
  --teal: #0E8C93; --teal-d: #0B5F73; --teal-l: #E3F4F4; --teal-xl: #F2FAFA;
  --navy: #0E2A3B; --ink: #1B2B36; --muted: #667985; --line: #E3EAEE; --bg: #F5F8FA; --card: #fff;
  --gold: #F5B83D; --gold-l: #FFF4DB;
  --red: #D64545; --red-l: #FDECEC; --green: #1F9D63; --green-l: #E5F6EE; --amber: #C47F00; --amber-l: #FFF3D6;
  --c-imaging: #3D6FE0; --c-imaging-l: #E8EFFD;
  --c-lab: #1F9D63; --c-lab-l: #E5F6EE;
  --c-report: #8A4FD8; --c-report-l: #F1EAFC;
  --c-prescription: #E0703D; --c-prescription-l: #FDEEE6;
  --c-other: #5F7380; --c-other-l: #EDF1F3;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 42, 59, .05), 0 4px 16px rgba(14, 42, 59, .06);
  --shadow-lg: 0 20px 60px rgba(14, 42, 59, .18);
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--teal); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; color: var(--navy); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 20px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
[hidden] { display: none !important; }

/* ---------- أزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 10px 18px; font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap; background: none; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-d); }
.btn-outline { border-color: var(--teal); color: var(--teal); background: #fff; }
.btn-outline:hover { background: var(--teal-xl); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.btn-ghost:hover { background: var(--bg); }
.btn-ghost.danger, .icon-btn.danger { color: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-l); color: var(--red); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { filter: brightness(.95); }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1EB957; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; cursor: pointer; color: var(--muted); transition: .15s; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-l); }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- حقول ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea, .select {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; transition: .15s; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
.field input:disabled { background: var(--bg); color: var(--muted); }
.field input[type=file] { padding: 8px; }
.select { width: auto; min-width: 180px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-error { background: var(--red-l); color: var(--red); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.info-box { display: flex; gap: 10px; align-items: flex-start; background: var(--teal-xl); border: 1px solid var(--teal-l); color: var(--teal-d); padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.info-box.subtle { background: var(--bg); border-color: var(--line); color: var(--muted); margin: 16px 0 0; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 16px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 9px 8px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); transition: .15s; text-align: center; }
.seg input:checked + span { background: #fff; color: var(--teal-d); box-shadow: var(--shadow); }
.seg input:checked + span.wa-c { color: #128C7E; }
.seg input:focus-visible + span { outline: 2px solid var(--teal); }

/* ---------- علامة ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand img { border-radius: 11px; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 22px; font-weight: 800; }
.brand small { font-size: 12px; color: var(--muted); }
.brand.light, .brand.light small { color: #fff; }
.brand.light small { opacity: .75; }

/* ---------- الصفحة الرئيسية ---------- */
.landing { background: linear-gradient(180deg, #EAF6F6 0%, var(--bg) 520px); min-height: 100vh; }
.pub-header { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 5vw, 64px); gap: 12px; }
.pub-nav { display: flex; gap: 8px; align-items: center; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px clamp(16px, 5vw, 64px) 70px; max-width: 1240px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--teal-l); color: var(--teal-d); padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 13px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 18px; }
.hl { background: linear-gradient(90deg, var(--teal), #13A8A0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-trust { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.hero-art { position: relative; min-height: 380px; }
.glow { position: absolute; inset: 10% 5%; background: radial-gradient(circle, rgba(245, 184, 61, .35), transparent 65%); filter: blur(10px); z-index: 0; }
.mock-card { position: absolute; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 18px; z-index: 1; }
.mock-main { inset-inline-start: 0; top: 10px; width: min(380px, 92%); animation: float 6s ease-in-out infinite; }
.mock-share { inset-inline-end: 0; bottom: 20px; width: 270px; animation: float 6s ease-in-out -3s infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.mock-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 16px; }
.mock-head img { border-radius: 8px; }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mock-share .mock-row { border: 0; padding: 0; }
.mock-row > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.mock-row small { color: var(--muted); font-size: 12px; }
.mock-row .ok { color: var(--green); }
.file-ic.wa { background: #E3F9EC; color: #128C7E; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 64px) 70px; }
.feature { background: #fff; border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.feature-ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--teal-l); color: var(--teal-d); margin-bottom: 14px; }
.feature-ic .ic { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); }
.steps { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 64px) 70px; text-align: center; }
.steps h2 { font-size: 30px; margin-bottom: 28px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { padding: 24px; }
.step-n { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; font-size: 20px; margin-bottom: 12px; }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; max-width: 1112px; margin: 0 auto 60px; background: linear-gradient(120deg, var(--teal-d), var(--teal)); color: #fff; border-radius: 24px; padding: 36px 40px; }
.cta-band h2 { color: #fff; font-size: 26px; margin-bottom: 6px; }
.cta-band p { opacity: .85; }
.pub-footer { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 26px 16px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.pub-footer img { border-radius: 6px; }

/* ---------- الدخول ---------- */
.auth-page { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; min-height: 100vh; }
.auth-side { background: linear-gradient(160deg, var(--teal-d), var(--teal) 70%, #19A79E); color: #fff; padding: 40px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 184, 61, .45), transparent 65%); bottom: -120px; inset-inline-end: -120px; }
.auth-side h2 { color: #fff; font-size: 30px; margin-top: auto; }
.auth-points { list-style: none; padding: 0; margin: 0 0 auto; display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points .ic { background: rgba(255, 255, 255, .2); border-radius: 50%; padding: 3px; width: 24px; height: 24px; }
.auth-main { display: flex; flex-direction: column; padding: 20px; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 20px 0; }
.auth-card h1 { font-size: 28px; margin-bottom: 4px; }
.auth-card > p.muted { margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); }
.auth-switch a { font-weight: 700; }
.demo-box { margin-top: 22px; padding: 14px; border: 1px dashed var(--teal); border-radius: 12px; background: var(--teal-xl); font-size: 14px; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.demo-btn { border: 1px solid var(--teal-l); background: #fff; border-radius: 9px; padding: 8px; cursor: pointer; font-weight: 600; color: var(--teal-d); }
.demo-btn:hover { border-color: var(--teal); }

/* ---------- الهيكل ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 8px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; transition: .15s; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.active { background: var(--teal-l); color: var(--teal-d); }
.nav-badge { margin-inline-start: auto; background: var(--gold); color: var(--navy); font-style: normal; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 0 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); min-width: 0; }
.me > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-d)); color: #fff; font-weight: 800; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 32px); background: rgba(245, 248, 250, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar-title { font-weight: 700; color: var(--muted); }
.topbar-actions { margin-inline-start: auto; }
.menu-btn { display: none; }
.content { padding: 8px clamp(16px, 3vw, 32px) 40px; max-width: 1280px; width: 100%; }
.nav-scrim { display: none; }
.loading { display: grid; place-items: center; padding: 60px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--teal-l); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-actions { display: flex; gap: 8px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.card h3 { font-size: 17px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.cards-2 { gap: 18px; align-items: start; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv span:first-child { color: var(--muted); }

.empty { text-align: center; padding: 50px 20px; grid-column: 1 / -1; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--teal-l); color: var(--teal); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-ic .ic { width: 30px; height: 30px; }
.empty h3 { margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ---------- الإحصائيات الصغيرة ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.mini-stat { background: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.mini-stat b { font-size: 22px; color: var(--navy); }
.mini-stat span { color: var(--muted); font-size: 13px; }

/* ---------- شريط الأدوات ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 12px; flex: 1; min-width: 220px; max-width: 380px; color: var(--muted); }
.search:focus-within { border-color: var(--teal); }
.search input { border: 0; outline: 0; padding: 10px 0; flex: 1; background: none; min-width: 0; }
.search.sm { max-width: none; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.select-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; margin-bottom: 16px; position: sticky; top: 70px; z-index: 4; flex-wrap: wrap; }

/* ---------- ألوان التصنيفات ---------- */
.c-imaging { --c: var(--c-imaging); --cl: var(--c-imaging-l); }
.c-lab { --c: var(--c-lab); --cl: var(--c-lab-l); }
.c-report { --c: var(--c-report); --cl: var(--c-report-l); }
.c-prescription { --c: var(--c-prescription); --cl: var(--c-prescription-l); }
.c-other { --c: var(--c-other); --cl: var(--c-other-l); }
.dot[class*=c-] { background: var(--c); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--cl, var(--bg)); color: var(--c, var(--muted)); white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.file-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cl, var(--bg)); color: var(--c, var(--muted)); flex: none; }
.file-ic.sm { width: 34px; height: 34px; border-radius: 10px; }
.file-ic.sm .ic { width: 16px; height: 16px; }

/* ---------- بطاقات الملفات ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.file-card { position: relative; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; border: 2px solid transparent; transition: .15s; overflow: hidden; }
.file-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14, 42, 59, .1); }
.file-card.selected { border-color: var(--teal); }
.file-thumb { height: 110px; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--cl); color: var(--c); }
.file-thumb .ic { width: 38px; height: 38px; stroke-width: 1.5; }
.file-thumb small { font-weight: 700; font-size: 12px; opacity: .8; }
.file-check { position: absolute; top: 10px; inset-inline-start: 10px; cursor: pointer; z-index: 1; }
.file-check input { position: absolute; opacity: 0; }
.file-check span { display: block; width: 24px; height: 24px; border-radius: 7px; background: rgba(255, 255, 255, .9); border: 2px solid var(--line); transition: .15s; }
.file-check input:checked + span { background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--teal); }
.file-body { padding: 14px 16px 6px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.file-body h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.file-meta .ic { width: 14px; height: 14px; }
.file-center { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.file-center .ic { width: 14px; height: 14px; }
.note-flag { display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; background: var(--gold-l); color: #8A5A00; border: 0; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.note-flag .ic { width: 15px; height: 15px; }
.file-actions { display: flex; justify-content: space-between; padding: 6px 10px 10px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- النوافذ ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 42, 59, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s; }
.modal-wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { font-size: 19px; display: flex; gap: 8px; align-items: center; }
.modal-body { padding: 20px; }
.confirm { text-align: center; }
.confirm p { margin: 10px 0 16px; font-size: 16px; }
.confirm .row-end { justify-content: center; }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: var(--teal-l); color: var(--teal); }
.confirm-icon.danger { background: var(--red-l); color: var(--red); }
.confirm-icon .ic { width: 26px; height: 26px; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed #B9D9DB; border-radius: 14px; background: var(--teal-xl); cursor: pointer; text-align: center; transition: .15s; margin-bottom: 12px; }
.dropzone.over, .dropzone:hover { border-color: var(--teal); background: var(--teal-l); }
.dropzone input { display: none; }
.dz-ic { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--teal); box-shadow: var(--shadow); }
.up-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow: auto; }
.up-list li { display: flex; align-items: center; gap: 8px; background: var(--bg); padding: 8px 12px; border-radius: 9px; font-size: 14px; }
.up-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; background: var(--teal-l); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }

/* ---------- المشاركة ---------- */
.share-form section { margin-bottom: 18px; }
.share-form h4 { font-size: 15px; margin-bottom: 10px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.files-pick { max-height: 180px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: .15s; }
.pick:hover { border-color: #B9D9DB; }
.pick:has(input:checked) { border-color: var(--teal); background: var(--teal-xl); }
.pick input { accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.pick-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1; }
.pick-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.pick-text small { color: var(--muted); font-size: 13px; }
.verified { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--teal); color: #fff; }
.verified .ic { width: 11px; height: 11px; stroke-width: 3.5; }

.share-result .success-burst { width: 72px; height: 72px; border-radius: 50%; background: var(--green-l); color: var(--green); display: grid; place-items: center; margin: 0 auto 10px; animation: pop .35s; }
.share-result .success-burst .ic { width: 36px; height: 36px; stroke-width: 2.5; }
.share-result > p.center { margin-bottom: 18px; }
.result-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 10px; }
.result-box { background: var(--bg); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.result-box small { color: var(--muted); font-size: 12px; font-weight: 600; }
.copy-row { display: flex; align-items: center; gap: 6px; }
.copy-row input { flex: 1; border: 0; background: none; font-size: 14px; outline: 0; min-width: 0; color: var(--teal-d); font-weight: 600; }
.pin-box { text-align: center; background: var(--gold-l); }
.pin { font-size: 28px; font-weight: 800; letter-spacing: 6px; color: var(--navy); line-height: 1.2; }
.send-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.share-list { display: flex; flex-direction: column; gap: 12px; }
.share-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: minmax(200px, 1.1fr) 1.4fr auto; gap: 10px 18px; align-items: center; }
.share-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.share-who > div { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.share-who small { color: var(--muted); font-size: 13px; display: flex; gap: 4px; align-items: center; }
.share-who small .ic { width: 14px; height: 14px; }
.share-files { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--bg); border-radius: 8px; padding: 3px 10px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag .ic { width: 14px; height: 14px; color: var(--muted); }
.share-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.share-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.sm { font-size: 11px; padding: 1px 8px; }
.st-on { background: var(--green-l); color: var(--green); }
.st-off { background: var(--red-l); color: var(--red); }
.st-warn { background: var(--amber-l); color: var(--amber); }

.timeline { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-inline-start: 2px solid var(--line); padding-inline-start: 16px; margin-inline-start: 6px; position: relative; }
.timeline li > div { display: flex; flex-direction: column; }
.tl-dot { position: absolute; inset-inline-start: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }
.tl-dot.downloaded { background: var(--gold); }
.tl-dot.opened { background: var(--navy); }

/* ---------- العارض ---------- */
.modal-viewer { max-width: 1180px; height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.viewer-head .vh-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.viewer-head .vh-title > div { min-width: 0; }
.viewer-head h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-wrap { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.viewer-wrap.with-notes { grid-template-columns: minmax(0, 1fr) 320px; }
.viewer-stage { background: #0D1820; position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.pdf-frame { flex: 1; border: 0; width: 100%; background: #fff; }
.open-tab { position: absolute; bottom: 12px; inset-inline-start: 12px; background: rgba(13, 24, 32, .8); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.img-stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 10px; }
.img-stage img { max-width: 100%; max-height: 100%; cursor: zoom-in; border-radius: 4px; }
.img-stage img.zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.video { width: 100%; height: 100%; background: #000; }
.viewer-msg { margin: auto; color: #C9D6DD; padding: 30px; text-align: center; display: flex; gap: 10px; align-items: center; }
.notes-panel { border-inline-start: 1px solid var(--line); padding: 16px; overflow: auto; background: #FBFCFD; }
.notes-panel h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.note { background: #fff; border: 1px solid var(--line); border-inline-start: 3px solid var(--gold); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.note-head { display: flex; flex-direction: column; margin-bottom: 6px; line-height: 1.3; }
.note-head small { color: var(--muted); font-size: 12px; }
.note p { white-space: pre-wrap; margin-bottom: 6px; }
.note-form textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; resize: vertical; outline: 0; }
.note-form textarea:focus { border-color: var(--teal); }

.dcm { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dcm-tools { display: flex; gap: 6px; padding: 8px; background: #13232E; flex-wrap: wrap; }
.dcm-tools button { background: #1E3442; color: #D6E4EA; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.dcm-tools button:hover { background: #28455A; }
.dcm-tools button.on { background: var(--teal); color: #fff; }
.dcm-view { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; cursor: crosshair; touch-action: none; min-height: 0; background: #000; }
.dcm-view.dragging { cursor: grabbing; }
.dcm-view canvas { image-rendering: auto; transform-origin: center; }
.dcm-ov { position: absolute; color: #9FE3E6; font-size: 12px; font-family: ui-monospace, monospace; pointer-events: none; text-shadow: 0 1px 2px #000; }
.dcm-ov.tl { top: 8px; left: 10px; }
.dcm-ov.br { bottom: 8px; right: 10px; }
.dcm-hint { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .65); color: #fff; padding: 6px 14px; border-radius: 99px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.dcm-frames { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #13232E; color: #D6E4EA; }
.dcm-frames input { flex: 1; accent-color: var(--teal); }

/* ---------- الطبيب ---------- */
.status-card { max-width: 520px; margin: 40px auto; text-align: center; background: #fff; border-radius: 20px; padding: 40px 28px; box-shadow: var(--shadow); }
.status-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--amber-l); color: var(--amber); }
.status-card.rejected .status-ic { background: var(--red-l); color: var(--red); }
.status-ic .ic { width: 34px; height: 34px; }
.status-card h2 { margin-bottom: 8px; }
.verified-banner { display: flex; gap: 10px; align-items: center; background: var(--green-l); color: var(--green); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600; }
.inbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.inbox-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.inbox-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.inbox-card header > div { display: flex; flex-direction: column; line-height: 1.35; }
.inbox-card header small { font-size: 13px; }
blockquote { margin: 0 0 12px; background: var(--gold-l); border-inline-start: 3px solid var(--gold); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.inbox-files { display: flex; flex-direction: column; gap: 8px; }
.inbox-file { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: start; transition: .15s; }
.inbox-file:hover { border-color: var(--teal); background: var(--teal-xl); }

/* ---------- الأدمن ---------- */
.alert-banner { display: flex; width: 100%; gap: 10px; align-items: center; background: var(--gold-l); color: #7A5200; border: 1px solid #F3D99A; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 700; cursor: pointer; text-align: start; }
.alert-banner span { margin-inline-start: auto; }
[dir=ltr] .alert-banner span { transform: scaleX(-1); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-l); color: var(--teal-d); flex: none; }
.stat-ic .ic { width: 22px; height: 22px; }
.stat > div { display: flex; flex-direction: column; line-height: 1.3; }
.stat b { font-size: 26px; color: var(--navy); }
.stat span { color: var(--muted); font-size: 14px; }
.stat small { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.lg-up, .b-up { background: var(--teal); }
.lg-sh, .b-sh { background: var(--gold); }
.bars { display: flex; gap: 6px; height: 190px; align-items: stretch; }
.bar-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bar-pair { flex: 1; display: flex; gap: 2px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.bar-pair i { flex: 1; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col small { text-align: center; font-size: 11px; color: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 80px 1fr 30px; gap: 10px; align-items: center; font-size: 14px; }
.hbar-track { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.hbar b { text-align: end; }
.kind-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 13px; background: #FAFBFC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFCFD; }
.table .actions { text-align: end; white-space: nowrap; }
.cell-user { display: flex; gap: 10px; align-items: center; }
.cell-user > div { display: flex; flex-direction: column; line-height: 1.3; }
.cell-user small { color: var(--muted); font-size: 12px; }
.role-patient { background: var(--c-imaging-l); color: var(--c-imaging); }
.role-doctor { background: var(--teal-l); color: var(--teal-d); }
.role-admin { background: var(--gold-l); color: #8A5A00; }
.act-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--bg); white-space: nowrap; }
.act-share { background: var(--teal-l); color: var(--teal-d); }
.act-file { background: var(--c-imaging-l); color: var(--c-imaging); }
.act-login { background: var(--bg); color: var(--muted); }
.act-doctor, .act-note { background: var(--green-l); color: var(--green); }
.act-user { background: var(--red-l); color: var(--red); }
.act-center { background: var(--c-report-l); color: var(--c-report); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 10px 16px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab em { font-style: normal; background: var(--bg); padding: 0 8px; border-radius: 99px; font-size: 12px; margin-inline-start: 4px; }
.tab.active { color: var(--teal-d); border-color: var(--teal); }
.tab.active em { background: var(--teal-l); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.doc-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.doc-card header > div { display: flex; flex-direction: column; line-height: 1.35; }
.doc-card .btn-block { margin: 14px 0 10px; }

/* ---------- صفحة المشاركة العامة ---------- */
.share-page { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #EAF6F6, var(--bg) 400px); }
.share-main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; }
.unlock-card { max-width: 440px; margin: 30px auto; text-align: center; padding: 32px 28px; }
.unlock-card h1 { font-size: 22px; margin-bottom: 8px; }
.unlock-card > p.muted { margin-bottom: 18px; }
.unlock-card .field { text-align: start; }
.unlock-card .btn { margin-bottom: 14px; }
.lock-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--teal-l); color: var(--teal); display: grid; place-items: center; margin: 0 auto 16px; }
.lock-ic .ic { width: 30px; height: 30px; }
.pin-input { text-align: center; font-size: 30px !important; letter-spacing: 16px; font-weight: 800; padding: 12px !important; }
.share-files-head { margin-bottom: 18px; }
.share-files-head h1 { font-size: 24px; }
.pub-files { display: flex; flex-direction: column; gap: 10px; }
.pub-file { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }

/* ---------- تنبيهات ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s; transition: .3s; max-width: calc(100vw - 32px); }
.toast-ok .ic { color: #6FE3B0; }
.toast-err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- الشاشات الصغيرة ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 340px; max-width: 460px; width: 100%; margin: 0 auto; }
  .features { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .viewer-wrap.with-notes { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .notes-panel { border-inline-start: 0; border-top: 1px solid var(--line); max-height: 40vh; }
  .share-card { grid-template-columns: 1fr; }
  .share-meta { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 40; transform: translateX(100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  [dir=ltr] .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(14, 42, 59, .4); z-index: 39; }
  .menu-btn { display: inline-grid; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .features, .steps-grid, .grid-2, .stat-grid { grid-template-columns: 1fr; }
  .pub-header .brand small { display: none; }
  .pub-nav .btn-ghost:not(.lang-btn) { display: none; }
  .lang-btn span { display: none; }
  .hero { padding-top: 16px; }
  .mock-share { width: 230px; }
  .cta-band { padding: 26px 22px; margin-inline: 16px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-viewer { height: 100vh; max-height: 100vh; border-radius: 0; }
  .seg-3 span { flex-direction: column; gap: 2px; font-size: 13px; }
  .result-grid { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .inbox-list { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .pub-file { flex-wrap: wrap; }
  .pub-file .pick-text { flex-basis: calc(100% - 60px); }
  .pub-file .row-gap { width: 100%; justify-content: flex-end; }
  .dcm-tools span { display: none; }
  .dcm-ov.tr { top: 26px; }
}

/* ======================= التحديث الثاني ======================= */
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.spinner.light { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.progress.sm { height: 5px; margin: 6px 0 0; }

/* ---- نافذة الرفع ---- */
.up-pickers { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.up-pickers .dropzone { margin: 0; }
.folder-pick { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--c-imaging); transition: .15s; }
.folder-pick:hover { border-color: var(--c-imaging); background: var(--c-imaging-l); }
.folder-pick input { display: none; }
.folder-pick span { display: flex; flex-direction: column; line-height: 1.35; color: var(--ink); }
.folder-pick small { font-size: 13px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-head h4 { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.review-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.rv { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: .2s; }
.rv-done { border-color: #B6E6CD; background: #F6FCF9; }
.rv-error, .rv-skip { border-color: #F3C4C4; background: #FFF8F8; }
.rv-uploading { border-color: var(--teal); }
.rv-thumb { width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--cl, var(--bg)); color: var(--c, var(--muted)); }
.rv-thumb img, .rv-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-thumb .ic { width: 24px; height: 24px; }
.rv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.rv-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.rv-text small { color: var(--muted); font-size: 12px; }
.rv-note.ok { color: var(--green); font-weight: 600; }
.rv-note.bad { color: var(--red); font-weight: 600; }
.rv-status { flex: none; }
.st-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.st-icon.ok { background: var(--green); color: #fff; animation: pop .3s; }
.st-icon.bad { background: var(--red-l); color: var(--red); }
.st-icon .ic { width: 16px; height: 16px; stroke-width: 3; }
.plan-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.plan-banner span { flex: 1; min-width: 200px; }
.plan-banner svg { width: 18px; height: 18px; flex: none; }
.plan-banner.warn { background: var(--gold-l); border: 1px solid #F3D99A; }
.plan-banner.bad { background: #FDECEC; border: 1px solid #F5C2C2; }
.plan-card { margin-top: 18px; }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.plan-card-head h3 svg { width: 20px; height: 20px; color: var(--teal); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.plan-opt { display: flex; gap: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; align-items: flex-start; }
.plan-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-xl); }
.plan-opt input { accent-color: var(--teal); margin-top: 4px; }
.plan-opt ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.plan-price { font-size: 22px; font-weight: 800; color: var(--teal-d); margin-top: 4px; }
.plan-opt.best .badge { background: var(--gold-l); color: #8a5a00; }
.info-box.warn { background: var(--gold-l); }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.op-list { display: grid; gap: 12px; }
.op-card { display: grid; gap: 10px; }
.op-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.op-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.op-q p, .op-report p.pre, p.pre { white-space: pre-wrap; margin: 4px 0 0; }
.op-report { border-top: 1px solid var(--line); padding-top: 10px; }
.op-report h4 { margin: 10px 0 2px; font-size: 14px; color: var(--teal-d); }
.anon-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--teal-l, #E6F4F3); border: 1px solid #B9DEDB; border-radius: 12px; margin-bottom: 14px; cursor: pointer; font-size: 14px; }
.anon-toggle[hidden] { display: none; }
.anon-toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); flex: none; }
.anon-toggle b { display: flex; align-items: center; gap: 6px; }
.anon-toggle b svg { width: 16px; height: 16px; }
.anon-toggle small { display: block; color: var(--muted, #5b6b75); margin-top: 3px; line-height: 1.5; }
.anon-toggle .anon-pdf { color: #8a5a00; }
.anon-toggle .anon-pdf[hidden] { display: none; }
.terms-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--gold-l); border: 1px solid #F3D99A; border-radius: 12px; margin-bottom: 14px; cursor: pointer; font-size: 14px; }
.terms-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); flex: none; }
.terms-check a { font-weight: 700; text-decoration: underline; }
.up-summary { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 700; }
.up-summary.ok { background: var(--green-l); color: var(--green); }
.up-summary.warn { background: var(--amber-l); color: var(--amber); }

/* ---- بطاقات الملفات ---- */
.proc-badge { position: absolute; top: 10px; inset-inline-end: 10px; display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .95); color: var(--amber); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; box-shadow: var(--shadow); }
.proc-badge .spinner { border-color: var(--amber-l); border-top-color: var(--amber); }
.saved-line { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--green); font-weight: 600; }
.saved-line .ic { width: 14px; height: 14px; }

/* ---- عارض المقاطع ---- */
.dcm-load { margin-inline-start: auto; align-self: center; color: #9FB7C4; font-size: 12px; }
.dcm-ov.tr { top: 8px; right: 10px; }
.dcm-wait { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .6); border-radius: 99px; padding: 6px; }
.dcm-frames .dcm-count { min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.dcm-view:focus { outline: none; }

/* ---- دخول الأدمن ---- */
.admin-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px; background: radial-gradient(circle at 20% 10%, #16455A, transparent 50%), radial-gradient(circle at 85% 90%, rgba(245, 184, 61, .18), transparent 45%), #0B1E2A; }
.admin-login-top { position: absolute; top: 16px; inset-inline-end: 16px; }
.admin-login .lang-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .15); color: #fff; }
.admin-card { width: 100%; max-width: 400px; background: #10293A; border: 1px solid rgba(255, 255, 255, .08); border-radius: 22px; padding: 32px 28px; color: #D9E6EC; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.admin-badge { position: relative; width: 64px; margin: 0 auto 16px; }
.admin-badge img { border-radius: 16px; display: block; width: 64px; height: 64px; }
.lock-chip { position: absolute; bottom: -6px; inset-inline-end: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; border: 3px solid #10293A; }
.lock-chip .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.admin-card h1 { color: #fff; text-align: center; font-size: 24px; margin-bottom: 4px; }
.admin-card > p { text-align: center; color: #8FA9B7; margin-bottom: 22px; font-size: 14px; }
.admin-card .field > span { color: #B8CBD5; }
.admin-card .field input { background: #0B1E2A; border-color: #24465A; color: #fff; }
.admin-card .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 184, 61, .2); }
.admin-demo { display: block; width: 100%; margin-top: 12px; background: none; border: 1px dashed #2E5468; color: #9FC3D3; border-radius: 10px; padding: 9px; cursor: pointer; font-size: 13px; }
.admin-demo:hover { border-color: var(--gold); color: var(--gold); }
.admin-back { display: block; text-align: center; margin-top: 16px; color: #8FA9B7; font-size: 14px; }
.admin-back:hover { color: #fff; }
.shell-admin .sidebar { background: #0E2433; border-color: #0E2433; }
.shell-admin .sidebar .brand b { color: #fff; }
.shell-admin .sidebar .brand small { color: var(--gold); font-weight: 700; }
.shell-admin .side-nav a { color: #9FB7C4; }
.shell-admin .side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.shell-admin .side-nav a.active { background: rgba(245, 184, 61, .14); color: var(--gold); }
.shell-admin .me { background: rgba(255, 255, 255, .06); }
.shell-admin .me b { color: #fff; }
.shell-admin .me small { color: #8FA9B7; }
.shell-admin .avatar { background: linear-gradient(135deg, var(--gold), #D9932B); color: var(--navy); }
.shell-admin #logout { background: transparent; border-color: #24465A; color: #D9E6EC; }

/* ---- صفحة الشروط ---- */
.terms { max-width: 820px; margin: 10px auto 50px; padding: 32px clamp(20px, 4vw, 44px); }
.terms h1 { font-size: 28px; margin-bottom: 4px; }
.terms > .muted { margin-bottom: 16px; }
.terms h2 { font-size: 18px; margin: 22px 0 6px; }
.terms p { color: #3C4F5B; }
@media (max-width: 600px) {
  .admin-card { padding: 26px 20px; }
  .rv-thumb { width: 44px; height: 44px; }
}

/* ======================= التحقق بالجوال ======================= */
.otp-card { text-align: center; }
.otp-card .field { text-align: start; }
.otp-card h1 { margin-bottom: 6px; }
.otp-card > p.muted { margin-bottom: 18px; }
.otp-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--teal-l); color: var(--teal); display: grid; place-items: center; margin: 0 auto 16px; }
.otp-ic .ic { width: 30px; height: 30px; }
.otp-input { text-align: center; font-size: 28px !important; letter-spacing: 10px; font-weight: 800; padding: 12px !important; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { letter-spacing: 6px; color: #C5D3DA; }
.otp-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--teal); font-weight: 700; cursor: pointer; font-size: 14px; }
.link-btn:disabled { color: var(--muted); cursor: default; font-weight: 500; }
.dev-code { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; background: var(--gold-l); border: 1px dashed var(--gold); color: #7A5200; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.dev-code b { font-size: 20px; letter-spacing: 4px; color: var(--navy); }
.field-hint { font-size: 12px; }
.forgot-link { display: block; margin: -6px 0 14px; font-size: 14px; font-weight: 600; text-align: end; }
.phone-row { display: flex; gap: 8px; align-items: center; }
.phone-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--muted); }
.phone-line { display: flex; gap: 4px; align-items: center; }
.ok-tick { color: var(--green); font-weight: 800; }
#ph-body .otp-card h1 { font-size: 20px; }

/* ---- حالة التخزين في لوحة الأدمن ---- */
.storage-card { margin-bottom: 18px; border-inline-start: 4px solid var(--green); }
.storage-card.warn { border-inline-start-color: var(--amber); }
.storage-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.storage-head > div { display: flex; flex-direction: column; line-height: 1.4; }
.storage-card.warn .stat-ic { background: var(--amber-l); color: var(--amber); }
.storage-card.ok .stat-ic { background: var(--green-l); color: var(--green); }
.storage-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.storage-bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.storage-nums { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ===== سلة المحذوفات ووضع الصيانة ===== */
.muted-badge { background: var(--line, #e2e8f0); color: var(--ink-2, #475569); }
.subtle-banner { background: #F1F5F9; color: #334155; border-color: #E2E8F0; }
.trash-list { display: grid; gap: 12px; margin-top: 16px; }
.trash-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.trash-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trash-text > b { overflow-wrap: anywhere; }
.trash-text small { color: var(--muted, #64748b); overflow-wrap: anywhere; }
.trash-actions { flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.ltr-line { text-align: start; unicode-bidi: plaintext; }
.maint-card { display: flex; gap: 12px; align-items: flex-start; background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.maint-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; }
.maint-card svg { flex-shrink: 0; margin-top: 2px; }
.maint-bar { position: sticky; top: 0; z-index: 900; display: flex; gap: 8px; align-items: center; justify-content: center; background: #B91C1C; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 16px; text-align: center; }
.maint-bar svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 640px) {
  .trash-item { flex-wrap: wrap; }
  .trash-actions { width: 100%; justify-content: flex-start; }
}
.trash-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* العارض داخل تطبيق الجوال: ملء الشاشة بلا هوامش */
body.embedded { background: #0B1620; }
body.embedded .modal-backdrop { padding: 0; background: #0B1620; }
body.embedded .modal-viewer { max-width: none; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }

/* ===== بطاقة تكلفة Cloudflare ===== */
.cost-card { display: grid; gap: 10px; margin-bottom: 18px; }
.cost-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cost-row > div { display: flex; flex-direction: column; min-width: 0; }
.cost-row small { overflow-wrap: anywhere; }
.cost-row > span { font-weight: 800; color: var(--navy); white-space: nowrap; direction: ltr; }
.cost-total { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cost-total > div { background: var(--teal-xl); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.cost-total b { font-size: 22px; color: var(--teal-d); direction: ltr; text-align: start; }
.cost-total span { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .cost-total { grid-template-columns: 1fr; } }

/* ===== التحليل الذكي ===== */
.ai-btn[disabled] { opacity: .75; cursor: not-allowed; }
.soon-badge { font-style: normal; font-size: 11px; font-weight: 800; background: var(--gold-l); color: #7A5200; border-radius: 99px; padding: 1px 7px; margin-inline-start: 4px; }
.ai-overlay { position: absolute; inset: 0; background: rgba(14, 42, 59, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.ai-card { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: 100%; overflow: auto; box-shadow: var(--shadow-lg); }
.ai-report { display: grid; gap: 12px; }
.ai-report h4 { margin: 6px 0 0; color: var(--navy); }
.ai-report ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.ai-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-urg-urgent { background: var(--red-l); color: var(--red); }
.ai-urg-soon { background: var(--amber-l); color: var(--amber); }
.ai-urg-routine { background: var(--green-l); color: var(--green); }
.ai-plain { background: var(--teal-xl); border-radius: 12px; padding: 12px; line-height: 1.8; }
.ai-series { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; line-height: 1.7; }
.check input { margin-top: 5px; }

/* ============ فتح قرص الأشعة محلياً ============ */
.cd-cta { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 18px; border-radius: 14px; border: 1.5px dashed var(--teal); background: var(--teal-xl); color: var(--teal-d); cursor: pointer; font: inherit; text-align: start; max-width: 460px; transition: background .15s; }
.cd-cta:hover { background: var(--teal-l); }
.cd-cta > svg { width: 30px; height: 30px; flex: none; }
.cd-cta b { display: block; font-size: 16px; }
.cd-cta small { display: block; color: var(--muted); margin-top: 2px; }
.cd-main { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.cd-main h1 { display: flex; align-items: center; gap: 10px; font-size: 28px; margin: 0 0 8px; }
.cd-main h1 svg { width: 30px; height: 30px; color: var(--teal); }
.cd-pick { display: grid; gap: 12px; margin: 22px 0 16px; }
.cd-pick .dropzone { min-height: 190px; }
.cd-main .loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 20px; }
.cd-viewer { position: fixed; inset: 0; display: flex; flex-direction: column; background: #0B1820; z-index: 50; }
.cd-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cd-bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-bar-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-local { background: var(--teal-l); color: var(--teal-d); display: inline-flex; gap: 5px; align-items: center; }
.cd-local svg { width: 14px; height: 14px; }
.cd-stage { flex: 1; min-height: 0; position: relative; }
.mk-strip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: linear-gradient(90deg, var(--teal-d), var(--teal)); color: #fff; font-size: 14px; }
.mk-strip > svg { width: 18px; height: 18px; flex: none; color: #FFD66B; }
.mk-strip #mk-text { flex: 1; min-width: 0; transition: opacity .25s; font-weight: 600; }
.mk-strip #mk-text.fade { opacity: 0; }
.mk-strip .icon-btn { color: #fff; }
.mk-list { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; gap: 10px; }
.mk-list li { display: flex; gap: 8px; align-items: flex-start; }
.mk-list svg { width: 18px; height: 18px; color: var(--teal); flex: none; margin-top: 2px; }
.cd-why { margin-top: 28px; padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.cd-why h2 { margin: 0 0 16px; font-size: 20px; }
.cd-why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; text-align: start; }
.cd-why-item { display: flex; gap: 10px; align-items: flex-start; }
.cd-why-item .feature-ic { width: 40px; height: 40px; flex: none; }
.cd-why-item b { display: block; }
.cd-why-item small { color: var(--muted); }
.vw-card .card-head h3 { display: flex; gap: 8px; align-items: center; }
.vw-card .card-head h3 svg { width: 20px; height: 20px; color: var(--teal); }
@media (max-width: 640px) { .cd-why-grid { grid-template-columns: 1fr; } .mk-strip { font-size: 12.5px; } .mk-strip .btn { display: none; } }
@media (max-width: 640px) { .cd-local { display: none; } .cd-main h1 { font-size: 22px; } }
