/* =========================================================
   مكونات خاصة بكل صفحة (نفس الثيم، شكل مختلف حسب المحتوى)
   ========================================================= */

/* ---------- عام ---------- */
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-tabs button {
  font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 99px;
  border: var(--bw) solid var(--edge); background: var(--card); color: var(--ink); cursor: pointer; transition: transform .2s var(--ease), background .2s;
}
.pill-tabs button:hover { transform: translateY(-2px); }
.pill-tabs button .n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--soft); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.pill-tabs button.on { background: var(--ink); color: var(--card); }
.pill-tabs button.on .n { background: var(--lime); color: #111; }

.band { display: flex; align-items: stretch; padding: 0; overflow: hidden; }
.band .b-item { flex: 1; padding: 16px 20px; border-inline-start: 1px dashed var(--line); min-width: 0; }
.band .b-item:first-child { border-inline-start: 0; }
.band .b-item span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.band .b-item b { font-size: 24px; font-weight: 800; }
.band .b-item small { color: var(--muted); }

.view-seg button .ico { width: 16px; height: 16px; }
.stack { display: flex; }
.stack .av { margin-inline-start: -9px; border: 2px solid var(--card); }
.stack .av:first-child { margin-inline-start: 0; }
.stack .more-n { margin-inline-start: 6px; align-self: center; font-size: 12px; color: var(--muted); }
.ring { --p: 0; --c: var(--primary); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--soft) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.ring b { position: relative; font-size: 14px; font-weight: 800; }
.ring.lg { width: 92px; height: 92px; }
.ring.lg::before { inset: 10px; }
.ring.lg b { font-size: 20px; }

/* ---------- الأطفال ---------- */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kid { position: relative; background: var(--card); border: var(--bw) solid var(--edge); border-radius: var(--r-card); padding: 0; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; cursor: pointer; }
.kid:hover { transform: translateY(-3px); box-shadow: 4px 4px 0 var(--edge); }
.kid .top { height: 54px; background: var(--tone, var(--lime)); position: relative; }
.kid .top::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 120%, rgba(255,255,255,.5) 0 30px, transparent 31px), radial-gradient(circle at 85% -20%, rgba(255,255,255,.35) 0 26px, transparent 27px); }
.kid .av { --s: 64px; position: absolute; top: 20px; inset-inline-start: 16px; border: var(--bw) solid var(--edge); font-size: 22px; z-index: 1; }
.kid .bd { padding: 32px 16px 14px; }
.kid h4 { margin: 0; font-size: 16px; }
.kid .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kid .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.kid .bal { white-space: nowrap; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--edge); }
.kid .bal.due { background: var(--red-soft); color: #B23246; }
.kid .bal.ok { background: var(--lime-soft); color: #111; }
.kid .acts { display: flex; gap: 4px; }
.kid .acts button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: .2s; }
.kid .acts button:hover { border-color: var(--edge); color: var(--ink); transform: scale(1.1); }
.kid .acts button .ico { width: 14px; height: 14px; }
.kid .alg { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; background: var(--card); color: var(--red); border: 1px solid var(--edge); border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.kid .alg .ico { width: 12px; height: 12px; }
.tone-0 { --tone: var(--lime); } .tone-1 { --tone: var(--primary-2); } .tone-2 { --tone: var(--yellow); } .tone-3 { --tone: var(--pink); } .tone-4 { --tone: var(--sky); } .tone-5 { --tone: var(--teal); }

/* ---------- الصفوف ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.klass { padding: 0; overflow: hidden; }
.klass .head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--tone, var(--lime)); border-bottom: var(--bw) solid var(--edge); position: relative; }
.klass .head h3 { margin: 0; font-size: 20px; color: #111; }
.klass .head small { color: rgba(0,0,0,.6); }
.klass .head .ring { margin-inline-start: auto; --c: #111; }
.klass .head .ring::before { background: var(--tone, var(--lime)); }
.klass .head .ring b { color: #111; }
.klass .body { padding: 16px 20px; }
.klass .staff-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.klass .person { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--soft); font-size: 13px; }
.klass .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 12px 0 0; }
.klass .meta span { display: inline-flex; align-items: center; gap: 5px; }
.klass .meta .ico { width: 15px; height: 15px; color: var(--muted); }

/* ---------- الحضور ---------- */
.att-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.att-hero .counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.att-hero .cnt { border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; text-align: center; }
.att-hero .cnt b { display: block; font-size: 22px; font-weight: 800; }
.att-hero .cnt span { font-size: 12px; color: var(--muted); }
.att-hero .cnt.present { background: var(--lime-soft); border-color: #C9DD5C; }
.att-hero .cnt.late { background: var(--yellow-soft); border-color: #EBCB73; }
.att-hero .cnt.absent { background: var(--red-soft); border-color: #F2A5B1; }
.att-hero .cnt.excused { background: var(--sky-soft); border-color: #9CCBF2; }
.legend-keys { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend-keys i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid var(--edge); }

/* ---------- التقرير اليومي ---------- */
.notebook { display: grid; grid-template-columns: 1fr 130px; gap: 0; padding: 0; overflow: hidden; }
.notebook .lines { padding: 18px 22px; background-image: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px); background-position: 0 14px; }
.notebook textarea { width: 100%; border: 0; background: transparent; line-height: 32px; padding: 0; resize: vertical; min-height: 64px; font-size: 15px; box-shadow: none !important; }
.rep { padding: 0; overflow: hidden; }
.rep .rh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.rep .rh .done-dot { margin-inline-start: auto; }
.rep .rb { padding: 6px 16px 14px; }
.rep .rf { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--soft); }
.rep .rf { flex-wrap: wrap; }
.rep .rf input { flex: 1 1 100%; border-radius: 99px; }
.rep .rf .send2 { display: flex; gap: 8px; flex: 1 1 100%; }
.rep .rf .send2 .btn { flex: 1; justify-content: center; }
.rep.sent .rh { background: var(--lime-soft); }
.rep .fill { height: 4px; background: var(--soft); }
.rep .fill i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.emoji-chips .chip { font-size: 13px; }

/* ---------- الأقساط ---------- */
.fee-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.collect { display: flex; gap: 20px; align-items: center; }
.collect h3 { margin: 0 0 4px; }
.collect .nums { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.collect .nums div span { display: block; font-size: 12px; color: var(--muted); }
.collect .nums div b { font-size: 19px; font-weight: 800; }
.methods { display: flex; height: 18px; border-radius: 99px; overflow: hidden; border: var(--bw) solid var(--edge); margin: 12px 0 10px; }
.methods i { display: block; height: 100%; }
.methods-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.methods-legend span { display: inline-flex; align-items: center; gap: 6px; }
.methods-legend i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--edge); }
.debts { display: flex; flex-direction: column; gap: 10px; }
.debt { display: grid; grid-template-columns: auto minmax(140px, 1.2fr) minmax(160px, 1.5fr) auto auto; gap: 16px; align-items: center; padding: 12px 16px; margin: 0; }
.debt .who b { display: block; }
.debt .who small { color: var(--muted); }
.debt .pr small { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.debt .left { text-align: center; }
.debt .left b { display: block; color: var(--red); font-size: 17px; font-weight: 800; }
.debt .left small { color: var(--muted); font-size: 11px; }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-day { margin: 0 0 16px; }
.tl-day > .d { position: relative; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.tl-day > .d::before { content: ""; position: absolute; inset-inline-start: -22px; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); border: var(--bw) solid var(--edge); }
.tl-day > .d small { font-weight: 500; color: var(--muted); }
.pay-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pay-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: var(--bw) solid var(--edge); position: relative; }
.pay-item::after { content: ""; position: absolute; inset-inline-end: 64px; top: 8px; bottom: 8px; border-inline-start: 2px dashed var(--line); }
.pay-item .info { flex: 1; min-width: 0; }
.pay-item .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-item .info small { color: var(--muted); font-size: 12px; }
.pay-item .amt { font-weight: 800; font-size: 15px; white-space: nowrap; }
.pay-item .ops { display: flex; flex-direction: column; gap: 4px; padding-inline-start: 10px; }

/* ---------- المصاريف ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cat {
  font: inherit; text-align: start; cursor: pointer; padding: 14px; border-radius: var(--r-card); background: var(--card); border: var(--bw) solid var(--edge); color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; transition: transform .25s var(--ease), box-shadow .25s; position: relative; overflow: hidden;
}
.cat:hover { transform: translateY(-3px); box-shadow: 4px 4px 0 var(--edge); }
.cat span { font-size: 13px; color: var(--ink-2); }
.cat b { font-size: 17px; font-weight: 800; }
.cat .share { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); }
.cat.on { background: var(--lime); }
.cat.on .share { background: #111; color: var(--lime); }
.cat.empty-cat { opacity: .5; }
.months6 { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 10px 4px 0; }
.months6 .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.months6 .cap { width: 100%; max-width: 46px; border-radius: 99px; border: var(--bw) solid var(--edge); background: var(--pink-soft); min-height: 14px; position: relative; display: flex; align-items: flex-start; justify-content: center; animation: grow .7s var(--ease) both; transform-origin: bottom; }
.months6 .cap b { font-size: 10px; margin-top: 6px; white-space: nowrap; }
.months6 .m.cur .cap { background: repeating-linear-gradient(-45deg, var(--pink) 0 6px, #FF9DB4 6px 12px); }
.months6 small { font-size: 11px; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.exp-list { display: flex; flex-direction: column; gap: 8px; }
.exp { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.exp .info { flex: 1; }
.exp .info small { color: var(--muted); display: block; font-size: 12px; }
.exp .amt { font-weight: 800; }

/* ---------- الموظفين ---------- */
.idcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.idc { padding: 0; overflow: hidden; }
.idc .strip { height: 70px; background: var(--primary); position: relative; overflow: hidden; }
.idc .strip::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 10px, transparent 10px 20px); }
.idc .strip .role { position: absolute; top: 12px; inset-inline-end: 14px; background: var(--lime); color: #111; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid #111; }
.idc .strip .hole { position: absolute; top: 12px; inset-inline-start: 50%; transform: translateX(50%); width: 46px; height: 8px; border-radius: 99px; background: rgba(0,0,0,.25); }
.idc .av { --s: 70px; position: absolute; top: 34px; inset-inline-start: 18px; border: var(--bw) solid var(--edge); font-size: 24px; }
.idc .bd { padding: 42px 18px 16px; }
.idc h4 { margin: 0; font-size: 17px; }
.idc .phone { font-size: 12px; color: var(--muted); direction: ltr; text-align: end; }
.idc .sal { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 6px; }
.idc .sal b { font-size: 19px; font-weight: 800; }
.segbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; border: var(--bw) solid var(--edge); background: var(--soft); }
.segbar i { display: block; height: 100%; }
.seg-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; gap: 6px; }
.seg-legend b { color: var(--ink); }
.idc.left-job { opacity: .55; }
.idc.left-job .strip { background: var(--muted); }

