:root {
  --green: #176b5b; --green-dark: #10503f; --mint: #ddf3ea; --bg: #fafcfa; --ink: #26332f; --gold: #c7a96b;
  --muted: #5a6a65; --line: #dde7e2; --card: #fff; --danger: #a8322d; --radius: 16px;
  --shadow: 0 1px 2px rgba(38, 51, 47, .05), 0 6px 20px rgba(38, 51, 47, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: .25rem 0 .6rem; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: #fff; padding: 8px 12px; z-index: 20; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); font-size: .9rem; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* الإطار */
.demo-strip { margin: 0; padding: 5px 16px; background: #f6efdd; color: #5c4a1c; font-size: .8rem; text-align: center; }
#header { background: var(--card); border-bottom: 1px solid var(--line); }
.bar, .tabs, #main, #footer { max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
.bar { display: flex; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-inline-end: auto; }
.brand b { display: block; letter-spacing: .04em; color: var(--green); line-height: 1.2; }
.brand small { color: var(--muted); font-size: .78rem; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #fff; display: grid; place-items: center; }
.logo .icon { width: 24px; height: 24px; stroke-width: 3.2; }
.roles { display: flex; background: var(--mint); border-radius: 999px; padding: 4px; gap: 2px; }
.roles a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--green-dark); font-weight: 600; font-size: .9rem; text-align: center; }
.roles a[aria-current] { background: var(--green); color: #fff; }
.bell { position: relative; }
.bell i { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 .7rem/19px sans-serif; font-style: normal; text-align: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; }
.tabs a { padding: 7px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.tabs a[aria-current] { background: var(--mint); color: var(--green-dark); }
#main { padding-block: 22px 40px; min-height: 60vh; outline: none; }
#footer { border-top: 1px solid var(--line); padding-block: 16px 28px; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.loading { text-align: center; padding: 40px; color: var(--muted); }

/* أزرار وحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: transparent; color: var(--ink); }
.btn.small { min-height: 38px; padding: 5px 12px; font-size: .86rem; border-radius: 10px; }
.btn.large { min-height: 50px; padding-inline: 26px; font-size: 1.05rem; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { border-color: var(--line); background: #fff; }
.btn.ghost:hover { border-color: var(--green); }
.btn.gold { background: var(--gold); color: #1f2a26; }
.btn.on-dark { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.link { color: var(--green); text-decoration: underline; padding-inline: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; color: var(--ink); flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; min-width: 0; }
input, select, textarea { font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #bfcec8; border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; min-height: 44px; }
input[type="color"] { padding: 4px; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; padding: 8px 12px; min-width: 0; }
legend { font-weight: 600; font-size: .9rem; padding-inline: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; font-weight: 400; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); flex: none; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; min-height: 36px; }
.segmented button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* حاويات */
.panel, .card, .tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px; margin-bottom: 18px; min-width: 0; }
.card { padding: 18px; min-width: 0; display: flex; flex-direction: column; }
.card > .row, .card > .btn { margin-top: auto; }
.card.off { background: #f3f5f4; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; margin-bottom: 18px; }
.cards.four { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.cards.one { grid-template-columns: minmax(0, 1fr); }
.cards.doctors { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.person .range { display: inline-block; white-space: nowrap; }
.card.service > p:not(.price) { flex: 1; }
.grid { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); }
.grid > .panel { align-self: start; }
@media (min-width: 620px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 920px) { .grid.split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .grid.two-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 16px; }
.page-head p { color: var(--muted); margin: 0; }
.page-head label { margin: 0; }
.section-title { margin: 28px 0 12px; }
.section-title small { color: var(--muted); font-weight: 400; font-size: .85rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { padding: 14px 16px; display: flex; flex-direction: column; }
.tile span { color: var(--muted); font-size: .86rem; font-weight: 600; }
.tile strong { font-size: 1.65rem; color: var(--green-dark); line-height: 1.4; }
.tile small { color: var(--muted); font-size: .75rem; line-height: 1.4; }
@media (max-width: 420px) { .tile strong { font-size: 1.4rem; } }
.tiles.five .tile:last-child { grid-column: 1 / -1; background: var(--mint); }
@media (min-width: 860px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles.five { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); } .tiles.five .tile:last-child { grid-column: auto; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.toolbar label { margin: 0; }
.toolbar .inline { flex: 1 1 140px; max-width: 240px; }
.toolbar .grow { flex-basis: 240px; max-width: 360px; }
.date-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.date-nav input { width: auto; flex: 1 1 140px; min-height: 38px; padding-block: 5px; }
.period-title { font-weight: 700; color: var(--green-dark); }
.day-title { margin-top: 18px; }
.empty { text-align: center; color: var(--muted); padding: 26px 14px; border: 1px dashed #c4d3cd; border-radius: var(--radius); margin-bottom: 14px; grid-column: 1 / -1; }
.empty .icon { width: 30px; height: 30px; }
.alert { border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; border: 1px solid; font-size: .93rem; }
.alert.error { background: #fdeeed; border-color: #e5b0ad; color: #85241f; }
.alert.info { background: var(--mint); border-color: #b5ddcd; color: var(--green-dark); }
.alert.warn { background: #fdf4e0; border-color: #e5cc8f; color: #6b4d09; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #edf1ef; color: var(--muted); }
.pill.on { background: var(--mint); color: var(--green-dark); }

/* الحالات: لون مع نص ورمز */
.st-pending { --sb: #fdf3d9; --sf: #75540a; }
.st-confirmed { --sb: #ddf3ea; --sf: #11594a; }
.st-checked_in { --sb: #e2eefb; --sf: #1d4f80; }
.st-in_progress { --sb: #ece6f8; --sf: #4d3688; }
.st-completed { --sb: #e4ebe8; --sf: #35453f; }
.st-cancelled { --sb: #fbe9e8; --sf: #8d2a26; }
.st-no_show { --sb: #f8ebe1; --sf: #824416; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--sb); color: var(--sf); font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* بطاقة الحجز */
.booking { background: #fff; border: 1px solid var(--line); border-inline-start: 5px solid var(--c); border-radius: 14px; padding: 14px; min-width: 0; }
.booking p { margin: 2px 0; }
.booking-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.booking-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .88rem; }
.booking .row { gap: 6px; margin-top: 10px; }

/* الرئيسية */
.hero { display: grid; gap: 20px; background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; border-radius: 22px; padding: clamp(20px, 4vw, 40px); }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.eyebrow { color: #e7d3a6; letter-spacing: .18em; font-weight: 700; font-size: .8rem; text-align: start; }
html[dir="rtl"] .eyebrow { text-align: right; }
.hours { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--radius); padding: 18px; align-self: center; }
.hours h2 { display: flex; align-items: center; gap: 8px; }
.hours p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 8px; }
.hero-media { position: relative; margin: 0; min-width: 0; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; background: var(--mint); border: 1px solid rgba(199, 169, 107, .65); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto auto; column-gap: 32px; align-items: center; }
  .hero > div { grid-column: 1; grid-row: 1; align-self: end; }
  .hero > .hours { grid-column: 1; grid-row: 2; align-self: start; }
  .hero-media { grid-column: 2; grid-row: 1 / span 2; aspect-ratio: 4 / 3; }
}
.service-media { margin: 0 -18px; aspect-ratio: 16 / 10; background: var(--mint); overflow: hidden; }
.service-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card.service.has-media { padding-top: 0; overflow: hidden; }
.card.service.has-media .service-icon { position: relative; margin-top: -23px; box-shadow: 0 0 0 3px #fff; }
.choice-thumb { width: 64px; height: 64px; border-radius: 13px; object-fit: cover; flex: none; background: var(--mint); }
.service-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--mint); color: var(--green); display: grid; place-items: center; flex: none; margin-bottom: 8px; }
.service-icon .icon { width: 26px; height: 26px; }
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.price b { color: var(--green-dark); font-size: 1.1rem; }
.price span { color: var(--muted); font-size: .88rem; }
.person { display: flex; flex-direction: row; gap: 14px; align-items: center; }
.person p { margin: 0; }
.person small { color: var(--muted); }
.avatar { position: relative; overflow: hidden; width: 52px; height: 52px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; flex: none; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
/* تكبير خفيف نحو الوجه داخل القص الدائري */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.28); transform-origin: 50% 24%; }
.avatar.large { width: 84px; height: 84px; font-size: 1.4rem; }
.avatar.mini { width: 32px; height: 32px; font-size: .68rem; box-shadow: 0 0 0 2px var(--c); }
.avatar.mini img { transform: scale(1.7); transform-origin: 50% 28%; }

/* طلبات تغيير الموعد */
.request-note { display: flex; gap: 8px; align-items: flex-start; background: #fdf3d9; color: #6b4d09; border: 1px solid var(--gold); border-radius: 10px; padding: 7px 10px; font-size: .86rem; margin: 8px 0; }
.request-note .icon { margin-top: 4px; }
.panel.requests { border-color: var(--gold); }
.requests .count { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: #1f2a26; font-size: .82rem; text-align: center; }
.requests ul { list-style: none; margin: 0; padding: 0; }
.requests li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; border-top: 1px solid var(--line); padding: 10px 0; }
.requests li > div:first-child { flex: 1 1 280px; min-width: 0; }
.requests li small, .requests li p span { display: block; }
.requests li small { color: var(--muted); }
.requests li p { margin: 4px 0 0; font-size: .9rem; }
.requests .row { margin: 0; }
.table td small.req-flag { color: #75540a; font-weight: 700; }
.policy { border: 0; padding: 0; margin: 0 0 6px; }
.policy .check { align-items: flex-start; padding: 8px 0; }
.policy .check input { margin-top: 3px; }
.policy .check small { display: block; color: var(--muted); }

/* الحجز */
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 16px; gap: 4px; }
.steps li { flex: 1; min-width: 0; text-align: center; font-size: .76rem; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; }
.steps li i { display: block; font-style: normal; font-weight: 700; }
.steps li.done { border-color: #8fc9b4; }
.steps li.on { border-color: var(--green); color: var(--green-dark); font-weight: 700; }
.wizard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
@media (min-width: 900px) { .wizard { grid-template-columns: minmax(0, 1fr) 290px; } }
.summary dl { margin: 0 0 8px; }
.summary dl div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; text-align: end; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.choice { display: flex; gap: 12px; align-items: center; text-align: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.choice .service-icon { margin: 0; }
.choice b, .choice small { display: block; }
.choice small { color: var(--muted); }
.choice:hover, .choice[aria-pressed="true"] { border-color: var(--green); background: #f1faf6; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 16px; }
.day, .slot, .chip { font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; min-height: 44px; }
.day { padding: 8px 4px; }
.day b, .day small { display: block; font-size: .82rem; }
.day small { color: var(--muted); font-size: .72rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 260px; overflow-y: auto; padding: 3px; }
.day[aria-pressed="true"], .slot[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.day[aria-pressed="true"] small { color: #d8f1e7; }
.day:disabled { opacity: .45; cursor: not-allowed; background: #f1f3f2; }
.suggest { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-color: var(--gold); font-size: .88rem; }
.chip small { display: block; color: var(--muted); }
.success { max-width: 520px; margin: 10px auto; text-align: center; align-items: center; }
.success-icon { width: 66px; height: 66px; border-radius: 50%; background: var(--mint); color: var(--green); display: grid; place-items: center; margin-bottom: 12px; }
.success-icon .icon { width: 36px; height: 36px; stroke-width: 2.4; }
.ref { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); border: 2px dashed var(--gold); border-radius: 12px; padding: 4px 22px; }

/* التقويم */
.cal-wide { display: none; }
@media (min-width: 760px) { .cal-wide { display: block; } .cal-narrow { display: none; } }
.cal { display: grid; grid-template-columns: 66px repeat(var(--cols), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; background: #fff; }
.cal-name { height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; background: #f6faf8; }
.cal-name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cal-col { border-inline-start: 1px solid var(--line); min-width: 0; }
.cal-body { position: relative; margin-block: 10px; }
.cal-col .cal-body { background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.cal-hours span { position: absolute; inset-inline-start: 6px; transform: translateY(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.cal-off { position: absolute; inset-inline: 0; background: repeating-linear-gradient(135deg, #eef1f0 0 6px, #f7f9f8 6px 12px); display: grid; place-items: center; color: var(--muted); font-size: .72rem; overflow: hidden; }
.event { position: absolute; inset-inline: 3px; overflow: hidden; text-align: start; font: inherit; font-size: .76rem; line-height: 1.35; padding: 3px 8px; border: 0; border-inline-start: 4px solid var(--c); border-radius: 8px; background: var(--sb); color: var(--sf); cursor: pointer; }
.event b, .event span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event b .icon { margin-inline-end: 4px; vertical-align: -2px; }
.event.tiny { padding-block: 1px; }
.event.tiny span { display: none; }
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.week-day { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #f8faf9; min-width: 0; }
.week-day.is-today { border: 2px solid var(--green); }
.week-day h3 { display: flex; justify-content: space-between; align-items: center; }
.week-day h3 button { font: inherit; background: none; border: 0; color: var(--green-dark); cursor: pointer; padding: 4px; text-decoration: underline; }
.week-day h3 small { color: var(--muted); }
.week-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: start; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--c); border-radius: 10px; padding: 8px 10px; margin-bottom: 7px; cursor: pointer; }
.week-item small { color: var(--muted); }
.week-item .badge { font-size: .72rem; }

/* الجداول: بطاقات على الجوال */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: start; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: .82rem; }
.table td small { display: block; color: var(--muted); }
.table tfoot td { font-weight: 700; }
@media (max-width: 719px) {
  .table, .table tbody, .table tfoot, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .table td { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border: 0; padding: 4px 0; text-align: end; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; text-align: start; }
  .table td small { display: inline; margin-inline-start: 6px; }
  .table td:not([data-label]) { justify-content: flex-end; }
}

/* التقارير */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 2.2em; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; }
.bars li:hover { background: #f3f8f6; }
.bar-label { font-size: .88rem; min-width: 0; }
.bar-track { height: 14px; display: flex; }
.bar-track i { background: var(--green); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bars b { text-align: end; font-variant-numeric: tabular-nums; }

/* النوافذ والإشعارات */
dialog { width: min(600px, calc(100vw - 20px)); max-height: min(88vh, 88dvh); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 70px rgba(15, 40, 32, .3); overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(18, 38, 32, .5); }
dialog.drawer { width: min(430px, calc(100vw - 20px)); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); margin-block: 10px; margin-inline: auto 10px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 16px; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; margin: 0 0 8px; }
.facts div { background: #f5f9f7; border-radius: 10px; padding: 7px 11px; min-width: 0; }
.facts dt { color: var(--muted); font-size: .78rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd[dir="ltr"] { text-align: right; }
.correct { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 14px 0; }
.correct summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.correct form { margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--mint); }
.timeline li { padding-inline-start: 14px; margin-bottom: 10px; position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.timeline li.warn::before { background: var(--danger); }
.timeline p { margin: 0; font-size: .93rem; }
.timeline small, .notifs small { color: var(--muted); font-size: .78rem; }
.note { font-size: .82rem; background: #f6efdd; color: #5c4a1c; border-radius: 10px; padding: 7px 11px; }
.notifs { list-style: none; padding: 0; }
.notifs li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 9px; }
.notifs li.unread { background: #f1faf6; border-color: #a9d8c6; }
.notifs p { margin: 6px 0 2px; font-size: .93rem; }
.notifs .row { margin-top: 2px; }
#toast { position: fixed; inset-inline: 16px; bottom: 16px; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; z-index: 30; visibility: hidden; }
#toast.show { opacity: 1; transform: none; visibility: visible; }
#toast.error { background: var(--danger); }

@media (max-width: 760px) {
  .roles { order: 3; width: 100%; }
  .roles a { flex: 1; padding-inline: 6px; font-size: .85rem; }
  .btn.small, .segmented button { min-height: 42px; }
  .panel { padding: 13px; }
  .toolbar .inline, .toolbar .grow { max-width: none; }
  .toolbar .date-nav { width: 100%; }
}
@media (max-width: 420px) { .roles a { font-size: .8rem; padding-inline: 3px; white-space: nowrap; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
