/* ---------- Shared bits ---------- */
.nico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.nico.accent { background: var(--accent); color: #fff; }
.nico.ok { background: var(--ok-soft); color: var(--ok); }
.nico.warn { background: var(--warn-soft); color: var(--warn); }
.nico.bad { background: var(--bad-soft); color: var(--bad); }
.nico.gold { background: var(--gold-soft); color: var(--gold); }
.section-t { font-family: var(--f-display); font-size: 18px; font-weight: 600; margin-top: 4px; }
.row-changed td { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.row-flag td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-pop); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }

/* ---------- Dashboard ---------- */
.hero { display: flex; flex-direction: column; gap: 22px; }
.hero-title { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1.3; }
.hero-when { text-align: end; display: flex; flex-direction: column; }
.hero-when b { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hero-stats > div { background: rgba(255,255,255,.07); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; }
:root[data-theme="dark"] .hero-stats > div { background: rgba(0,0,0,.06); }
.hero-stats b { font-size: 30px; line-height: 1.2; }
.hero-stats span { font-size: 13px; opacity: .7; }
.hero-btn { background: var(--on-ink); color: var(--ink); }
.hero-btn:hover { opacity: .9; }
.hero-btn-soft { background: rgba(255,255,255,.12); color: var(--on-ink); }
.hero-btn-soft:hover { background: rgba(255,255,255,.2); }
:root[data-theme="dark"] .hero-btn-soft { background: rgba(0,0,0,.1); }
.hero-others { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.hero-other { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(255,255,255,.07); font-size: 13.5px; }
.hero-other:hover { background: rgba(255,255,255,.14); }
.hero-other .muted { color: inherit; opacity: .6; }
.stats.tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.tiles4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: var(--r-md); text-align: start; position: relative; }
.tl-row:hover { background: var(--surface-2); }
.tl-time { width: 64px; font-size: 13px; color: var(--muted); flex: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; }

/* ---------- Groups ---------- */
.group-card { display: flex; flex-direction: column; gap: 18px; }
.gc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gc-stats > div { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; }
.gc-stats b { font-family: var(--f-display); font-size: 24px; }
.gc-stats span { font-size: 12.5px; color: var(--muted); }
.surah-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sm-col { background: var(--surface-2); border-radius: var(--r-lg); padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sm-head { display: flex; flex-direction: column; border-bottom: 1px dashed var(--line-2); padding-bottom: 6px; }
.sm-head b { font-size: 14px; }
.sm-body { display: flex; flex-direction: column; gap: 6px; }
.sm-chip { display: flex; align-items: center; gap: 6px; padding: 3px; border-radius: var(--r-pill); background: var(--surface); font-size: 12px; text-align: start; min-width: 0; }
.sm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-chip .avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.sm-chip svg { color: var(--gold); margin-inline-start: auto; }
.sm-chip:hover { outline: 1.5px solid var(--accent); }
.task-row { display: flex; align-items: center; gap: 14px; padding: 6px 8px; border-radius: var(--r-md); width: 100%; text-align: start; }
.task-row:hover { background: var(--surface-2); }
.tr-label { width: 150px; font-size: 14px; flex: none; }
.tr-val { width: 52px; text-align: end; flex: none; }
.att-cell { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--muted); }
.att-cell.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.att-cell[data-s="present"] { background: var(--ok-soft); color: var(--ok); }
.att-cell[data-s="late"] { background: var(--warn-soft); color: var(--warn); }
.att-cell[data-s="absent"] { background: var(--bad-soft); color: var(--bad); }
.att-cell[data-s="excused"] { background: var(--info-soft); color: var(--info); }
button.att-cell:hover { outline: 2px solid var(--ink-2); }
.att-matrix td { height: 50px; }
.att-dots { display: flex; gap: 4px; }
.att-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--line-2); }
.att-dot[data-s="present"] { background: var(--ok); }
.att-dot[data-s="late"] { background: var(--warn); }
.att-dot[data-s="absent"] { background: var(--bad); }
.att-dot[data-s="excused"] { background: var(--info); }

