/* Nasaqak. Look copied from the Retwa site (approved mockup_v6): calm page, white cards
   with soft sharp edges, navy as the only accent. Only opacity/transform animate. */
@font-face {
  font-family: 'Alyamama'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/alyamama-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Alyamama'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/alyamama-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --side: 264px;   /* side menu width, the bottom fog starts after it */
  --paper-0: #ffffff; --paper-100: #e9edf2; --paper-200: #eceae3; --paper-300: #dedbd2;
  --ink-900: #14202e; --ink-700: #34465a; --ink-500: #5d6c7b; --ink-400: #8b97a3;
  --brand: #1a2f5c; --brand-2: #4a5f8a; --brand-3: #8797b8; --brand-4: #b9c4d9; --brand-bg: #e9edf4;
  --bg: var(--paper-100); --surface: var(--paper-0); --line: var(--paper-200); --line-2: var(--paper-300);
  --hover: #f5f1e8; --err: #9b2c2c;
  --r: 12px; --r-lg: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-family: 'Alyamama', Tahoma, sans-serif; font-size: 15px; line-height: 1.6; color: var(--ink-900); background: var(--bg); font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
a { color: inherit; }
svg.i { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); z-index: 0; padding: 26px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side::after { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-end: -2px; width: 4px; background: #fff; filter: blur(1.5px); pointer-events: none; }
.side .logo { padding: 0 10px 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side .logo img { display: block; }
.side a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink-500); text-decoration: none; transition: color .15s, background .15s; }
.side a:hover { color: var(--ink-900); }
.side a.on { background: var(--brand-bg); color: var(--brand); font-weight: 700; }
.side .sep { height: 1px; background: var(--line); margin: 8px 12px; flex: none; }
.side .foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-500); }
.side .foot b { display: block; color: var(--ink-900); font-size: 14px; }
.side .out { margin-top: 10px; height: 34px; padding: 0; border: 0; background: none; color: var(--ink-500); display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.side .out:hover { color: var(--brand); }
.side .out svg { width: 17px; height: 17px; }

main { position: relative; z-index: 1; padding: 32px clamp(24px, 3vw, 44px) 60px; padding-inline-start: 44px; min-width: 0; }
.page { animation: pagein .22s cubic-bezier(.2,.7,.2,1); }
.page.still { animation: none; }   /* tab switch on the same client page */
@keyframes pagein { from { opacity: 0; transform: translateY(4px); } }

.head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.head h1 { font-size: 30px; font-weight: 700; line-height: 1.2; }
.head .sub { color: var(--ink-500); margin-top: 6px; }
.hact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- buttons and inputs ---------- */
.fbtn, .btn { height: 42px; padding: 0 18px; border: 0; border-radius: var(--r); background: #fff; color: var(--ink-900); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.fbtn:hover, .btn:hover { color: var(--brand); }
.fbtn svg, .btn svg { width: 18px; height: 18px; }
.btn.pri { background: var(--brand); color: #fff; }
.btn.pri:hover { background: #22396b; color: #fff; }
.btn.ln { border: 1px solid var(--line-2); }
.btn.plain { background: none; color: var(--ink-500); }
.btn.plain:hover { color: var(--ink-900); }
.btn.big { height: 46px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.sb { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink-700); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s; }
.sb:hover { color: var(--brand); border-color: var(--brand-4); }
.sb svg { width: 16px; height: 16px; }

.inp { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; padding: 0 14px; font: inherit; font-size: 15px; color: var(--ink-900); outline: none; transition: border-color .15s; }
.inp:focus { border-color: var(--brand-4); }
textarea.inp { height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.6; }
/* rtl mirrored the Arabic day/month/year letters, so the field stays ltr */
input[type=date].inp, input[type=time].inp { direction: ltr; text-align: right; }
input[type=file].inp { padding: 9px 12px; height: auto; cursor: pointer; }
.search { width: 240px; max-width: 100%; height: 40px; }
.err { color: var(--err); font-size: 14px; min-height: 22px; margin-top: 10px; }

/* ---------- soft white cards ---------- */
.kpi, .chart, .card, .auth .box { position: relative; isolation: isolate; background: none; }
.kpi::before, .chart::before, .card::before, .auth .box::before { content: ''; position: absolute; inset: 2px; z-index: -1; border-radius: 27px; background: #fff; filter: blur(1.5px); transition: bottom .2s; }

/* ---------- number row ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; position: relative; z-index: 2; }
.kpis.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 34px clamp(18px, 1.8vw, 28px) 32px; display: flex; flex-direction: column; }
.kpi small { display: block; font-size: 16px; line-height: 1.4; color: var(--ink-700); }   /* wraps when the card gets narrow */
.kpi > b { display: block; font-size: clamp(36px, 3.2vw, 52px); font-weight: 700; line-height: 1.2; margin-top: auto; padding-top: 8px; color: var(--brand); }
/* clickable cards lift a little on hover (transform only, stays smooth) */
.kpi.go { cursor: pointer; transition: transform .22s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.kpi.go:hover { transform: translateY(-5px); }

/* cases card: hover drops a finished vs ongoing bar under it */
.kpi.cases:hover { z-index: 3; }
.more { position: absolute; inset-inline: 0; top: calc(100% - 6px); padding: 0 clamp(16px, 1.6vw, 24px); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s; }
.kpi.cases:hover::before { bottom: -50px; }
.kpi.cases:hover .more { opacity: 1; transform: none; }
.more .track { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 3px; }
.more .track i { display: block; height: 100%; }
.more .track i.a { background: var(--brand); }
.more .track i.b { background: #b8453c; }
.more .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 10px; font-size: 13px; color: var(--ink-500); }
.more .row span { white-space: nowrap; }
.more .row strong { color: var(--ink-900); font-size: 15px; margin-inline-end: 4px; }
.hint { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; color: var(--ink-400); transition: opacity .2s; }
.hint svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi.cases:hover .hint { opacity: 0; }

/* ---------- summary charts ---------- */
.charts { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 28px; margin-top: 66px; }
.chart { padding: 34px clamp(20px, 2.2vw, 36px) 30px; }
.chart h2, .card h2 { font-size: 20px; font-weight: 700; }
.chart .cap, .card .cap { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.plot { position: relative; height: 300px; margin-top: 50px; display: grid; grid-template-columns: 36px 1fr; }
.axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--ink-400); padding-bottom: 30px; text-align: end; padding-inline-end: 8px; }
.area { position: relative; border-bottom: 1px solid var(--line-2); margin-bottom: 30px; }
.area .grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.area .grid i { border-top: 1px solid var(--line); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-around; gap: 14px; padding: 0 10px; }
.bar { flex: 1; max-width: 72px; position: relative; border-radius: 6px 6px 0 0; transition: height .4s cubic-bezier(.2,.7,.2,1); }
.bar.a { background: #3f72b8; }
.bar.b { background: var(--brand); }
.bar span { position: absolute; top: -24px; inset-inline: 0; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink-900); }
.bar em { position: absolute; bottom: -28px; inset-inline: -10px; text-align: center; font-style: normal; font-size: 13px; color: var(--ink-700); white-space: nowrap; }

.donut { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(14px, 1.6vw, 28px); }
.donut .ring { position: relative; width: clamp(200px, 19vw, 330px); aspect-ratio: 1; flex: none; }
.donut svg { width: 100%; height: 100%; overflow: visible; }
.donut circle { fill: none; stroke-width: 20; }
.donut .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut .mid b { font-size: clamp(40px, 3.4vw, 60px); font-weight: 700; color: var(--brand); line-height: 1.1; }
.donut .mid small { color: var(--ink-500); font-size: 16px; }
.donut .empty-ring { stroke: var(--line); }
.lg { align-self: stretch; padding-block: 20px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.lg .nm { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1.35; color: var(--ink-700); }
.lg .nm span { flex: none; }
.lg .nm span { width: 10px; height: 10px; border-radius: 3px; }
.lg b { display: inline-block; font-size: clamp(22px, 2vw, 28px); font-weight: 700; margin-top: 2px; }
.lg.end { align-items: flex-end; text-align: end; }
.lg > div { cursor: pointer; }

.seg { cursor: pointer; }
.seg .mv { transition: transform .25s ease; }
.seg .arc { pointer-events: none; }
.seg .hit { pointer-events: stroke; stroke-width: 46; }
.seg .haze { stroke-width: 34; }
.seg .haze, .seg text { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.seg text { font-family: 'Alyamama', Tahoma, sans-serif; font-size: 10px; font-weight: 700; fill: var(--ink-900); }
.seg:hover .mv { transform: translate(var(--tx), var(--ty)); }
.seg:hover .haze { opacity: .3; filter: url(#haze); }
.seg:hover text { opacity: 1; }

/* ---------- lists ---------- */
.card { padding: 30px clamp(18px, 2.2vw, 34px); }
.sect { margin-top: 40px; }
.card .ch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 13px; color: var(--ink-500); font-weight: 500; text-align: start; padding: 0 12px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row td { transition: background .15s; }
.tbl tr.row:hover td { background: #faf7f0; }
.tbl td.t { font-weight: 700; }
.tbl td.m { color: var(--ink-500); white-space: nowrap; }
.tbl td.mw { color: var(--ink-500); overflow-wrap: anywhere; width: 190px; }   /* muted but wraps (email addresses) */
.tbl td.n { font-weight: 700; color: var(--brand); }
.st { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.st::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--brand); flex: none; }
.st.s2::before { background: var(--brand-3); }
.st.s3::before { background: var(--brand-4); }
.st.off { color: var(--ink-500); }
.empty, .loading { padding: 44px 0; text-align: center; color: var(--ink-500); }
.loading { color: var(--ink-400); }
.count { color: var(--ink-400); font-size: 14px; }

/* segmented switch (period, active or archive) */
.seg3 { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px; gap: 4px; background: #fff; }
.seg3 button { height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font-size: 15px; color: var(--ink-500); cursor: pointer; outline: none; white-space: nowrap; }
.seg3 button.on { background: var(--brand-bg); color: var(--brand); font-weight: 700; }
.hact .seg3 { border: 0; height: 42px; padding: 3px; }
.hact .seg3 button { height: 36px; }

/* ---------- panes over a fog ---------- */
.veil { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; padding: 32px 16px; overflow-y: auto; visibility: hidden; opacity: 0; pointer-events: none; background: rgba(233,237,242,.78); will-change: opacity; transition: opacity .24s cubic-bezier(.2,.7,.2,1), visibility 0s linear .24s; }
.veil.on { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .24s cubic-bezier(.2,.7,.2,1), visibility 0s; }
/* While a popup is open the page behind never scrolls; the gutter keeps the layout from jumping. */
html.paneopen, html.paneopen body { overflow: hidden; }
html.paneopen { scrollbar-gutter: stable; }
.veil, .mlist, .doc .pages, .ddm { overscroll-behavior: contain; }
.veil.blur { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.pane { position: relative; margin: auto 0; flex: none; width: 460px; max-width: 100%; background: #fff; border-radius: 22px; padding: 30px 32px 26px; opacity: 0; will-change: transform, opacity; transform: translateY(10px) scale(.985); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease-out; }
.veil.on .pane { opacity: 1; transform: none; }
.pane.wide { width: 760px; max-width: 100%; }
.pane h2 { font-size: 22px; font-weight: 700; margin-bottom: 22px; padding-inline-end: 44px; line-height: 1.35; }
.pane h2 + .psub { margin: -16px 0 22px; color: var(--ink-500); font-size: 14px; }
.pane .x { position: absolute; top: 24px; inset-inline-end: 24px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ink-500); display: grid; place-items: center; cursor: pointer; }
.pane .x:hover { background: var(--hover); color: var(--ink-900); }
.pane .x svg { width: 20px; height: 20px; }
.fld { margin-bottom: 18px; }
.fld > label { display: block; font-size: 14px; color: var(--ink-500); margin-bottom: 7px; }
.fld > label em { font-style: normal; color: var(--ink-400); }
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fg .full { grid-column: 1 / -1; }
.acts { display: flex; gap: 10px; margin-top: 26px; align-items: center; }
.acts .grow { flex: 1; }
.pfoot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.pfoot .err { margin: 0 0 8px; min-height: 0; }
.pfoot .err:empty { display: none; }
.pfoot .acts { margin-top: 0; }
.note { color: var(--ink-500); font-size: 14px; }
.secret { margin: 6px 0 4px; padding: 14px 16px; border-radius: var(--r); background: var(--hover); font-size: 20px; font-weight: 700; letter-spacing: .5px; direction: ltr; text-align: center; user-select: all; }

/* custom dropdowns, drawn like the rest of the page */
.dd { position: relative; }
.ddb { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; font-size: 15px; font-weight: 700; color: var(--ink-900); cursor: pointer; outline: none; transition: border-color .15s; }
.ddb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddb svg { width: 16px; height: 16px; color: var(--ink-400); transition: transform .2s; }
.dd.open .ddb { border-color: var(--brand-4); }
.dd.open .ddb svg { transform: rotate(180deg); }
.ddm { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 5; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 10px 24px rgba(20,32,46,.06); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.dd.open .ddm { opacity: 1; transform: none; pointer-events: auto; }
.ddm button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-size: 15px; color: var(--ink-700); cursor: pointer; text-align: start; }
.ddm button:hover { background: var(--hover); }
.ddm button.on { color: var(--brand); font-weight: 700; }
.ddm button.on::after { content: ''; flex: none; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2f5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") no-repeat center / contain; }
.hact .dd { min-width: min(230px, 100%); }
.hact .ddb { border: 0; height: 42px; }
/* tools inside a white card need their border back */
.card .hact .seg3 { border: 1px solid var(--line-2); height: 40px; padding: 3px; }
.card .hact .seg3 button { height: 32px; font-size: 14px; }
.card .hact .dd { min-width: min(200px, 100%); }
.card .hact .ddb { border: 1px solid var(--line-2); height: 40px; font-size: 14px; }
.dd.off .ddb { color: var(--ink-400); cursor: default; }

/* ---------- item detail ---------- */
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }
.dl small { display: block; font-size: 13px; color: var(--ink-500); }
.dl b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.dl b.none { color: var(--ink-400); font-weight: 500; }
/* Next session: calm beige card, the first thing the client looks for */
.dl .hl { background: #f6f0e4; border: 1px solid #e9dfcb; border-radius: var(--r); padding: 10px 14px; margin: -11px -15px; }
.dl .hl small { color: #8a7350; }
.dl .hl b { color: #4a3b22; }
.psec { margin-top: 28px; }
.psec h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.psec p.txt { color: var(--ink-700); white-space: pre-wrap; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .tx { flex: 1; min-width: 0; }
.li .tx b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .tx small { display: block; color: var(--ink-500); font-size: 13px; }
.li .ops { display: flex; gap: 8px; flex: none; }
.li.arch .tx b { color: var(--ink-500); }
.fi { width: 40px; height: 40px; border-radius: 10px; background: var(--hover); color: var(--brand); display: grid; place-items: center; flex: none; }
.fi svg { width: 20px; height: 20px; }
.li.click { cursor: pointer; }
.li.click:hover .tx b { color: var(--brand); }
.day { width: 52px; flex: none; text-align: center; color: var(--brand); line-height: 1.15; }
.day b { display: block; font-size: 22px; font-weight: 700; }
.day small { font-size: 12px; color: var(--ink-500); }
.addrow { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto; gap: 10px; margin-top: 10px; }

/* ---------- file library ---------- */
.lib .card + .card { margin-top: 24px; }
.grp { margin-top: 22px; }
.grp > h3 { font-size: 15px; font-weight: 700; color: var(--ink-700); padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.grp .itm { margin-top: 12px; }
.grp .itm > small { display: block; color: var(--ink-500); font-size: 13px; margin-bottom: 2px; }

/* ---------- document viewer ---------- */
.pane.doc { width: min(1040px, 94vw); height: calc(100vh - 64px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.doc .dbar { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.doc .dbar .tx { flex: 1; min-width: 0; }
.doc .dbar .tx b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .dbar .tx small { color: var(--ink-500); font-size: 13px; }
.doc .zoom { color: var(--ink-500); font-size: 14px; min-width: 48px; text-align: center; }
.doc .x2 { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ink-500); display: grid; place-items: center; cursor: pointer; }
.doc .x2:hover { background: var(--hover); color: var(--ink-900); }
.doc .pages { flex: 1; overflow: auto; background: #f6f2ea; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.doc .pages canvas, .doc .pages img { display: block; background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(20,32,46,.08); flex: none; }
.doc .pages img { max-width: 100%; height: auto; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .box { width: 420px; max-width: 100%; padding: 44px 40px 36px; }
.auth .logo { display: block; width: 150px; margin: 0 auto 30px; }
.auth h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth .sub { color: var(--ink-500); margin-bottom: 24px; font-size: 14px; }
.auth form .btn { margin-top: 8px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 24px; z-index: 60; max-width: 380px; background: var(--ink-900); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 14px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: none; }
.toast.bad { background: var(--err); }

/* ---------- client page tabs and row buttons ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin: -6px 0 24px; overflow-x: auto; }
.tabs a { height: 46px; padding: 0 16px; display: flex; align-items: center; white-space: nowrap; color: var(--ink-500); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tabs a:hover { color: var(--ink-900); }
.tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.tabtools { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 24px; }
.tabtools + .kpis { margin-top: 0; }
.rops { display: flex; gap: 8px; justify-content: flex-end; }
.tbl td.ops { width: 1%; white-space: nowrap; }

/* ---------- service dashboard: first screen, the list sits below ---------- */
.dash { min-height: calc(100vh - 32px); display: flex; flex-direction: column; padding-bottom: 40px; }
.dash2 { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: 28px; margin-top: 40px; }
.dash2 .chart { display: flex; flex-direction: column; }
.dash .cbody { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 18px; }
.dash + .sect { margin-top: 0; }
.sring { position: relative; width: clamp(170px, 15vw, 230px); aspect-ratio: 1; margin: 0 auto; }
.sring svg { width: 100%; height: 100%; }
.sring circle { fill: none; stroke-width: 20; }
.sring .empty-ring { stroke: var(--line); }
.sring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.sring .mid b { font-size: clamp(36px, 3vw, 48px); font-weight: 700; color: var(--brand); line-height: 1.1; }
.sring .mid small { color: var(--ink-500); }
.slg { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 12px; margin-top: 22px; }
.slg div { text-align: center; }
.slg small { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink-500); white-space: nowrap; }
.slg small span { width: 10px; height: 10px; border-radius: 3px; }
.slg b { font-size: 26px; font-weight: 700; }
.cols { display: flex; align-items: flex-end; gap: 12px; height: 230px; border-bottom: 1px solid var(--line-2); margin-top: 26px; }
.cols div { flex: 1; position: relative; min-height: 2px; background: #6f97cf; border-radius: 5px 5px 0 0; transition: height .4s cubic-bezier(.2,.7,.2,1); }
.cols div.now { background: #b8453c; }
.cols div span { position: absolute; top: -22px; inset-inline: 0; text-align: center; font-size: 13px; font-weight: 700; }
.mo { display: flex; gap: 12px; margin-top: 8px; }
.mo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: 12px; color: var(--ink-500); white-space: nowrap; }

/* ---------- bottom fog: more page below ---------- */
.fogb, .fogblur { position: fixed; bottom: 0; inset-inline-start: var(--side); inset-inline-end: 0; height: 120px; z-index: 5; pointer-events: none; }
.fogb { opacity: 0; transition: opacity .3s ease; background: linear-gradient(to bottom, rgba(233,237,242,0) 0%, rgba(233,237,242,.8) 65%, #e9edf2 100%); }
.fogb.on { opacity: 1; }
.fogblur { display: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 70%); mask-image: linear-gradient(to bottom, transparent, #000 70%); }
.fogblur.on { display: block; }

/* ---------- filter row under the title (replaces the تحديد pane) ---------- */
.filters { position: relative; z-index: 4; display: flex; gap: 10px; flex-wrap: wrap; margin: -6px 0 26px; }
.filters .dd { min-width: min(220px, 100%); }
.filters .ddb { border: 0; height: 42px; justify-content: flex-start; gap: 8px; font-size: 14px; }
.filters .ddb small { color: var(--ink-500); font-size: 14px; font-weight: 400; flex: none; }
.filters .ddb svg { margin-inline-start: auto; }
.filters .dd.off .ddb small { color: var(--ink-400); }

/* ---------- case page: stages stepper (version A) ---------- */
.back { border: 0; background: none; padding: 0; margin-bottom: 8px; font-size: 14px; color: var(--ink-500); cursor: pointer; }
.back:hover { color: var(--brand); }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.chart .body { margin-top: 18px; }
.dl.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.li .tx small.wrap { white-space: pre-wrap; }
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 26px; position: relative; }
.steps::before { content: ''; position: absolute; top: 15px; inset-inline: 7.14%; height: 3px; background: var(--brand-4); border-radius: 2px; }
.steps .prg { position: absolute; top: 15px; inset-inline-start: 7.14%; height: 3px; background: var(--brand); border-radius: 2px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.st7 { position: relative; text-align: center; padding: 0 6px; }
.st7 .dot { width: 33px; height: 33px; padding: 0; border-radius: 50%; margin: 0 auto; background: #fff; border: 3px solid var(--brand-4); display: grid; place-items: center; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-400); position: relative; }
.st7.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.st7.now .dot { border-color: var(--brand); color: var(--brand); }
.steps.edit .dot { cursor: pointer; transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.steps.edit .dot:hover { transform: scale(1.12); }
.st7 b { display: block; margin-top: 12px; font-size: 14px; line-height: 1.4; }
.st7 small { display: block; color: var(--ink-500); font-size: 13px; margin-top: 2px; }
.st7.next b { color: var(--ink-400); font-weight: 500; }
.count30 { margin-top: 26px; padding: 16px 20px; border-radius: 12px; background: var(--brand-bg); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.count30 b { color: var(--brand); font-size: 18px; }
.count30 strong { font-size: 30px; color: var(--brand); }
.count30.over b { color: var(--ink-700); }

/* ---------- dashboard interactions ---------- */
.sring .mid { pointer-events: none; }
.sring svg { overflow: visible; }
.slg > div { cursor: pointer; }
.cwrap { position: relative; }
.cols div.has { cursor: pointer; }
.cols div.has:hover { background: var(--brand); }
.mlist { max-height: 60vh; overflow-y: auto; margin-inline: -12px; }
/* Month list rows: soft tinted card on hover, text slides a little, borders around it hide */
.mlist .li { padding: 12px; border-radius: var(--r); transition: background-color .16s ease, border-color .16s ease; }
.mlist .li .tx { transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.mlist .li.click:hover { background: var(--brand-bg); }
.mlist .li.click:hover .tx { transform: translateX(-4px); }
.mlist .li.click:hover, .mlist .li:has(+ .li.click:hover) { border-bottom-color: transparent; }
.mlist .li.click:active { background: #dfe5ef; }
.cpop { position: absolute; left: 0; top: 0; z-index: 6; width: 340px; background: #fff; border-radius: 16px; padding: 16px 18px 8px; box-shadow: 0 10px 30px rgba(20,32,46,.10); opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.cpop.on { opacity: 1; transform: none; pointer-events: auto; }
.cpop h4 { margin: 0 0 4px; font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.cpop h4 small { color: var(--ink-400); font-weight: 500; }
.cpop .li { padding: 9px 0; }
.cpop .li .tx b { font-size: 14px; }
.cpop .note { padding: 8px 0 6px; font-size: 13px; }
.dash2 { position: relative; z-index: 3; }   /* the month list may rise over the numbers row */

/* ---------- cloud scrollbar: soft draggable thumb that stretches and springs back ---------- */
.cs-hide { scrollbar-width: none; }
.cs-hide::-webkit-scrollbar { display: none; }
.cs-wrap { position: relative; }
.cs-track { position: absolute; top: 0; bottom: 0; inset-inline-end: -20px; width: 14px; z-index: 2; cursor: pointer; }
.cs-track.win { position: fixed; top: 10px; bottom: 10px; left: 6px; inset-inline-end: auto; z-index: 8; }
.cs-track.off { display: none; }
.cs-thumb { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.cs-blob { position: absolute; inset: 0 3px; border-radius: 8px; background: rgba(26,47,92,.22); cursor: grab; transition: transform .45s cubic-bezier(.3,1.7,.5,1), background .2s, left .2s, right .2s; }
.cs-blob.moving { transition: transform .08s linear, background .2s; }
.cs-track:hover .cs-blob, .cs-track.drag .cs-blob { background: rgba(26,47,92,.42); left: 1.5px; right: 1.5px; }
.cs-track.drag .cs-blob { cursor: grabbing; }
/* ---------- scrollbar: native (so it never lags), drawn in the site's look ----------
   Chrome ignores ::-webkit-scrollbar when scrollbar-width/color are set, so those stay Firefox only. */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { min-height: 48px; border: 4px solid transparent; border-radius: 10px; background-clip: padding-box; background-color: rgba(26,47,92,.22); }
::-webkit-scrollbar-thumb:hover { border-width: 3px; background-color: rgba(26,47,92,.4); }
::-webkit-scrollbar-thumb:active { border-width: 3px; background-color: rgba(26,47,92,.58); }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: rgba(26,47,92,.3) transparent; } }

/* ---------- language switch ---------- */
.side .frow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.side .frow .out { margin-top: 0; }
.lang { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink-700); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: color .15s, border-color .15s; }
.lang:hover { color: var(--brand); border-color: var(--brand-4); }
.auth .box .lang.top { position: absolute; top: 18px; inset-inline-end: 18px; }
/* English runs left to right: the few physical directions get mirrored */
[dir=ltr] .mlist .li.click:hover .tx { transform: translateX(4px); }
[dir=ltr] .kpi small, [dir=ltr] .lg .nm { white-space: normal; }

/* ---------- phone top bar and drawer (hidden on wide screens) ---------- */
.mbar, .mshade, .fogs { display: none; }
.cin { position: relative; }

/* ---------- narrow screens: portrait monitors, small laptops, tablets ----------
   Charts stack, numbers go 2 then 3 per row, the cases bar is always shown. */
@media (max-width: 1280px) {
  .charts, .dash2, .two { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .charts { margin-top: 28px; }
  .dash2 { margin-top: 28px; }
  .dash { min-height: 0; padding-bottom: 28px; }
  .donut .ring { width: clamp(200px, 32vw, 330px); }
  .sring { width: clamp(170px, 24vw, 230px); }
  .kpis:not(.n4) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis:not(.n4) > * { grid-column: span 2; }
  .kpis:not(.n4) > :nth-child(-n+2) { grid-column: span 3; }
  .kpi.cases .more { position: static; opacity: 1; transform: none; padding: 0; margin-top: 12px; pointer-events: auto; }
  .kpi.cases:hover::before { bottom: 2px; }
  .kpi.cases .hint { display: none; }
  .tbl th, .tbl td.m { white-space: normal; }
}

/* ---------- touch width: the side menu becomes a drawer behind a top bar ---------- */
@media (max-width: 1024px) {
  html.noscroll, html.noscroll body { overflow: hidden; }

  /* shell: top bar, the side menu slides in from the start edge */
  .shell { display: block; }
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15; height: 60px; padding: 0 12px; background: var(--bg); }
  .mbar::after { content: ''; position: absolute; inset-inline: 0; top: 100%; height: 18px; background: linear-gradient(to bottom, var(--bg), rgba(233,237,242,0)); pointer-events: none; }
  .mbtn { width: 42px; height: 42px; border: 0; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; cursor: pointer; }
  .mbtn svg { width: 22px; height: 22px; }
  /* Only the logo mark (vector, img/mark.svg) in the far corner */
  .mlogo { display: block; height: 36px; width: auto; margin-inline-start: auto; margin-inline-end: 4px; flex: none; }
  /* Closed drawer is clipped in place, never moved off screen: iPhone Safari counted the
     off screen box as page width in rtl, so the page slid sideways and scrolling broke. */
  html { overflow-x: hidden; }   /* only html: hidden on body too would make body the scroller */
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  .side { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 30; width: min(300px, 84vw); height: 100%; overflow-x: hidden; overscroll-behavior: contain;
    visibility: hidden; pointer-events: none; clip-path: inset(0 0 0 100%); transition: clip-path .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
  [dir=ltr] .side { clip-path: inset(0 100% 0 0); }
  .shell.mopen .side, [dir=ltr] .shell.mopen .side { visibility: visible; pointer-events: auto; clip-path: inset(0); transition: clip-path .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  /* 16px stops iPhone from zooming in when a field is tapped */
  .inp, .search { font-size: 16px; }
  .mshade { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(233,237,242,.75); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .shell.mopen .mshade { opacity: 1; pointer-events: auto; }
  .side a { min-height: 46px; }

  main { padding: 16px 28px 70px; }
  /* No bottom cloud on phones and tablets (Jawad 12-03) */
  .fogb, .fogb.on, .fogblur, .fogblur.on, .fogs, .fogs.on { display: none; }
  /* No sharp system tap box anywhere; each control draws its own soft feedback */
  * { -webkit-tap-highlight-color: transparent; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  main { padding: 12px 16px 70px; }
  .head { gap: 12px; margin-bottom: 18px; }
  .head h1 { font-size: 24px; }
  .head .sub { margin-top: 4px; font-size: 13px; }

  /* filters stack, full width */
  .filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin: -4px 0 20px; }
  .filters .dd { min-width: 0; }
  .ddm { max-height: 50vh; }

  /* numbers: two per row, the first one (cases) takes the whole row */
  .kpis, .kpis.n4, .kpis:not(.n4) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis:not(.n4) > *, .kpis:not(.n4) > :nth-child(-n+2) { grid-column: auto; }
  .kpis:not(.n4) > :first-child { grid-column: 1 / -1; }
  .kpi { padding: 20px 18px 18px; }
  .kpi small { font-size: 14px; white-space: normal; line-height: 1.4; }
  .kpi > b { font-size: 34px; padding-top: 4px; }
  .kpi.go:hover { transform: none; }
  /* no hover on phones: the finished vs ongoing bar is always shown */
  .kpi.cases .more { position: static; opacity: 1; transform: none; padding: 0; margin-top: 12px; pointer-events: auto; }
  .kpi.cases:hover::before { bottom: 2px; }
  .kpi.cases .hint { display: none; }

  /* charts one under the other */
  .charts, .dash2, .two { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
  .charts > *, .dash2 > *, .two > * { min-width: 0; }
  .chart { padding: 22px 18px 20px; }
  .chart h2, .card h2 { font-size: 17px; }
  .donut { grid-template-columns: 1fr 1fr; gap: 18px 12px; margin-top: 10px; }
  .donut .ring { grid-column: 1 / -1; order: -1; width: 250px; height: 250px; margin: 6px auto 0; }
  .donut .mid b { font-size: 44px; }
  .lg { align-self: start; padding-block: 0; gap: 12px; justify-content: flex-start; }
  .lg .nm { font-size: 14px; }
  .lg b { font-size: 22px; }
  .plot { height: 220px; margin-top: 36px; }

  /* service dashboard */
  .dash { min-height: 0; padding-bottom: 14px; }
  .sring { width: 200px; height: 200px; }
  .sring .mid b { font-size: 40px; }
  .slg { flex-wrap: wrap; }
  .slg b { font-size: 22px; }
  /* months scroll sideways, each column keeps a readable width */
  .cwrap { overflow-x: auto; margin-inline: -18px; padding-inline: 18px; scrollbar-width: none; }
  .cwrap::-webkit-scrollbar { display: none; }
  .cin { min-width: calc(var(--n, 12) * 46px); }
  .cols { height: 180px; gap: 8px; }
  .mo { gap: 8px; }
  .mo span { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

  /* lists: each row becomes a small card, column name on the start side */
  .card { padding: 20px 16px; }
  .sect { margin-top: 18px; }
  .card .ch { gap: 10px; margin-bottom: 8px; }
  .card .ch .hact { width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px; }
  .card .hact .dd { min-width: 0; }
  .card .hact .seg3 { overflow-x: auto; grid-auto-columns: auto; }
  .search { width: 100%; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr.row { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; text-align: end; }
  .tbl td::before { content: attr(data-l); color: var(--ink-500); font-size: 13px; font-weight: 400; text-align: start; flex: none; }
  .tbl td:empty { display: none; }
  .tbl td.t { display: block; font-size: 15px; text-align: start; padding-bottom: 6px; }
  .tbl td.t::before { content: none; }
  .tbl td.m { white-space: normal; }
  .tbl td.mw { width: 100%; }
  .tbl tr.row:hover td { background: none; }
  /* Tap feedback: soft rounded tint, fades out after the finger lifts */
  .tbl tr.row { margin-inline: -8px; width: calc(100% + 16px); padding-inline: 12px; border-radius: var(--r); transition: background-color .25s ease; }
  .tbl tr.row:active { background: var(--brand-bg); transition-duration: 0s; }

  /* Client page tabs: rounded soft tab like the side menu, no hard underline */
  .tabs { gap: 4px; border-bottom: 0; margin: -4px -16px 18px; padding: 4px 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { height: 40px; padding: 0 14px; border: 0; margin: 0; border-radius: 10px; transition: color .15s, background-color .25s ease; }
  .tabs a.on { background: #fff; color: var(--brand); }
  .tabs a:active { background: #dbe2ec; transition-duration: 0s; }

  /* panes rise from the bottom as a sheet */
  .veil { padding: 40px 0 0; }
  .pane, .pane.wide { width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; padding: 24px 18px 30px; transform: translateY(24px); }
  .pane h2 { font-size: 19px; margin-bottom: 18px; }
  .pane .x { top: 18px; inset-inline-end: 14px; }
  .dl { grid-template-columns: 1fr 1fr; gap: 16px 14px; }
  .dl .hl { margin: -8px -10px; padding: 8px 10px; }
  .pane.doc { width: 100%; height: calc(100vh - 40px); border-radius: 22px 22px 0 0; }
  .doc .dbar { padding: 12px 14px; gap: 6px; }
  .doc .dbar .dl-t, .doc .zoom { display: none; }
  .doc .pages { padding: 12px; }
  .mlist { max-height: 65vh; }

  /* case stages run top to bottom */
  .steps { grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
  .steps::before { top: 16px; bottom: 16px; inset-inline-start: 15px; inset-inline-end: auto; width: 3px; height: auto; }
  .steps .prg { display: none; }
  .st7 { display: grid; grid-template-columns: 33px 1fr; column-gap: 14px; align-items: center; text-align: start; padding: 0; }
  .st7 .dot { margin: 0; grid-row: span 2; }
  .st7 b { margin-top: 0; }
  .st7 small { grid-column: 2; margin-top: 0; }
  .count30 { flex-wrap: wrap; gap: 4px 16px; padding: 14px 16px; }
  .count30 strong { font-size: 24px; }

  /* sign in */
  .auth { padding: 16px; grid-template-columns: minmax(0, 1fr); }
  .auth .box { width: 100%; padding: 56px 22px 28px; }
  .auth .logo { width: 130px; margin-bottom: 22px; }

  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ======================= Nasaqak additions ======================= */

/* brand: mark + name, used in the side menu, phone bar and sign in */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; display: block; flex: none; }
.brand b { font-size: 24px; font-weight: 800; color: var(--brand); line-height: 1; }
.side .logo { padding: 0 10px 20px; }
.side .logo .brand img { width: 36px; height: 36px; }
.alogo { display: flex; justify-content: center; margin-bottom: 28px; }
.alogo .brand img { width: 44px; height: 44px; }
.alogo .brand b { font-size: 30px; }
.mlogo { display: block; margin-inline-start: auto; }
.mlogo .brand img { width: 30px; height: 30px; }
.mlogo .brand b { font-size: 20px; }

/* side menu counts (unread chats) */
.side a span { flex: 1; }
.side .cnt { display: none; font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #b8453c; color: #fff; font-size: 12px; font-weight: 700; place-items: center; }
.side .cnt.on { display: grid; }
.lnk { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--brand-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lnk:hover { color: var(--brand); }
.side .foot .lnk { margin-top: 4px; }

/* bell */
.bell { position: relative; width: 42px; height: 42px; border: 0; border-radius: var(--r); background: #fff; color: var(--ink-700); display: grid; place-items: center; cursor: pointer; flex: none; transition: color .15s; }
.bell:hover { color: var(--brand); }
.bell svg { width: 20px; height: 20px; }
.bell .bdg { display: none; position: absolute; top: -5px; inset-inline-end: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #b8453c; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.bell.has .bdg { display: block; }
.mbar .bell { margin-inline-start: 8px; }
.pane.bellp { width: 520px; }
.bl .li.unread .tx b { color: var(--brand); }
.bl .li.unread { background: var(--brand-bg); }
.li .tx b.wrap { white-space: normal; font-weight: 500; }
.bl .li.unread .tx b.wrap { font-weight: 700; }

/* stars */
.stars { display: inline-flex; gap: 2px; direction: ltr; vertical-align: middle; }
.stars svg { width: 17px; height: 17px; fill: var(--line-2); stroke: none; }
.stars svg.on { fill: #c9962b; }
.stars.edit button { border: 0; background: none; padding: 2px; cursor: pointer; display: grid; transition: transform .15s; }
.stars.edit button:hover { transform: scale(1.15); }
.stars.edit svg { width: 28px; height: 28px; }
.rate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: #f6f0e4; margin-bottom: 18px; }
.rate b { color: #4a3b22; }
.pane .desc { margin-bottom: 6px; color: var(--ink-700); white-space: pre-wrap; }

/* works list: cover + title */
.wcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wcell img, .wcell .fi { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--hover); }
.tbl tr.dim td { color: var(--ink-400); }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.th { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #f1ede4; cursor: pointer; }
.th img, .th video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.th:hover img, .th:hover video { transform: scale(1.04); }
.th .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.th .play svg { width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: rgba(20,32,46,.6); fill: #fff; stroke: none; }
.th .thops { position: absolute; top: 8px; inset-inline-start: 8px; opacity: 0; transition: opacity .15s; }
.th:hover .thops { opacity: 1; }
.th .thops .sb { height: 30px; padding: 0 10px; font-size: 13px; }
.doc .pages video { width: 100%; max-height: calc(100vh - 170px); background: #000; border-radius: 6px; flex: none; }
.doc .pages audio { width: min(520px, 100%); margin: auto; }
.doc .pages .empty .btn { margin-top: 16px; }

/* file picker */
.fpick .flist { margin-top: 6px; }
.fpick .flist .li { padding: 8px 0; }
.prog { display: none; height: 6px; border-radius: 3px; background: var(--brand-bg); overflow: hidden; margin-top: 10px; }
.prog.on { display: block; }
.prog i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s linear; }

/* notes on a work */
.notes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.noteform { display: grid; gap: 10px; margin-top: 14px; }
.noteform .btn { justify-self: end; }

/* chat bubbles (notes use them too) */
.msg { max-width: 78%; padding: 10px 14px 6px; border-radius: 16px; background: #f3f0e8; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--brand-bg); }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg em { display: block; font-style: normal; font-size: 12px; font-weight: 700; color: var(--brand-2); }
.msg small { display: block; font-size: 11px; color: var(--ink-400); margin-top: 2px; text-align: end; }
.thread { display: flex; flex-direction: column; height: min(70vh, 720px); }
.thead { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.thead b { font-size: 18px; }
.thead .back { margin: 0; text-decoration: none; display: none; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 16px 4px; overscroll-behavior: contain; }
.msgs .empty { margin: auto; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.composer textarea.inp { height: 46px; min-height: 46px; resize: none; overflow-y: auto; }
.composer .btn { width: 46px; height: 46px; padding: 0; flex: none; }
.chats { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.clist { padding: 14px 12px; max-height: calc(min(70vh, 720px) + 60px); overflow-y: auto; }
.clist .li { padding: 12px 10px; border-radius: var(--r); text-decoration: none; border-bottom: 0; }
.clist .li.on { background: var(--brand-bg); }
.clist .li:hover { background: var(--hover); }
.clist .li.on:hover { background: var(--brand-bg); }
.clist .ops { flex-direction: column; align-items: flex-end; gap: 4px; }
.clist .when { color: var(--ink-400); font-size: 12px; white-space: nowrap; }
.ubdg { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #b8453c; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.chatcard.none { min-height: 300px; display: grid; place-items: center; }

/* announcements and attachments */
.anns { display: flex; flex-direction: column; gap: 16px; margin-bottom: 26px; }
.card.ann .txt, .card.att .txt { white-space: pre-wrap; color: var(--ink-700); }
.stitle { font-size: 20px; font-weight: 700; margin: 34px 0 16px; }
.head + .stitle { margin-top: 0; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; max-height: 260px; overflow-y: auto; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.pickbox { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); }
.pickbox.off { display: none; }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: var(--ink-500); }

/* credentials after creating a school */
.cred { margin: 6px 0; }
.cred .secret { display: block; margin: 4px 0 0; font-size: 18px; }
.acts.wrapb { flex-wrap: wrap; }

@media (max-width: 1024px) {
  .head .hact > .bell { display: none; }   /* the phone bar has the bell */
  .chats { grid-template-columns: minmax(0, 1fr); }
  .chats.open .clist { display: none; }
  .chats:not(.open) .chatcard.none { display: none; }
  .thead .back { display: inline; }
}
@media (max-width: 760px) {
  .checks { grid-template-columns: 1fr; }
  .gal { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .th .thops { opacity: 1; }
  .thread { height: calc(100vh - 210px); }
  .msg { max-width: 88%; }
  .tbl td .wcell { justify-content: flex-start; }
  .tbl td.t .wcell img, .tbl td.t .wcell .fi { width: 38px; height: 38px; }
  .pane.bellp { width: 100%; }
}

/* admin dashboard: six numbers (reports added 12-06) */
.kpis.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.li .ops .when { color: var(--ink-400); font-size: 12px; white-space: nowrap; }
@media (max-width: 1280px) {
  .kpis.n6 > *, .kpis.n6 > :nth-child(-n+2) { grid-column: span 2; }
}
@media (max-width: 760px) {
  .kpis.n6 > *, .kpis.n6 > :nth-child(-n+2) { grid-column: auto; }
  .kpis.n6 > :first-child { grid-column: auto; }
}

/* executive summary: latest works and reports side by side */
.two.latest { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 40px; }
.two.latest .card .li img.fi { object-fit: cover; padding: 0; }
@media (max-width: 1280px) { .two.latest { grid-template-columns: minmax(0, 1fr); margin-top: 20px; } }

/* delete on my own chat messages (12-06) */
.msg { position: relative; }
.msg .mfoot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.msg .mfoot small { margin-top: 0; }
.msg .mdel { border: 0; background: none; padding: 0; font: inherit; font-size: 11px; font-weight: 700; color: var(--ink-400); cursor: pointer; white-space: nowrap; }
.msg .mdel:hover { color: var(--err); }

/* school page: room between the numbers, the chart and the list */
.gapt { margin-top: 28px; }
@media (max-width: 760px) { .gapt { margin-top: 14px; } }
.kpi > b.txt { font-size: clamp(22px, 1.7vw, 28px); line-height: 1.3; }

/* school page tabs: no stray scrollbar on desktop; filter on the right, the add button on the left */
.tabs { overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabtools { justify-content: flex-start; }
.tabtools > .btn.pri { margin-inline-start: auto; }
.tabrow { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line-2); margin: -6px 0 28px; }
.tabrow .tabs { flex: 1; min-width: 0; border-bottom: 0; margin: 0 0 -1px; align-self: stretch; }
.tabrow .tabtools { margin: 0; flex: none; padding: 4px 0; }
@media (max-width: 760px) {
  .tabrow { flex-direction: column; align-items: stretch; gap: 10px; border-bottom: 0; margin: -4px 0 18px; }
  .tabrow .tabs { margin: 0 -16px; }
}
.clist .csearch { padding: 4px 4px 10px; }
.clist .csearch .inp { width: 100%; }

/* three numbers (school home) */
.kpis.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.n3 > *, .kpis.n3 > :nth-child(-n+2) { grid-column: auto; }
@media (max-width: 760px) {
  .kpis.n3 { grid-template-columns: 1fr 1fr; }
  .kpis.n3 > :first-child { grid-column: 1 / -1; }
}

/* phone bar: logo beside the menu button, the bell alone on the other side */
.mbar .mlogo { margin-inline-start: 0; margin-inline-end: 0; }
.mbar .bell { margin-inline-start: auto; }

/* summary: the Retwa donut, bigger since it has the full width */
.chart.wide .cbody { padding-top: 10px; }
.chart.wide .donut .ring { width: clamp(240px, 24vw, 400px); }
.chart.wide .lg { gap: 14px; justify-content: center; }

/* works list: search beside the title, then one filter bar */
.card .ch .search { width: min(340px, 100%); }
.lbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.lbar .seg3 { height: 44px; padding: 3px; }
.lbar .seg3 button { height: 36px; }
.lbar .dfld { display: flex; align-items: center; gap: 8px; height: 44px; padding-inline-start: 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; }
.lbar .dfld small { color: var(--ink-500); font-size: 13px; white-space: nowrap; }
.lbar .dfld .inp { border: 0; height: 40px; padding: 0 10px 0 6px; background: none; width: 150px; }
.lbar .dfld .dd { min-width: 190px; }
.lbar .dfld .ddb { border: 0; height: 40px; background: none; }
.lbar .lnk { margin-inline-start: auto; }
.lbar .lnk[hidden] { display: none; }
@media (max-width: 760px) {
  .lbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 12px; }
  .lbar .seg3, .lbar .dfld:nth-of-type(3), .lbar .lnk { grid-column: 1 / -1; }
  .lbar .dfld .inp { width: 100%; min-width: 0; }
  .lbar .dfld .dd { min-width: 0; flex: 1; }
}

/* line between the works and reports lists on the school home */
.sdiv { border: 0; border-top: 1px solid var(--line-2); margin: 36px 0; }
@media (max-width: 760px) { .sdiv { margin: 20px 0; } }