/* ---------- الخطوط ---------- */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.ticket { padding: 0; overflow: visible; display: flex; flex-direction: column; }
.ticket .t-top { padding: 18px 20px; display: flex; align-items: center; gap: 14px; background: var(--tone, var(--lime)); border-radius: calc(var(--r-card) - 2px) calc(var(--r-card) - 2px) 0 0; }
.ticket .t-top h3 { margin: 0; color: #111; }
.ticket .t-top small { color: rgba(0,0,0,.6); }
.ticket .t-top .count { margin-inline-start: auto; text-align: center; color: #111; }
.ticket .t-top .count b { font-size: 28px; font-weight: 800; display: block; line-height: 1; }
.ticket .cut { position: relative; height: 0; border-top: 2px dashed var(--edge); margin: 0 18px; }
.ticket .cut::before, .ticket .cut::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); border: var(--bw) solid var(--edge); }
.ticket .cut::before { right: -31px; clip-path: inset(0 50% 0 0); }
.ticket .cut::after { left: -31px; clip-path: inset(0 0 0 50%); }
.ticket .times { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 16px 20px 6px; text-align: center; }
.ticket .times b { font-size: 24px; font-weight: 800; display: block; direction: ltr; }
.ticket .times small { color: var(--muted); font-size: 12px; }
.ticket .times .road { height: 2px; min-width: 50px; background: repeating-linear-gradient(90deg, var(--edge) 0 8px, transparent 8px 14px); position: relative; }
.ticket .times .road .ico { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--card); padding: 0 4px; width: 26px; }
.ticket .drv { display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.ticket .drv .info { flex: 1; }
.ticket .drv .info small { color: var(--muted); display: block; font-size: 12px; }
.stops { list-style: none; margin: 0; padding: 4px 20px 6px; max-height: 190px; overflow-y: auto; }
.stops li { position: relative; padding: 6px 22px 6px 0; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
[dir="ltr"] .stops li { padding: 6px 0 6px 22px; }
.stops li::before { content: ""; position: absolute; inset-inline-start: 0; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); }
.stops li::after { content: ""; position: absolute; inset-inline-start: 5px; top: 22px; bottom: -6px; width: 2px; background: var(--line); }
.stops li:last-child::after { display: none; }
.stops li small { color: var(--muted); }
.ticket .t-foot { margin-top: auto; padding: 12px 20px 16px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ---------- الإعلانات ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tpl { font: inherit; cursor: pointer; border-radius: var(--r-card); border: var(--bw) solid var(--edge); background: var(--card); padding: 14px; text-align: start; color: var(--ink); display: flex; flex-direction: column; gap: 8px; transition: transform .25s var(--ease), box-shadow .25s; }
.tpl:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 4px 4px 0 var(--edge); }
.tpl b { font-size: 15px; }
.tpl small { color: var(--muted); font-size: 12px; }
.tpl.blank { background: var(--ink); color: var(--card); }
.tpl.blank small { color: var(--frame-ink); }
.tpl.blank .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--lime); color: #111; display: grid; place-items: center; }
.chat { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .av { border: var(--bw) solid var(--edge); }
.bubble { position: relative; flex: 1; max-width: 760px; background: var(--card); border: var(--bw) solid var(--edge); border-radius: 4px 18px 18px 18px; padding: 14px 16px 10px; }
[dir="rtl"] .bubble { border-radius: 18px 4px 18px 18px; }
.bubble h4 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.bubble .pre { font-size: 14px; color: var(--ink-2); margin: 0; }
.bubble .bm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.bubble .bm .sentbar { flex: 1; min-width: 120px; }
.ticks { color: var(--sky); display: inline-flex; }
.ticks .ico { width: 16px; height: 16px; }
.ticks .ico + .ico { margin-inline-start: -10px; }

/* ---------- التقارير ---------- */
.pairs { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 16px 4px 0; }
.pairs .mo { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.pairs .two { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.pairs .cap { width: 42%; max-width: 20px; border-radius: 99px; border: var(--bw) solid var(--edge); min-height: 8px; animation: grow .7s var(--ease) both; transform-origin: bottom; }
.pairs .cap.in { background: var(--primary); }
.pairs .cap.out { background: var(--yellow); }
.pairs .mo small { font-size: 11px; color: var(--muted); }
.pairs .mo.cur small { color: var(--ink); font-weight: 700; }
.pairs-legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.pairs-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--edge); margin-inline-end: 6px; vertical-align: -1px; }
.yr-table td, .yr-table th { text-align: center; }
.yr-table td:first-child, .yr-table th:first-child { text-align: start; }

/* ---------- الإعدادات ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .set-grid, .fee-top { grid-template-columns: 1fr; } .debt { grid-template-columns: auto 1fr auto; } .debt .pr, .debt .left { display: none; } .att-hero { grid-template-columns: 1fr; } }