/* ---------- Student profile ---------- */
.profile-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.profile-head > .person { flex: 1; min-width: 320px; }
.ph-name { font-family: var(--f-display); font-size: 28px; font-weight: 600; line-height: 1.3; }
.ph-pos { display: flex; flex-direction: column; gap: 6px; padding-inline: 24px; border-inline-start: 1px solid var(--line); }
.ph-pos b { font-size: 19px; }
.sevenths { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.seven { border-radius: var(--r-lg); padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; min-height: 140px; position: relative; }
.seven b { font-size: 14px; }
.seven-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px; font-weight: 600; }
.seven[data-state="approved"] { background: var(--gold-soft); }
.seven[data-state="approved"] .seven-n { background: var(--gold); color: var(--on-ink); }
.seven[data-state="current"], .seven[data-state="display"] { background: var(--ink); color: var(--on-ink); }
.seven[data-state="current"] .muted, .seven[data-state="display"] .muted { color: inherit; opacity: .65; }
.seven[data-state="current"] .seven-n { background: var(--accent); color: #fff; }
.seven[data-state="locked"] { opacity: .6; }

/* ---------- Attendance ---------- */
.att-summary { padding: 16px 18px; }
.att-count { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 8px 12px; border-radius: var(--r-lg); background: var(--surface-2); }
.att-count b { font-size: 22px; font-family: var(--f-display); }
.att-count span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.att-count[data-s="present"] b { color: var(--ok); } .att-count[data-s="late"] b { color: var(--warn); }
.att-count[data-s="absent"] b { color: var(--bad); } .att-count[data-s="excused"] b { color: var(--info); }
.att-count[data-s="pending"] b { color: var(--warn); }
.att-table td { height: 64px; }

/* ---------- Schedule ---------- */
.sched-label { font-family: var(--f-display); font-size: 16px; min-width: 200px; text-align: center; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 420px; }
.wk-day { border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.wk-day:first-child { border-inline-start: 0; }
.wk-day.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.wk-head { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; text-align: start; }
.wk-head span { font-size: 12px; color: var(--muted); }
.wk-head:hover b { text-decoration: underline; }
.wk-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.wk-ev { display: flex; flex-direction: column; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; border-inline-start: 3px solid var(--ink-2); }
.wk-ev.accent { border-color: var(--accent); background: var(--accent-soft); }
.wk-ev.gold { border-color: var(--gold); background: var(--gold-soft); }
.wk-ev:hover { filter: brightness(.97); }
.wk-more { font-size: 12.5px; color: var(--accent-ink); text-align: start; padding: 4px; }
.month { padding: 12px; }
.mo-names { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12.5px; color: var(--muted); padding: 4px 8px 8px; }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mo-cell { min-height: 104px; border-radius: var(--r-md); background: var(--surface-2); padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: start; min-width: 0; }
.mo-cell.out { opacity: .45; }
.mo-cell.today { outline: 2px solid var(--accent); }
.mo-cell:hover { background: var(--surface-3); }
.mo-num { font-weight: 600; }
.mo-ev { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--surface); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-ev.accent { background: var(--accent-soft); color: var(--accent-ink); }
.mo-ev.gold { background: var(--gold-soft); color: var(--gold); }

/* ---------- Recitation room ---------- */
.room { display: flex; flex-direction: column; gap: 16px; max-width: 1480px; margin: 0 auto; }
.room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.room-title { font-family: var(--f-display); font-size: 28px; font-weight: 700; }
.room-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; gap: 16px; height: calc(100vh - 250px); min-height: 500px; }
.room.q-min .room-grid { grid-template-columns: 76px minmax(0, 1fr) 340px; }
.room-queue, .room-center, .room-assess { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.q-label { font-size: 12px; color: var(--muted); margin-top: 8px; }
.q-list { display: flex; flex-direction: column; gap: 4px; }
.q-item { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); }
.q-item.on { background: var(--ink); color: var(--on-ink); }
.q-item.on .q-text span { color: inherit; opacity: .7; }
.q-item.dragging { opacity: .5; }
.q-item[draggable="true"] { cursor: grab; }
.q-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-align: start; padding: 4px; border-radius: 10px; }
.q-main:hover .q-text b { text-decoration: underline; }
.q-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.q-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-text span { font-size: 11.5px; color: var(--muted); }
.q-meta { display: flex; align-items: center; gap: 4px; flex: none; }
.q-kind { color: var(--gold); display: grid; }
.q-more { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.q-more:hover { background: var(--surface-3); }
.room.q-min .room-queue .q-text, .room.q-min .room-queue .q-meta, .room.q-min .room-queue .q-label, .room.q-min .room-queue h2, .room.q-min .room-queue .btn span, .room.q-min .room-queue .btn-ghost { display: none; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.conn[data-c="joined"] { background: var(--ok); }
.conn[data-c="dropped"], .conn[data-c="weak"] { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.conn[data-c="waiting"], .conn[data-c="never"] { background: transparent; border: 2px solid var(--muted); }
.identity { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); flex-wrap: wrap; animation: idflash .35s ease; }
@keyframes idflash { from { background: var(--gold-soft); } }
.id-name { font-family: var(--f-display); font-size: 24px; font-weight: 600; line-height: 1.25; }
.id-pos { display: flex; flex-direction: column; margin-inline-start: auto; text-align: end; line-height: 1.3; }
.id-pos b { font-size: 18px; }
.id-pos span { font-size: 13px; color: var(--ink-2); }
.ctx { border-radius: var(--r-md); background: var(--surface-2); }
.ctx-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; font-size: 13px; text-align: start; color: var(--ink-2); }
.ctx-toggle span:not(.kbd) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 14px 12px; }
.mushaf { font-family: var(--f-quran); line-height: 2.25; text-align: justify; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); flex: 1; }
.mushaf.placeholder { font-family: var(--f-ui); }
.qw { font: inherit; color: var(--ink); padding: 0 2px; border-radius: 8px; position: relative; line-height: inherit; }
.qw:hover { background: var(--accent-soft); }
.qw:focus-visible { outline: 2px solid var(--accent); }
.qw.prior { background: color-mix(in srgb, var(--gold-soft) 85%, transparent); }
.qw.err { color: var(--bad); text-decoration: underline wavy var(--bad); text-underline-offset: 10px; background: var(--bad-soft); }
.qw sup { font-family: var(--f-display); font-size: 11px; color: #fff; background: var(--bad); border-radius: 8px; padding: 0 5px; margin-inline-start: 2px; vertical-align: super; }
.ayah-no { font: inherit; color: var(--accent); font-size: .8em; padding: 0 3px; border-radius: 8px; }
.ayah-no:hover { background: var(--accent-soft); }
.mushaf-note { display: flex; align-items: center; gap: 6px; }
.ayah-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 12px 12px; }
.ayah-btn { height: 46px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-weight: 600; position: relative; }
.ayah-btn:hover:not(:disabled) { border-color: var(--accent); }
.ayah-btn:disabled { opacity: .5; }
.ayah-btn.has { border-color: var(--bad); color: var(--bad); }
.enum { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-family: var(--f-display); margin-inline-start: 6px; padding: 0 5px; }
.obs-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.room-assess [data-action="rec-submit"], .room-assess > [data-action="queue-next"] { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -10px 16px 4px var(--surface); }
.timer { font-size: 36px; font-weight: 600; letter-spacing: .02em; }
.err-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 160px; overflow-y: auto; }
.err-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; background: var(--surface-2); }
.err-item .enum { margin: 0; }
.grades { display: flex; flex-direction: column; gap: 8px; }
.grade { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; text-align: start; }
.grade:hover:not(:disabled) { border-color: var(--line-2); }
.grade:disabled { opacity: .55; }
.grade[data-g="mutqin"][aria-checked="true"] { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.grade[data-g="yasira"][aria-checked="true"] { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.grade[data-g="iaada"][aria-checked="true"] { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* ---------- Approvals ---------- */
.ap-card { display: flex; flex-direction: column; gap: 8px; transition: transform .15s; }
.ap-card:hover { transform: translateY(-2px); }
.mini-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.mini-steps span { height: 8px; border-radius: 4px; background: var(--surface-3); }
.mini-steps span[data-state="done"] { background: var(--gold); }
.mini-steps span[data-state="current"] { background: var(--hatch-accent); }
.reps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.rep { aspect-ratio: 1; max-width: 120px; border-radius: 50%; border: 2px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); }
.rep b { font-size: 26px; color: var(--ink-2); }
.rep:not(:disabled):hover { border-color: var(--accent); }
.rep:disabled { opacity: .5; }
.rep.on { border: 0; background: var(--gold); color: var(--on-ink); opacity: 1; }
.rep.on b { color: var(--on-ink); }
.surah-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sg { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); }
.sg b { color: var(--ink); font-size: 14px; }
.sg.on { background: var(--gold-soft); color: var(--gold); }
.approved-seal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 0; color: var(--gold); }

