/* Halaqa design layer: paper-white surfaces resting on Mihrab green, with restrained depth.
   Loaded after style.css and mobile.css; it restyles, the layout files keep the structure.
   Palette: Mihrab #0f4f43, Leaf #1f7a63, Gilt #c29b45, canvas #eef2ef, ink #1b2e29, slate #5d6b66.
   Type: Noto Kufi Arabic for headings and figures, IBM Plex Sans Arabic (Halaqa) for text. */
@font-face{font-family:HalaqaKufi;src:url('/kufi-arabic.ttf') format('truetype');font-weight:100 900;font-display:swap}

body{
 --bg:#eef2ef;--surface:#fff;--surface-2:#f6f8f6;--text:#1b2e29;--muted:#5d6b66;--line:#dde6e1;--green:#1f7a63;--tint:#e6f1ec;
 --primary:#1f7a63;--primary-deep:#0f4f43;--gold:#c29b45;--gold-ink:#6e5520;
 --font-display:HalaqaKufi,Halaqa,'Segoe UI',sans-serif;
 --r-sm:8px;--r-md:12px;--r-lg:16px;--r-xl:22px;
 --hl:inset 0 1px 0 rgb(255 255 255 / .9);
 --elev-1:var(--hl),0 1px 2px rgb(15 46 38 / .06),0 4px 10px -4px rgb(15 46 38 / .08);
 --elev-2:var(--hl),0 2px 4px rgb(15 46 38 / .05),0 14px 28px -14px rgb(15 46 38 / .22);
 --elev-3:0 28px 64px -20px rgb(9 36 30 / .5),0 10px 22px -10px rgb(9 36 30 / .24);
 --press:inset 0 2px 5px rgb(15 46 38 / .16);
 --ease:cubic-bezier(.2,.7,.2,1);
 line-height:1.7;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility
}
body.dark{
 --bg:#0e1b18;--surface:#162622;--surface-2:#1b2e29;--text:#e3eee9;--muted:#9fb3aa;--line:#263b35;--green:#7fcca7;--tint:#1d3830;
 --primary:#2c8f73;--primary-deep:#0a1613;--gold:#d2b066;--gold-ink:#e3c681;
 --hl:inset 0 1px 0 rgb(255 255 255 / .05);
 --elev-1:var(--hl),0 1px 2px rgb(0 0 0 / .35);
 --elev-2:var(--hl),0 16px 30px -14px rgb(0 0 0 / .65);
 --press:inset 0 2px 6px rgb(0 0 0 / .5)
}

/* Typography: Kufi carries titles and figures; Arabic must never be letter-spaced (it breaks the joins). */
.brand b,.page-heading h1,.panel-head h2,.modal-head h2,.welcome h2,.analytics-banner h2,.settings-panel h2,.login-form h2,.circle-card h3,.plan-card h3,.section-title,.public-page h1{font-family:var(--font-display);letter-spacing:0}
.page-heading h1{font-size:28px;font-weight:700;line-height:1.5;margin-bottom:4px}
.page-heading p{font-size:13px}
.panel-head h2{font-size:15px;font-weight:600}
.panel-head p{font-size:12px}
.nav-label,.metric-value b{letter-spacing:0}

/* Figures: large whole part, smaller fraction so ٥٥١٫٥٢ never reads as two numbers. */
.num{font-family:var(--font-display);font-variant-numeric:tabular-nums;white-space:nowrap}
.num small.dec{font-size:.6em;font-weight:500;color:inherit;opacity:.7;margin:0;margin-inline-start:.04em}
.metric-value .num,strong>.num,b>.num{font-size:inherit;color:inherit}
td .num,.circle-row .num{font-family:inherit}td .num small.dec{font-size:.8em;opacity:.75}
.metric-value b,.insight-card>strong,.banner-stat strong,.week-context strong,.report-stat b,.plan-card b,.workflow b,.comparison-row>strong{font-family:var(--font-display);font-weight:700;letter-spacing:0}
.metric-value b{font-size:36px;line-height:1.35}.metric-value b .num small.dec,.insight-card>strong .num small.dec,.banner-stat strong .num small.dec,.week-context strong .num small.dec{font-size:.5em}
.metric-value span{font-size:12px}
.insight-card>strong{font-size:34px;line-height:1.4}
.banner-stat strong{font-size:44px;line-height:1.3}
.week-context strong{font-size:32px;line-height:1.35}
.report-stat b{font-size:26px}.plan-card b{font-size:28px}

