:root{--navy:#0F2A47;--ink:#131A24;--muted:#55606E;--line:#E1E6EC;--field:#C3CBD5;--bg:#F4F6F8;--tint:#E8EEF5;--seg:#E4E8ED;--on-navy:#C5D2E0;--red:#A0211A;--red-bg:#FBEAE9;--green:#17684A;--green-bg:#E5F3ED;--blue:#1D5FA8}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:400 16px/1.5 'IBM Plex Sans Arabic',system-ui,sans-serif}
#app{max-width:560px;margin:0 auto;min-height:100dvh;background:var(--bg);display:flex;flex-direction:column}
a{color:var(--navy)}
h1,h2,p{margin:0}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.55}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px #D6E4F3}
[hidden]{display:none!important}
.ltr{direction:ltr;text-align:right}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

.ic{width:23px;height:23px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.head{background:var(--navy);color:#fff;padding:16px;display:flex;flex-direction:column;gap:14px}
.head-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.head h1{font-size:23px;font-weight:700;line-height:1.3}
.head .sub{font-size:14px;color:var(--on-navy)}
.head .mark{width:44px;height:44px;border-radius:50%;object-fit:cover;display:block;flex:none}
.back{display:inline-flex;align-items:center;gap:4px;min-height:44px;text-decoration:none;font-size:15px;font-weight:500;align-self:flex-start}
.head .back{color:#fff;margin:-10px 0 -8px}
.weekbar{display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.1);border-radius:10px}
.weekbar button{width:46px;height:46px;border:0;background:transparent;color:#fff;display:flex;align-items:center;justify-content:center;padding:0}
.weekbar b{font-size:15px;font-weight:600}
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.kpis>div{padding-inline:12px;border-inline-start:1px solid rgba(255,255,255,.2)}
.kpis>div:first-child{padding-inline-start:0;border:0}
.kpis b{display:block;font-size:26px;font-weight:700;line-height:1.2}
.kpis b small{font-size:15px;font-weight:500}
.kpis span{font-size:13px;color:var(--on-navy)}

.main{flex:1;display:flex;flex-direction:column;gap:12px;padding:14px 16px 96px}
.main.plain{padding-bottom:20px}
.title{font-size:25px;font-weight:700;line-height:1.3}
.row-between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.muted{color:var(--muted)}
.small{font-size:13px}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.card.pad{padding:14px;display:flex;flex-direction:column;gap:10px}
.card h2,.h2{font-size:17px;font-weight:700}
.list>*{border-top:1px solid var(--line)}
.list>:first-child{border-top:0}

.seg{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:3px;background:var(--seg);border-radius:10px;padding:3px}
.seg button{min-height:44px;border:0;border-radius:8px;background:transparent;font-size:15px;font-weight:500;padding:0 4px}
.seg button[aria-pressed=true]{background:#fff;font-weight:600}

.btn{min-height:48px;border-radius:10px;border:1px solid var(--field);background:#fff;color:var(--navy);font-size:15px;font-weight:600;text-decoration:none;display:flex;align-items:center;justify-content:center;gap:6px;padding:0 14px}
.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}
.btn.big{min-height:54px;font-size:17px}
.btn.danger{color:var(--red);border-color:#E9B9B5}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}

.nav{position:fixed;bottom:0;inset-inline:0;max-width:560px;margin:0 auto;height:calc(68px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:#fff;border-top:1px solid var(--line);display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);z-index:5}
.nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none;color:var(--muted);font-size:12px;font-weight:500}
.nav a[aria-current]{color:var(--navy);font-weight:700;box-shadow:inset 0 2px 0 var(--navy)}

.person{width:100%;min-height:72px;border:0;background:#fff;padding:10px 12px;display:flex;align-items:center;gap:11px;text-align:right}
.person.open,.person-body{background:#FAFBFC}
.avatar{width:42px;height:42px;flex:none;border-radius:50%;background:var(--tint);color:var(--navy);font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center}
.person .info{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px}
.person .name{font-size:16px;font-weight:600}
.segs{display:flex;gap:3px}
.segs i{flex:1;height:5px;border-radius:2px;background:#DDE2E8}
.segs i.on{background:var(--navy)}
.count{flex:none;font-size:15px;font-weight:600;min-width:48px;text-align:center;white-space:nowrap}
.chev{width:20px;height:20px;color:var(--muted);transition:transform .15s}
.open .chev{transform:rotate(180deg)}
.tag{flex:none;min-height:28px;padding:3px 9px;border-radius:6px;font-size:13px;font-weight:600;display:inline-flex;align-items:center}
.tag.ok{background:var(--green-bg);color:var(--green)}
.tag.warn{background:var(--red-bg);color:var(--red)}
.tag.info{background:var(--tint);color:var(--navy)}
.person-body{padding:2px 12px 12px;display:flex;flex-direction:column;gap:8px}
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.tile{position:relative;min-height:68px;padding:8px 2px 6px;border-radius:9px;border:1px solid var(--field);background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:13px;font-weight:500}
.tile[aria-pressed=true]{background:var(--navy);border-color:var(--navy);color:#fff}
.tile .tick{position:absolute;top:6px;left:6px;width:15px;height:15px;stroke-width:3.2;display:none}
.tile[aria-pressed=true] .tick{display:block}
.tile:disabled{opacity:1}
.saved{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px}
.saved .ic{width:15px;height:15px;color:var(--green);stroke-width:2.8}
.note{font-size:14px;background:var(--tint);border-radius:10px;padding:10px 12px}
.note.warn{background:var(--red-bg);color:var(--red)}
.note.ok{background:var(--green-bg);color:var(--green)}

.rowlink{display:flex;align-items:center;gap:10px;min-height:62px;padding:6px 12px;text-decoration:none;color:var(--ink)}
.rowlink .grow{flex:1;min-width:0}
.rowlink .t{display:block;font-size:16px;font-weight:600;overflow-wrap:anywhere}
.rowlink .s{display:block;font-size:13px;color:var(--muted)}
.rowlink .go{width:18px;height:18px;color:var(--muted)}
.classno{width:44px;height:44px;flex:none;border-radius:9px;background:var(--tint);color:var(--navy);font-size:21px;font-weight:700;display:flex;align-items:center;justify-content:center}
.bar{height:7px;border-radius:4px;background:#E9EDF1;overflow:hidden}
.bar i{display:block;height:100%;background:var(--navy);border-radius:4px}

.hist{display:flex;align-items:center;gap:6px}
.hist .l{width:104px;flex:none;font-size:13px;font-weight:500}
.hist .cells{flex:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px}
.hist .cells i{height:26px;border-radius:4px;background:#E9EDF1;display:flex;align-items:center;justify-content:center;color:#fff}
.hist .cells i.on{background:var(--navy)}
.hist .ic{width:12px;height:12px;stroke-width:3.6}
.axis{display:flex;justify-content:space-between;font-size:13px;color:var(--muted)}
.statline{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 14px;font-size:15px}
.statline span{display:flex;align-items:center;gap:8px}
.statline .ic{width:21px;height:21px}

.hero{background:var(--navy);color:#fff;border-radius:12px;padding:16px}
.hero .big{font-size:46px;font-weight:700;line-height:1.2}
.hero .sub{font-size:14px;color:var(--on-navy)}
.metric-head{display:flex;justify-content:space-between;align-items:center;font-size:15px;margin-bottom:5px}
.metric-head span{display:flex;align-items:center;gap:8px}
.metric-head .ic{width:21px;height:21px}
.chart{height:112px;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
.chart button{height:112px;border:0;padding:0 5px;background:transparent;display:flex;align-items:flex-end}
.chart button i{display:block;width:100%;min-height:2px;background:#B7C6D7;border-radius:4px 4px 0 0}
.chart button[aria-pressed=true] i{background:var(--navy)}

.field{display:flex;flex-direction:column;gap:6px}
.field label,.flabel{font-size:15px;font-weight:500}
.input{width:100%;height:52px;border:1px solid var(--field);border-radius:10px;padding:0 14px;font-size:16px;background:#fff}
.pass{position:relative}
.pass .input{padding-left:54px}
.pass button{position:absolute;left:4px;top:4px;width:44px;height:44px;border:0;background:transparent;color:var(--navy);display:flex;align-items:center;justify-content:center;padding:0}
.search{position:relative}
.search .input{padding-right:44px}
.search .ic{position:absolute;right:14px;top:15px;width:21px;height:21px;color:var(--muted)}
.choice{min-height:50px;border-radius:9px;border:1px solid var(--field);background:#fff;font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:5px;padding:0 4px}
.choice .ic{width:15px;height:15px;stroke-width:3;display:none}
.choice[aria-pressed=true]{background:var(--navy);border-color:var(--navy);color:#fff}
.choice[aria-pressed=true] .ic{display:block}
.perm{display:flex;align-items:center;gap:12px;min-height:62px;padding:6px 14px}
.perm .grow{flex:1;min-width:0}
.perm b{display:block;font-size:15px;font-weight:600}
.perm span.s{display:block;font-size:13px;color:var(--muted)}
.switch{width:52px;height:44px;flex:none;border:0;background:transparent;padding:0;display:flex;align-items:center}
.switch i{display:flex;width:48px;height:28px;padding:3px;border-radius:999px;background:#B4BDC8;justify-content:flex-end}
.switch i::after{content:"";width:22px;height:22px;border-radius:50%;background:#fff}
.switch[aria-checked=true] i{background:var(--navy);justify-content:flex-start}
.check{min-height:46px;border:0;background:transparent;padding:0;font-size:15px;display:flex;align-items:center;gap:9px;text-align:right}
.check i{width:22px;height:22px;flex:none;border-radius:5px;border:1.5px solid #9AA6B3;display:flex;align-items:center;justify-content:center;color:#fff}
.check .ic{width:13px;height:13px;stroke-width:3.4;display:none}
.check[aria-pressed=true] i{background:var(--navy);border-color:var(--navy)}
.check[aria-pressed=true] .ic{display:block}
.action{min-height:66px;flex-direction:column;gap:4px;font-size:14px;padding:6px 2px}
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.steps li{font-size:14px;color:var(--muted);font-weight:500}
.steps li::before{content:"";display:block;height:4px;border-radius:2px;background:#D3D9E0;margin-bottom:5px}
.steps li.done{color:var(--ink)}
.steps li.done::before{background:var(--navy)}
.steps li.now{font-weight:700}
.drop{border:1.5px dashed #9AA6B3;border-radius:10px;padding:24px 14px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.stat b{display:block;font-size:24px;font-weight:700}
.stat.bad{background:var(--red-bg);border-color:#F3CFCC;color:var(--red)}
.errline{display:flex;justify-content:space-between;gap:8px;min-height:44px;align-items:center;font-size:14px;padding:0 14px}
.errline span:last-child{color:var(--red);text-align:left}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}

.login-top{background:var(--navy);color:#fff;padding:44px 24px 34px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.login-top img{width:92px;height:92px;border-radius:50%;object-fit:cover;border:3px solid #fff}
.login-top h1{font-size:24px;font-weight:700;line-height:1.3}
.login-top p{font-size:14px;color:var(--on-navy)}
.login-form{flex:1;background:#fff;display:flex;flex-direction:column;gap:16px;padding:28px 24px}
.spin{display:flex;align-items:center;justify-content:center;padding:60px;color:var(--muted)}
#toast{position:fixed;left:16px;right:16px;bottom:84px;max-width:528px;margin:0 auto;background:var(--ink);color:#fff;border-radius:10px;padding:12px 14px;font-size:15px;text-align:center;z-index:10;opacity:0;pointer-events:none;transition:opacity .15s}
#toast.show{opacity:1}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