/* ---------- Reports ---------- */
.report-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.report-head > .person { flex: 1; }
.report-kpis { display: grid; grid-template-columns: repeat(4, auto); gap: 32px; }
.report-kpis > div { display: flex; flex-direction: column; }
.report-kpis b { font-size: 22px; font-family: var(--f-display); }
.stack-bars { display: flex; align-items: flex-end; gap: 18px; height: 250px; padding-top: 10px; }
.sb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.sb-col { width: 100%; max-width: 70px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; gap: 3px; }
.inkseg { background: var(--ink); } .accseg { background: var(--accent); } .hatchseg { background: var(--hatch); border: 1px solid var(--line-2); }

/* ---------- Messages ---------- */
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 300px); min-height: 460px; }
.chat.with-ctx { grid-template-columns: 320px minmax(0, 1fr) 260px; }
.chat-list { overflow-y: auto; padding: 16px; }
.thread { padding-block: 10px !important; }
.thread.on { background: var(--surface-2); }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 3px; max-width: 70%; }
.msg.me { align-self: flex-start; }
.msg.them { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 18px; background: var(--surface-2); line-height: 1.6; }
.msg.me .bubble { background: var(--ink); color: var(--on-ink); border-start-start-radius: 6px; }
.msg.them .bubble { border-start-end-radius: 6px; }
.msg-ref { display: flex; align-items: center; gap: 4px; font-size: 11.5px; opacity: .75; margin-bottom: 4px; }
.chat-compose { padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.chat-ctx { overflow-y: auto; }

/* ---------- Supervisor ---------- */
.dir-card.is-new { box-shadow: inset -4px 0 0 var(--bad); }
.replies { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ---------- Meetings ---------- */
.meet-card { display: flex; flex-direction: column; transition: transform .15s; }
.meet-card:hover { transform: translateY(-2px); }
.wizard { display: flex; flex-direction: column; gap: 16px; }
.wizard-foot { display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
.wizard-foot .grow { flex: 1; }
.pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 440px; overflow-y: auto; padding: 2px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); cursor: pointer; min-width: 0; }
.pick:hover { border-color: var(--line-2); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: var(--surface); flex: none; }
.pick.on .pick-check { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.review-kv { font-size: 15px; }
.meet { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.stage { position: relative; min-height: 460px; border-radius: var(--r-xl); background: radial-gradient(120% 90% at 50% 30%, #1d3a44 0%, #121517 70%); color: #f1f3f4; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; overflow: hidden; }
.stage.idle { background: radial-gradient(120% 90% at 50% 30%, #3d4347 0%, #10242a 70%); }
.stage-top { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(255,255,255,.12); backdrop-filter: blur(8px); font-size: 13px; }
.stage-center { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.stage-center b { font-family: var(--f-display); font-size: 22px; }
.stage-center span { opacity: .75; font-size: 14px; }
.stage-ico { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.stage-controls { align-self: center; display: flex; gap: 10px; padding: 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.12); backdrop-filter: blur(10px); }
.ctl { height: 52px; min-width: 52px; padding: 0 16px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; font-size: 14px; }
.ctl:hover { background: rgba(255,255,255,.24); }
.ctl.off { background: var(--surface); color: #121614; }
.ctl.on { background: var(--accent); }
.ctl.end { background: var(--bad); }
.ctl.end:hover { filter: brightness(.9); }
.meet-side { display: flex; flex-direction: column; gap: 12px; max-height: 560px; }
.meet-side .tabs { width: 100%; }
.meet-side .tab { flex: 1; padding: 0 10px; font-size: 13.5px; justify-content: center; }
.meet-side-body { overflow-y: auto; flex: 1; }
.tiles-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.ptile { width: 120px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--r-lg); background: var(--surface); font-size: 13px; }
.ptile:hover { outline: 2px solid var(--line-2); }
.ptile.on { outline: 2px solid var(--accent); }
.ptile.me { background: var(--ink); color: var(--on-ink); }

/* ---------- Sync ---------- */
.sync-hero { padding: 22px 24px; }
.conflict { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r-lg); border: 1.5px solid var(--bad-soft); margin-bottom: 10px; }

/* ---------- Secondary viewport (1366 × 768) ---------- */
@media (max-width: 1400px) {
  .stats.tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat .s-val b { font-size: 28px; }
  .room-grid { grid-template-columns: 248px minmax(0, 1fr) 316px; gap: 12px; height: calc(100vh - 232px); }
  .surah-map { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm-col { min-height: 120px; }
  .sevenths { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meet { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero-title { font-size: 26px; }
  .page-head h1 { font-size: 32px; }
}
@media (max-width: 1180px) {
  .stats.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-12 > [class*="span-"] { grid-column: span 12; }
  .room-grid { grid-template-columns: 76px minmax(0, 1fr) 300px; }
  .room .room-queue .q-text, .room .room-queue .q-meta, .room .room-queue .q-label, .room .room-queue h2 { display: none; }
  .chat.with-ctx { grid-template-columns: 300px minmax(0, 1fr); }
  .chat-ctx { display: none; }
  .meet { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3, .stats.tiles, .stats.tiles4, .hero-stats, .gc-stats { grid-template-columns: 1fr 1fr; }
  .room-grid { grid-template-columns: 1fr; height: auto; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .pick-list { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, 140px); overflow-x: auto; }
}

/* ---------- Print (PDF export) ---------- */
@media print {
  .rail, .topbar, #livebar, .toasts, #layer, .toolbar, .page-actions, .tabs, .banner.proto { display: none !important; }
  .app { display: block; height: auto; }
  .view { overflow: visible; padding: 0; }
  .card, .stat { break-inside: avoid; border: 1px solid #ddd; }
  body { background: var(--surface); }
}

/* ---------- Review 1: session path, live strip, tracker, result preview, attendance ---------- */
.today-card { display: flex; flex-direction: column; gap: 18px; }
.path { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.path-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.path-step .ps-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); font-family: var(--f-display); font-weight: 600; flex: none; border: 1.5px solid var(--line-2); }
.path-step .ps-body { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.45; }
.path-step .ps-body b { font-size: 15px; }
.path-step .ps-body span { font-size: 13px; color: var(--muted); }
.path-step[data-state="done"] .ps-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.path-step[data-state="done"] .ps-body b { color: var(--ink-2); }
.path-step[data-state="current"] { background: var(--accent-soft); box-shadow: inset -3px 0 0 var(--accent); }
.path-step[data-state="current"] .ps-num { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.path-step[data-state="next"] { opacity: .75; }

.live-strip { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); flex-wrap: wrap; }
.live-strip .btn-soft { background: rgba(255,255,255,.12); color: inherit; }
.live-strip .btn-ghost { color: inherit; }
.live-strip .avatar-stack .avatar { border-color: var(--ink); }
.live-strip.off { background: var(--surface); color: var(--ink); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px rgba(210, 60, 50, .3); flex: none; animation: pulse 1.6s infinite; }
.live-dot.idle { background: var(--muted); box-shadow: none; animation: none; }

.track-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.track-bar.on { background: var(--accent-soft); border-color: transparent; }
.mushaf .basmala { text-align: center; margin-bottom: 6px; }
.mushaf.tracking .qw.t-ahead { color: var(--muted); }
.mushaf.tracking .qw.t-done { color: var(--ink); }
.mushaf.tracking .qw.t-now { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.mushaf.tracking .qw.t-now .lt-err { color: #fff; text-decoration: underline wavy #fff; }
.lt-err { color: var(--bad); text-decoration: underline wavy var(--bad); text-underline-offset: 8px; }
.qw.has-lt { background: transparent; }
.qw sup.auto { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.auto-list { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-md); border: 1.5px solid var(--bad-soft); background: color-mix(in srgb, var(--bad-soft) 45%, var(--surface)); }
.auto-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface); }
.ph-word { font-family: var(--f-quran); font-size: 20px; line-height: 1.5; }

.result-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--accent-soft); }
.result-head b { font-size: 17px; }
.phone { position: relative; margin: 4px auto; width: 236px; border-radius: 34px; border: 8px solid var(--ink); background: var(--bg); padding: 22px 10px 14px; box-shadow: var(--shadow-pop); }
.phone-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 64px; height: 8px; border-radius: 8px; background: var(--ink); }
.phone-screen { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ph-top { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-family: var(--f-display); color: var(--accent); }
.ph-card { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.ph-grade { align-self: flex-start; margin-top: 4px; padding: 3px 12px; border-radius: 999px; font-weight: 600; background: var(--surface-3); color: var(--ink); }
.ph-grade.mutqin { background: var(--accent); color: #fff; }
.ph-grade.iaada { background: var(--bad); color: #fff; }
.ph-err { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 4px; }
.ph-err .ph-word { font-size: 18px; }
.ph-next { background: var(--ink); color: var(--on-ink); }

.att-select { width: 320px; height: 44px; border-radius: 999px; }
.att-card { padding: 0; overflow: hidden; }
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.att-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.att-counts .att-count, .att-summary-grid .att-count { flex-direction: row; gap: 8px; min-width: 0; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.att-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.att-summary-grid .att-count { flex-direction: column; align-items: center; }
.att-count[data-s="present"] b { color: var(--accent); } .att-count[data-s="late"] b { color: var(--ink); } .att-count[data-s="absent"] b { color: var(--bad); } .att-count[data-s="expected"] b { color: var(--muted); }
.att-choice { display: inline-flex; gap: 6px; }
.att-choice button { height: 40px; min-width: 88px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 600; color: var(--ink-2); }
.att-choice button:hover { border-color: var(--ink-2); color: var(--ink); }
.att-choice button[data-v="present"][aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.att-choice button[data-v="late"][aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.att-choice button[data-v="absent"][aria-checked="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.att-choice.sm button { height: 34px; min-width: 64px; padding: 0 10px; font-size: 13px; }
.att-choice.big { display: grid; grid-template-columns: repeat(3, 1fr); }
.att-choice.big button { height: 52px; }
.row-unmarked td:first-child, .list-row.row-unmarked { box-shadow: inset -3px 0 0 var(--line-2); }
.att-table td { height: 62px; }
.savebar .btn-lg { height: 50px; }
.path-step[data-state="optional"] .ps-num { border-style: dashed; }
.path-step[data-state="optional"] .ps-body b { color: var(--ink-2); font-weight: 500; }

/* ---------- Review 2: home banner, KPIs, diagram, video-call room, templates ---------- */
.nav-item { height: 44px; }
.nav-item .ico-wrap { width: 34px; height: 34px; }
.rail-group { padding-top: 10px; }

.session-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 28px; padding: 26px 30px; border-radius: var(--r-xl); background: var(--ink); color: var(--on-ink); position: relative; overflow: hidden; }
.session-banner::before { content: ""; position: absolute; inset: auto -60px -120px auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(46,122,147,.55), transparent 65%); pointer-events: none; }
.session-banner > * { position: relative; }
.session-banner.idle { grid-template-columns: minmax(0, 1fr) auto; }
.sb-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; opacity: .8; }
.sb-title { font-family: var(--f-display); font-size: 32px; font-weight: 600; line-height: 1.3; margin-top: 6px; }
.sb-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; opacity: .75; margin-top: 6px; font-size: 14.5px; }
.sb-progress { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; }
.sb-progress span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); }
.sb-count { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 26px; border-radius: var(--r-lg); background: rgba(255,255,255,.08); min-width: 190px; }
.sb-count b { font-family: var(--f-display); font-size: 30px; line-height: 1.2; }
.sb-count span { font-size: 13px; opacity: .7; }
.sb-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 230px; }
.sb-cta { background: var(--accent); color: #fff; }
.sb-cta:hover { filter: brightness(1.08); }
.sb-ghost { color: var(--on-ink); background: rgba(255,255,255,.1); }
.sb-ghost:hover { background: rgba(255,255,255,.18); }
.sb-others { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; opacity: .75; margin-top: 4px; }
.sb-others a:hover { text-decoration: underline; }
:root[data-theme="dark"] .session-banner { background: #20262a; color: #f1f3f4; }
:root[data-theme="dark"] .sb-ghost { color: #f1f3f4; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--r-xl); background: var(--surface); transition: transform .15s; min-width: 0; }
.kpi:hover { transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.kpi-label { color: var(--muted); font-size: 13.5px; }
.kpi-val { display: flex; align-items: baseline; gap: 8px; }
.kpi-val b { font-family: var(--f-display); font-size: 32px; font-weight: 600; line-height: 1.1; }
.kpi-val span { color: var(--muted); font-size: 13px; }
.kpi-legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.kpi-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kpi-chips { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.spark { width: 100%; height: 34px; }

.seven-flow { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sf-node { flex: 1; min-width: 128px; display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1.5px solid transparent; }
.sf-node.has { background: var(--accent-soft); border-color: var(--accent); }
.sf-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px; font-weight: 600; }
.sf-node.has .sf-n { background: var(--accent); color: #fff; }
.sf-node b { font-size: 14px; }
.sf-count { font-size: 13px; margin-top: 4px; }
.sf-count b { font-size: 18px; font-family: var(--f-display); }
.sf-arrow { display: grid; place-items: center; color: var(--muted); flex: none; }

/* Remote room: video call + Quran + assessment */
.room-grid.remote { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 330px; }
.room-grid.remote .identity { display: none; }
.call-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.call-stage { position: relative; flex: 1; min-height: 300px; border-radius: var(--r-xl); overflow: hidden; background: #10242a; color: #f1f3f4; }
.call-stage.speaking { box-shadow: 0 0 0 3px var(--accent); }
.call-video, .call-video .face { position: absolute; inset: 0; width: 100%; height: 100%; }
.call-stage.speaking .face .mouth { animation: talk .5s ease-in-out infinite alternate; transform-origin: 160px 146px; }
@keyframes talk { to { transform: scaleY(1.8); } }
.call-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; opacity: .8; text-align: center; }
.call-top { position: absolute; top: 14px; inset-inline: 14px; display: flex; justify-content: space-between; gap: 8px; }
.call-name { position: absolute; bottom: 86px; inset-inline-start: 16px; display: flex; flex-direction: column; padding: 8px 14px; border-radius: 14px; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.call-name b { font-size: 16px; }
.call-name span { font-size: 12.5px; opacity: .8; }
.speak-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: #8cc3d6; font-size: 12px; }
.call-drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(20,23,25,.72); text-align: center; }
.call-drop svg { color: var(--bad); }
.self-view { position: absolute; top: 58px; inset-inline-end: 14px; width: 118px; height: 84px; border-radius: 14px; overflow: hidden; background: #1d3a44; border: 2px solid rgba(255,255,255,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; }
.self-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.call-stage .stage-controls { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
.call-stage .ctl { height: 46px; min-width: 46px; }
.call-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; flex: none; }
.ptile.sm { width: 74px; padding: 8px 4px; gap: 4px; position: relative; font-size: 11.5px; }
.ptile.sm .conn { position: absolute; top: 8px; inset-inline-end: 12px; border: 2px solid var(--surface); }
.ptile.sm.done { opacity: .6; }
.ptile.sm.add { justify-content: center; color: var(--muted); border: 1.5px dashed var(--line-2); background: transparent; }
.pt-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-done { position: absolute; top: 6px; inset-inline-start: 10px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }

.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tpl-chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); }
.tpl-chip:hover { background: var(--accent-soft); color: var(--accent-ink); }
.tpl-chip.more { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); }
.tpl-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

@media (max-width: 1400px) {
  .session-banner { grid-template-columns: minmax(0, 1fr) auto; }
  .session-banner .sb-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .sb-title { font-size: 28px; }
  .room-grid.remote { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; }
}
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .room-grid.remote { grid-template-columns: 1fr; height: auto; } }

.ctl { white-space: nowrap; }
.call-stage .stage-controls { max-width: calc(100% - 24px); }

/* ---------- Review 3: home (session card, KPIs, circles), charts ---------- */
.head-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.head-clock b { font-family: var(--f-display); font-size: 30px; font-weight: 600; letter-spacing: .02em; direction: ltr; }
.head-clock span { font-size: 12.5px; color: var(--muted); }

.next-card { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(250px, .8fr); grid-template-areas: "info count cta" "tl tl tl"; gap: 22px 30px; align-items: center; padding: 26px 28px 20px; border-radius: var(--r-xl); background: var(--surface); position: relative; overflow: hidden; border: 1px solid var(--line); }
.next-card::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 6px; background: var(--accent); }
.next-card.ink::after { background: var(--ink); } .next-card.lime::after { background: var(--lime); }
.next-card::before { content: ""; position: absolute; width: 380px; height: 380px; left: -140px; top: -200px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.next-card > * { position: relative; }
.nc-info { grid-area: info; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.nc-eyebrow { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.nc-title { font-family: var(--f-display); font-size: 34px; font-weight: 700; line-height: 1.2; display: flex; align-items: center; gap: 12px; }
.nc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none; }
.next-card.ink .nc-dot { background: var(--ink); } .next-card.lime .nc-dot { background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.nc-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 14.5px; }
.nc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.nc-people { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.nc-count { grid-area: count; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nc-count-label { font-size: 13px; color: var(--muted); }
.nc-digits { display: flex; align-items: flex-start; gap: 6px; direction: ltr; }
.nc-digits > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nc-digits b { display: grid; place-items: center; width: 70px; height: 74px; border-radius: 18px; background: var(--ink); color: var(--on-ink); font-family: var(--f-display); font-size: 36px; font-weight: 600; }
.nc-digits > div:last-child b { background: var(--accent); color: #fff; }
.nc-digits span { font-size: 11.5px; color: var(--muted); }
.nc-digits i { font-style: normal; font-size: 30px; font-weight: 700; color: var(--line-2); line-height: 74px; }
.nc-live-stats { display: flex; gap: 8px; font-size: 13px; }
.nc-live-stats span { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); }
.nc-cta { grid-area: cta; display: flex; flex-direction: column; gap: 10px; }
.nc-btn { height: 60px; font-size: 16.5px; background: var(--accent); color: #fff; border-radius: 18px; }
.nc-btn:hover { background: var(--accent-ink); }
.nc-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.nc-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.nc-links a:hover { color: var(--accent-ink); text-decoration: underline; }
.nc-timeline { grid-area: tl; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.tl-track { position: relative; height: 44px; margin-top: 14px; border-radius: 12px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100% / 9 - 1px), var(--line) calc(100% / 9 - 1px) calc(100% / 9)); }
.tl-block { position: absolute; top: 5px; bottom: 5px; border-radius: 10px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); overflow: hidden; white-space: nowrap; transform: translateX(50%); min-width: 96px; }
.tl-block.ink { background: var(--ink); color: var(--on-ink); } .tl-block.lime { background: var(--lime); color: var(--ink); }
.tl-block.is-next { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.tl-block.is-done { opacity: .45; }
.tl-now { position: absolute; top: -10px; bottom: -6px; width: 2px; background: var(--bad); }
.tl-now span { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 0 6px; border-radius: 6px; background: var(--bad); color: #fff; font-size: 11px; white-space: nowrap; }
.tl-ticks { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.tl-ticks span { position: absolute; transform: translateX(50%); }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.kpi2 { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; border-radius: var(--r-xl); background: var(--surface); min-height: 172px; transition: transform .15s; min-width: 0; }
.kpi2:hover { transform: translateY(-2px); }
.k-top { display: flex; align-items: center; gap: 10px; }
.k-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.k-label { flex: 1; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.k-go { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.k-val { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.k-val b { font-family: var(--f-display); font-size: 38px; font-weight: 600; line-height: 1; }
.k-val span { font-size: 13px; color: var(--muted); }
.kpi2.dark { background: var(--ink); color: var(--on-ink); }
.kpi2.dark .k-ico, .kpi2.dark .k-go { background: rgba(255,255,255,.12); color: inherit; }
.kpi2.dark .k-label, .kpi2.dark .k-val span, .kpi2.dark .k-legend { color: inherit; opacity: .8; }
.kpi2.brand { background: var(--accent); color: #fff; }
.kpi2.brand .k-ico, .kpi2.brand .k-go { background: rgba(255,255,255,.16); color: #fff; }
.kpi2.brand .k-label, .kpi2.brand .k-val span { color: #fff; opacity: .85; }
.kpi2.lime { background: var(--lime); color: var(--ink); }
.kpi2.lime .k-ico, .kpi2.lime .k-go { background: rgba(22,25,27,.08); color: var(--ink); }
.kpi2.lime .k-label, .kpi2.lime .k-val span, .kpi2.lime .k-legend { color: var(--ink); opacity: .8; }
.k-split { display: flex; gap: 4px; height: 12px; }
.k-split span { border-radius: 6px; background: var(--accent); }
.k-split .ink { background: var(--surface-2); } .k-split .lime { background: var(--lime); }
.k-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.k-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; }
.sw.ink { background: var(--ink); } .sw.lime { background: var(--lime); border: 1px solid #8d959a; } .sw.bad { background: var(--bad); }
.sw.dash { background: transparent; border-top: 2px dashed var(--ink); height: 0; border-radius: 0; width: 14px; }
.sw.lg { width: 14px; height: 14px; border-radius: 5px; }
.kpi2.dark .sw.ink { background: #f1f3f4; }
.chip-trend { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px !important; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink) !important; }
.chip-trend.down { background: var(--bad-soft); color: var(--bad) !important; }
.k-mini { display: flex; align-items: flex-end; gap: 6px; height: 46px; }
.k-mini span { flex: 1; border-radius: 6px; background: var(--hatch); border: 1px solid var(--line); }
.k-mini span.on { background: var(--accent); border-color: var(--accent); }
.k-striped { height: 22px; border-radius: 11px; background: rgba(22,25,27,.1); overflow: hidden; }
.k-striped span { display: block; height: 100%; border-radius: 11px; background: repeating-linear-gradient(135deg, #0e1f25 0 6px, #3d4347 6px 12px); }
.k-dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; }
.k-dots span { height: 22px; border-radius: 5px; background: var(--surface-3); }
.k-dots span.on { background: var(--ink); }
.k-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.k-list span { display: flex; align-items: center; gap: 8px; }
.k-list .avatar { border: 2px solid rgba(255,255,255,.6); }
.gauge { width: 100%; max-height: 92px; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.circles { display: flex; flex-direction: column; gap: var(--s4); }
.circle-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.circle-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--r-xl); background: var(--accent); color: #fff; box-shadow: 0 18px 32px -20px rgba(46,122,147,.8); transition: transform .15s; position: relative; overflow: hidden; }
.circle-card::after { content: ""; position: absolute; width: 220px; height: 220px; left: -70px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.08); }
.circle-card:hover { transform: translateY(-3px); }
.circle-card.ink { background: #0e1f25; color: #fff; box-shadow: 0 18px 32px -20px rgba(0,0,0,.8); }
.circle-card.lime { background: var(--lime); color: var(--ink); box-shadow: 0 18px 32px -20px rgba(177,235,81,.9); }
.cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc-top b { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.cc-more { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); }
.circle-card.lime .cc-more { background: rgba(22,25,27,.08); }
.cc-sub { font-size: 13px; opacity: .8; margin-top: -8px; }
.cc-prog { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cc-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cc-seg span { height: 7px; border-radius: 4px; background: rgba(255,255,255,.28); }
.cc-seg span.on { background: var(--surface); }
.circle-card.lime .cc-seg span { background: rgba(22,25,27,.15); } .circle-card.lime .cc-seg span.on { background: #0e1f25; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; }
.cc-foot .avatar { border-color: transparent; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.cc-next { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .9; }

.capsules { display: flex; align-items: flex-end; justify-content: space-around; gap: 16px; padding-top: 10px; }
.cap { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; flex: 1; }
.cap-track { width: 58px; border-radius: 999px; background: var(--hatch); border: 1px solid var(--line); display: flex; align-items: flex-end; overflow: hidden; }
.cap-fill { width: 100%; border-radius: 999px; background: var(--accent); display: flex; justify-content: center; padding-top: 8px; color: #fff; font-size: 12px; font-weight: 600; min-height: 26px; }
.cap-fill.ink { background: var(--ink); color: var(--on-ink); } .cap-fill.lime { background: var(--lime); color: var(--ink); }
.cap-lab { font-size: 12.5px; color: var(--muted); }

@media (max-width: 1400px) {
  .next-card { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info count" "cta cta" "tl tl"; }
  .nc-cta { flex-direction: row; align-items: center; } .nc-btn { flex: 1; max-width: 420px; }
  .nc-digits b { width: 60px; height: 64px; font-size: 30px; } .nc-digits i { line-height: 64px; }
  .nc-title { font-size: 30px; }
  .k-val b { font-size: 32px; }
}
@media (max-width: 1100px) { .kpi-grid, .circle-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Messages (MantaUI-style 3 panes) ---------- */
.messages-page { gap: 10px; }
.msg-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px; background: var(--surface); border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); }
.msg-wrap.with-info { grid-template-columns: 320px minmax(0, 1fr) 300px; }
.msg-list { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; border-inline-end: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.msg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.msg-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.msg-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg-sec { font-family: var(--f-display); font-size: 16px; font-weight: 600; margin-top: 6px; }
.th-list { display: flex; flex-direction: column; gap: 2px; }
.th-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.th-row:hover { background: var(--surface-2); }
.th-row.on { background: var(--accent-soft); }
.th-unread-dot { position: absolute; right: 2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.th-av { position: relative; flex: none; }
.th-av .online { position: absolute; bottom: 1px; left: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.th-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.circle-av { background: var(--accent) !important; color: #fff; }
.circle-av.ink { background: #0e1f25 !important; } .circle-av.lime { background: var(--lime) !important; color: var(--ink); }
.msg-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat2-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat2-head .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.chat2-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg2 { display: flex; align-items: flex-start; gap: 10px; max-width: 74%; }
.msg2.me { align-self: flex-end; flex-direction: row-reverse; }
.msg2-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg2.me .msg2-body { align-items: flex-end; }
.msg2-meta { font-size: 12px; color: var(--muted); }
.msg2-meta b { color: var(--ink); font-weight: 600; }
.bubble2 { padding: 10px 14px; border-radius: 16px; background: var(--surface-2); line-height: 1.65; font-size: 14px; }
.msg2.them .bubble2 { border-start-start-radius: 4px; }
.msg2.me .bubble2 { background: var(--accent); color: #fff; border-start-end-radius: 4px; }
.msg2.me .bubble2 .msg-ref { color: #fff; opacity: .85; }
.bubble2.is-voice { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.voice { display: flex; align-items: center; gap: 10px; }
.voice-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); flex: none; }
.wave { display: flex; align-items: center; gap: 2px; flex: 1; }
.wave i { width: 3px; border-radius: 2px; background: var(--ink-2); }
.reacts { display: flex; gap: 4px; }
.reacts span { padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; }
.react-pick { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.msg2:hover .react-pick, .msg2:focus-within .react-pick { opacity: 1; }
.react-pick button { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--surface-2); color: var(--ink-2); }
.react-pick button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.chat2-compose { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.tpl-row { display: flex; gap: 6px; overflow-x: auto; }
.tpl-row .tpl-chip { white-space: nowrap; }
.compose-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px; border: 1.5px solid var(--line); }
.compose-box:focus-within { border-color: var(--accent); }
.compose-box textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; min-height: 40px; max-height: 120px; padding: 8px 6px; line-height: 1.6; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.on { background: var(--accent-soft); color: var(--accent-ink); }
.msg-info { border-inline-start: 1px solid var(--line); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.info-h { font-family: var(--f-display); font-size: 17px; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.info-person { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.info-person b { font-size: 16px; }
.info-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.info-actions a, .info-actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); padding: 8px 2px; border-radius: 12px; }
.info-actions a:hover, .info-actions button:hover { background: var(--surface-2); color: var(--ink); }
.info-actions svg { width: 38px; height: 38px; padding: 9px; border-radius: 50%; border: 1px solid var(--line); }
.info-sec { display: flex; flex-direction: column; gap: 8px; }
.info-sec a.xs { color: var(--accent-ink); }
.info-row { display: flex; align-items: center; gap: 10px; }
.info-members { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1400px) { .msg-wrap.with-info { grid-template-columns: 290px minmax(0, 1fr) 270px; } .msg-wrap { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 1180px) { .msg-wrap.with-info { grid-template-columns: 290px minmax(0, 1fr); } .msg-info { display: none; } }

.tpl-row { scrollbar-width: none; }
.tpl-row::-webkit-scrollbar { display: none; }