/* Focus is always visible; inputs get a soft ring instead of the default outline. */
button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
input,select,textarea{border-radius:10px;background:var(--surface-2);box-shadow:inset 0 1px 2px rgb(15 46 38 / .06);transition:border-color .15s,box-shadow .15s}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgb(31 122 99 / .2)}
.global-search{border-radius:10px;background:var(--surface-2)}.global-search:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgb(31 122 99 / .2)}
.global-search input{box-shadow:none;background:none}

/* Sidebar: a deep green slab; the active page is a raised paper tile with a gilt marker. */
.sidebar{background:var(--primary-deep);border-left:0;color:#dcebe4;box-shadow:inset 1px 0 0 rgb(255 255 255 / .06),-10px 0 34px -14px rgb(9 36 30 / .55)}
.sidebar .brand b{color:#fff;font-weight:700}.sidebar .brand small{color:#a9c9bc}
.sidebar .brand img{border-radius:14px;box-shadow:0 0 0 1px rgb(216 190 123 / .55),0 8px 16px -6px rgb(0 0 0 / .45)}
.sidebar .nav-label{color:#9fc2b4;font-weight:600}
.sidebar .nav{gap:4px}
.sidebar .nav button{color:#cfe2da;border-radius:12px;min-height:46px;font-weight:500;position:relative;transition:background-color .15s,transform .12s var(--ease)}
.sidebar .nav button:hover{background:rgb(255 255 255 / .07);color:#fff}
.sidebar .nav button:active{transform:translateY(1px)}
.sidebar .nav button.active{background:#f7faf8;color:var(--primary-deep);font-weight:700;box-shadow:inset 0 1px 0 #fff,0 1px 0 rgb(0 0 0 / .25),0 10px 18px -10px rgb(0 0 0 / .6)}
.sidebar .nav button.active:before{display:block;content:'';position:absolute;right:-9px;top:50%;width:4px;height:20px;margin-top:-10px;border-radius:4px;background:var(--gold)}
.sidebar .nav .count{background:var(--gold);color:#1b1608;font-weight:700}
.sidebar .side-note{background:rgb(255 255 255 / .06);border-color:rgb(255 255 255 / .09);color:#b9d3c8;border-radius:14px}
.sidebar .side-note b{color:#fff}.sidebar .side-note .ico{color:var(--gold)}
.sidebar .designer-credit{color:#a9c9bc}
.sidebar .profile{border-top-color:rgb(255 255 255 / .12)}.sidebar .profile b{color:#fff}.sidebar .profile small{color:#a9c9bc}.sidebar .profile button{color:#cfe2da}
body.dark .sidebar{background:#0b1714}
body.dark .sidebar .nav button.active{background:var(--surface-2);color:var(--green);box-shadow:inset 0 1px 0 rgb(255 255 255 / .06),0 10px 18px -10px rgb(0 0 0 / .7)}

/* Top bar floats over the page as frosted glass. */
.topbar{position:sticky;top:0;z-index:20;background:rgb(255 255 255 / .84);-webkit-backdrop-filter:saturate(1.5) blur(12px);backdrop-filter:saturate(1.5) blur(12px);border-bottom-color:var(--line);height:72px}
body.dark .topbar{background:rgb(22 38 34 / .86)}
.breadcrumbs b{font-weight:600}
.icon-button{border-radius:11px;box-shadow:var(--elev-1);transition:transform .12s var(--ease),box-shadow .12s}
.icon-button:active{transform:translateY(1px);box-shadow:var(--press)}

/* Buttons are physical: raised at rest, pressed in when tapped. */
.btn{border-radius:11px;box-shadow:var(--elev-1);transition:transform .12s var(--ease),box-shadow .12s var(--ease),background-color .12s,border-color .12s}
.btn:hover{border-color:color-mix(in srgb,var(--primary) 35%,var(--line))}
.btn:active{transform:translateY(1px);box-shadow:var(--press)}
.btn.primary{background:linear-gradient(180deg,#24876c,#1b6d57);border-color:#175f4c;color:#fff;box-shadow:inset 0 1px 0 rgb(255 255 255 / .22),0 1px 0 #0d4a3c,0 8px 16px -8px rgb(15 79 67 / .65)}
.btn.primary:hover{background:linear-gradient(180deg,#1f7c63,#175f4c)}
.btn.primary:active{box-shadow:inset 0 2px 6px rgb(0 0 0 / .28)}
.btn.soft{background:var(--tint);color:var(--primary-deep);border-color:transparent;box-shadow:none}
.btn.danger{background:#fbefec;color:#8e4a3f;border-color:#f0d6cf}
body.dark .btn.soft{color:var(--green)}body.dark .btn.danger{background:#3a2421;color:#f0b8ad;border-color:#4d2f2a}
.text-btn{color:var(--primary);font-weight:600}body.dark .text-btn{color:var(--green)}

/* Surfaces: one family of raised paper sheets, with radii that follow their size. */
.panel,.metric,.insight-card,.circle-card,.plan-card,.settings-panel,.session-summary,.attendance-strip,.report-stat{background:var(--surface);border:1px solid var(--line);box-shadow:var(--elev-1)}
.panel,.metric,.insight-card,.plan-card,.settings-panel{border-radius:var(--r-lg)}
.session-summary,.attendance-strip,.report-stat{border-radius:var(--r-md)}
.metric{padding:20px 22px 16px}
.metric-head{font-size:12px;font-weight:500}
.metrics .metric .metric-icon,.insight-card .ico,.circle-symbol{background:var(--tint);color:var(--primary);border-radius:12px;box-shadow:inset 0 1px 0 rgb(255 255 255 / .8),0 1px 2px rgb(15 46 38 / .1)}
.metrics .metric:nth-child(3) .metric-icon{background:#f6efdc;color:var(--gold-ink)}
body.dark .metrics .metric .metric-icon,body.dark .insight-card .ico,body.dark .circle-symbol{color:var(--green);box-shadow:none}
body.dark .metrics .metric:nth-child(3) .metric-icon{background:#3a3220;color:var(--gold)}
.metric-footer{font-size:12px}
.circle-card{border-radius:var(--r-lg);border-top:1px solid var(--line);position:relative;overflow:hidden;box-shadow:var(--elev-2)}
.circle-card:before{content:'';position:absolute;inset:0 0 auto;height:4px;background:var(--circle)}
.circle-card h3{font-size:18px;font-weight:700}
.track{background:var(--surface-2);border-radius:14px}.next-assignment .track{background:var(--surface)}

/* Hero slab: the one bold element — deep green, an eight-point star lattice in faint gilt, and a lifted edge. */
.welcome,.analytics-banner{background:var(--primary-deep);border-radius:var(--r-xl);isolation:isolate;box-shadow:inset 0 1px 0 rgb(255 255 255 / .12),inset 0 -3px 0 rgb(0 0 0 / .2),0 24px 46px -24px rgb(10 60 48 / .75)}
.welcome{padding:30px 34px;min-height:164px}
.welcome:after,.analytics-banner:after{content:'';position:absolute;inset:0 auto 0 0;width:58%;height:auto;border:0;border-radius:0;transform:none;z-index:-1;opacity:.17;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23d8be7b' stroke-width='1.1'%3E%3Crect x='26' y='26' width='36' height='36'/%3E%3Crect x='26' y='26' width='36' height='36' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='8'/%3E%3Cpath d='M0 44h8M80 44h8M44 0v8M44 80v8'/%3E%3C/g%3E%3C/svg%3E") 0 0/88px 88px repeat;-webkit-mask-image:linear-gradient(to left,transparent,#000 75%);mask-image:linear-gradient(to left,transparent,#000 75%);pointer-events:none}
.welcome h2{font-size:25px;font-weight:700}
.welcome p{color:#c3dcd2;font-size:13px}
.welcome .tag{border-radius:999px;padding:5px 12px;font-size:11px}
.welcome .verse{color:#ead9a3}
.analytics-banner{padding:30px 34px}.analytics-banner h2{font-size:26px;font-weight:700}
body.dark .welcome,body.dark .analytics-banner{background:#123a32}

/* Segmented controls and the daily workflow: a recessed track with a raised selection. */
.segment{background:var(--surface-2);border-radius:11px;padding:3px;box-shadow:inset 0 1px 2px rgb(15 46 38 / .1)}
.segment button,.panel-head .segment button{border-radius:8px;font-size:12px;padding:6px 12px;color:var(--muted);transition:background-color .15s,box-shadow .15s}
.segment button.active{background:var(--surface);color:var(--primary-deep);font-weight:600;box-shadow:0 1px 2px rgb(15 46 38 / .14),0 3px 8px -3px rgb(15 46 38 / .16)}
body.dark .segment button.active{background:var(--tint);color:var(--green)}
.workflow button{border-radius:var(--r-md);box-shadow:var(--elev-1);font-size:13px;transition:transform .12s var(--ease),box-shadow .12s,background-color .15s}
.workflow button:active{transform:translateY(1px)}
.workflow button.active{background:var(--tint);border-color:var(--primary);color:var(--primary-deep);box-shadow:var(--press);font-weight:600}
body.dark .workflow button.active{color:var(--green)}
.workflow b{font-size:22px}
.student-status-tabs .btn.primary b{background:rgb(255 255 255 / .2)}

/* Tables read as ledgers: quiet header, comfortable rows, a soft hover. */
th{background:var(--surface-2);font-size:12px;font-weight:600;border-bottom:1px solid var(--line)}
td{font-size:13px}
.name-cell b{font-size:13px}
tbody tr:hover>td{background:color-mix(in srgb,var(--tint) 55%,var(--surface))}
.status{border-radius:999px;padding:4px 10px;font-size:11px;font-weight:500}

/* Charts and progress get a little volume. */
.chart-grid{direction:rtl}
.bar{border-radius:6px 6px 3px 3px;background:linear-gradient(180deg,#2a9174,#1b6d57);box-shadow:inset 0 1px 0 rgb(255 255 255 / .3),0 3px 8px -3px rgb(15 79 67 / .55)}
.bar.light{background:linear-gradient(180deg,#d6e9df,#bcd8ca);box-shadow:inset 0 1px 0 rgb(255 255 255 / .7)}
body.dark .bar.light{background:linear-gradient(180deg,#3f6257,#2f4d43);box-shadow:none}
.progress{background:var(--surface-2);box-shadow:inset 0 1px 2px rgb(15 46 38 / .14)}
.progress div{background:linear-gradient(90deg,#2a9174,#1b6d57)}
.trend{border-radius:999px;font-weight:600}body.dark .trend.down{background:#3a2c18;color:#e9c48a}
.comparison-bar{border-radius:7px;box-shadow:inset 0 1px 2px rgb(15 46 38 / .12)}

/* People and notices: two accents only (green and gilt) instead of a rainbow. */
.avatar{background:var(--tint);color:var(--primary-deep);box-shadow:inset 0 0 0 1px rgb(31 122 99 / .12)}
.avatar.blue,.avatar.purple{background:var(--surface-2);color:var(--text);box-shadow:inset 0 0 0 1px var(--line)}
.avatar.gold{background:#f6efdc;color:#6e5520;box-shadow:inset 0 0 0 1px #eadfbe}
body.dark .avatar{color:var(--green)}body.dark .avatar.gold{background:#3a3220;color:var(--gold)}
.notice{background:#f8f3e4;border-color:#ecdfbd;border-radius:var(--r-lg);box-shadow:var(--elev-1)}
body.dark .notice{background:#2a2618;border-color:#3d3522;color:#d9c592}body.dark .notice b{color:#ecd9a3}body.dark .notice button{color:#e3c681}

/* Dialogs rise from the page; the backdrop dims and softens behind them. */
dialog{border-radius:20px;box-shadow:var(--elev-3);border-color:var(--line)}
dialog::backdrop{background:rgb(9 36 30 / .45);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
dialog[open]{animation:dialog-in .24s var(--ease) both}dialog[open]::backdrop{animation:fade-in .24s ease both}
.modal-head h2{font-size:19px;font-weight:700}
.modal-footer{background:var(--surface-2);border-radius:0 0 20px 20px}
.floating-toast{border-radius:12px;box-shadow:var(--elev-3);background:var(--primary-deep)}

/* Noorani Qaida picker: lesson list, a plain-language summary, and the page scan with tappable boxes. */
.noorani-picker{grid-column:1/-1;display:grid;gap:10px}
.noorani-summary{margin:0;padding:12px 14px;border-radius:12px;background:var(--tint);color:var(--primary-deep);font-size:13px;line-height:1.9}
body.dark .noorani-summary{color:var(--green)}
.noorani-picker>.btn{justify-self:start}
.noorani-viewer{border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:10px;box-shadow:var(--elev-1)}
.noorani-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.noorani-hint{margin:8px 0;font-size:12px;color:var(--muted);text-align:center}
.noorani-sheet{position:relative;border-radius:10px;overflow:hidden;background:#fff}
.noorani-sheet img{display:block;width:100%;height:auto;-webkit-user-select:none;user-select:none}
.noorani-box{position:absolute;border:0;padding:0;background:transparent;border-radius:6px;cursor:pointer}
.noorani-box:hover{background:rgb(31 122 99 / .12)}
.noorani-box.in{background:rgb(31 122 99 / .2);box-shadow:inset 0 0 0 2px rgb(31 122 99 / .7)}
.noorani-box.edge{box-shadow:inset 0 0 0 3px var(--gold)}
.ico.flip{transform:scaleX(-1)}

/* Opening animation: full-screen silent clip on the clip's own green, fading (and easing forward) into the app. */
#intro{position:fixed;inset:0;z-index:100000;background:#033a36;overflow:hidden;transition:opacity .8s var(--ease),visibility .8s}
#intro video{width:100%;height:100%;object-fit:cover;display:block;transition:transform .8s var(--ease)}
#intro.leaving{opacity:0;visibility:hidden;pointer-events:none}#intro.leaving video{transform:scale(1.05)}
@media(prefers-reduced-motion:reduce){#intro.leaving video{transform:none}}

/* Login backdrop: Mihrab green lit from above, an interlaced eight-point star (khatam) lattice in faint gilt,
   and the brand statement — logo, name, tagline and the hadith — set beside the sign-in card. */
.login:before{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='104' viewBox='0 0 104 104'%3E%3Cg fill='none' stroke='%23d8be7b' stroke-opacity='.13' stroke-width='1.1'%3E%3Cpath d='M34 34h36v36H34zM52 26.5 77.5 52 52 77.5 26.5 52z'/%3E%3Cpath d='M52 26.5V0M77.5 52H104M52 77.5V104M26.5 52H0M34 34 0 0M70 34l34-34M70 70l34 34M34 70 0 104'/%3E%3Ccircle cx='52' cy='52' r='7'/%3E%3C/g%3E%3C/svg%3E") center/104px repeat,radial-gradient(120% 85% at 70% 12%,#17705f 0%,#0f4f43 46%,#093730 100%)}
.login .login-backdrop{display:none}
.login .login-art{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#fff;position:relative}
.login .login-art:after{content:'';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,90%);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgb(216 190 123 / .14),transparent 65%);z-index:-1;pointer-events:none}
.login .login-art img{display:block;width:104px;height:104px;margin:0 0 18px;border-radius:26px;filter:none;box-shadow:0 0 0 1px rgb(216 190 123 / .5),0 22px 44px -14px rgb(0 0 0 / .65)}
.login .login-art h1{display:block;margin:0;font-family:var(--font-display);font-size:60px;font-weight:700;line-height:1.3;letter-spacing:0;color:#fff;text-shadow:0 2px 18px rgb(0 0 0 / .25)}
.login .login-art .login-tagline{display:block;margin:2px 0 26px;font-size:19px;font-weight:500;color:#cfe2da;max-width:none}
.login-art-hadith{margin:0;padding:18px 28px 14px;border-block:1px solid rgb(216 190 123 / .35)}
.login-art-hadith blockquote{margin:0;font-family:var(--font-display);font-size:27px;font-weight:600;line-height:1.9;color:#ead9a3}
.login-art-hadith figcaption{margin-top:4px;font-size:13px;color:#a9c9bc}
@media(orientation:portrait){.login .login-art{min-height:auto;padding:22px 0 12px}.login .login-art img{width:72px;height:72px;border-radius:19px;margin-bottom:12px}.login .login-art h1{font-size:42px}.login .login-art .login-tagline{font-size:16px;margin-bottom:16px}.login-art-hadith{padding:12px 18px 10px}.login-art-hadith blockquote{font-size:20px}}

/* Login card: a single sheet lifted above the artwork. */
.login-form{border-radius:24px;box-shadow:var(--elev-3),inset 0 1px 0 #fff}
.login-form h2{font-weight:700}

/* Native bottom bar: a floating rail with a raised selection. */
.native-app .bottom-tabs{background:rgb(255 255 255 / .9);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:0 -10px 30px -16px rgb(9 36 30 / .4)}
body.dark.native-app .bottom-tabs{background:rgb(22 38 34 / .92)}
.bottom-tabs button.active{background:var(--tint);color:var(--primary-deep);box-shadow:var(--hl),0 1px 2px rgb(15 46 38 / .1)}
body.dark .bottom-tabs button.active{color:var(--green)}

/* Motion: only when something changes — a new page, a dialog, a press. */
.content{animation:none}.content.entering{animation:page-enter .3s var(--ease) both}
@keyframes dialog-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.content.entering,dialog[open],dialog[open]::backdrop{animation:none}.btn,.icon-button,.workflow button,.sidebar .nav button{transition:none}}

@media(max-width:700px){.topbar{height:auto}.page-heading h1{font-size:24px}.metric-value b{font-size:30px}.welcome{padding:24px}.welcome:after{width:100%}.insight-card>strong{font-size:28px}}

/* Paper and PDF: no shadows, no slabs. */
@media print{*{box-shadow:none!important}.welcome{background:#eee!important;color:#111}.welcome:after,.analytics-banner:after{display:none}.topbar{position:static}}
.printing-analytics .panel,.printing-analytics .insight-card,.printing-analytics .attendance-strip{box-shadow:none}
.printing-analytics .analytics-banner:after{opacity:.12}

.progress-overview .panel-head{display:block}.progress-overview .panel-head h2{margin-bottom:8px}.progress-overview .insights{padding:0 16px 16px}

