/* School Manager app styles — RTL, mobile-first. */
:root{--sm-primary:#1e40af;--sm-primary-2:#2563eb;--sm-bg:#f1f5f9;--sm-card:#fff;--sm-text:#0f172a;--sm-muted:#64748b;--sm-border:#e2e8f0;--sm-green:#16a34a;--sm-red:#dc2626;--sm-amber:#d97706;--sm-radius:14px;--sm-shadow:0 1px 2px rgba(15,23,42,.06),0 4px 16px rgba(15,23,42,.06)}
.sm-app,.sm-login-wrap,.sm-modal,.sm-toast,#sm-print{font-family:Vazirmatn,Tahoma,"Segoe UI",sans-serif;direction:rtl;text-align:right;color:var(--sm-text);line-height:1.8}
.sm-app *,.sm-login-wrap *,.sm-modal *{box-sizing:border-box}
.sm-app button,.sm-app input,.sm-app select,.sm-app textarea,.sm-modal button,.sm-modal input,.sm-modal select,.sm-modal textarea,.sm-login-wrap input,.sm-login-wrap button{font-family:inherit;font-size:15px}
body.sm-app-page{background:var(--sm-bg);margin:0}
.sm-app a{color:var(--sm-primary-2);text-decoration:none}
.sm-ic{width:20px;height:20px;fill:currentColor;flex:none;vertical-align:middle}
.sm-muted{color:var(--sm-muted)}
.sm-loading{padding:40px;text-align:center;color:var(--sm-muted)}
.sm-spinner{display:inline-block;width:18px;height:18px;border:3px solid #cbd5e1;border-top-color:var(--sm-primary-2);border-radius:50%;animation:smspin .8s linear infinite;vertical-align:middle}
@keyframes smspin{to{transform:rotate(360deg)}}
.sm-empty{padding:18px;text-align:center;color:var(--sm-muted);background:#f8fafc;border-radius:10px;border:1px dashed var(--sm-border)}
.sm-alert{padding:12px 16px;border-radius:10px;background:#fef2f2;color:#991b1b;border:1px solid #fecaca;margin:10px 0}
.sm-alert.info{background:#eff6ff;color:#1e3a8a;border-color:#bfdbfe}
.sm-alert.ok{background:#f0fdf4;color:#166534;border-color:#bbf7d0}

/* buttons */
.sm-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 16px;border-radius:10px;border:1px solid transparent;cursor:pointer;font-weight:500;line-height:1.4;text-decoration:none;white-space:nowrap;transition:.15s}
.sm-btn:disabled{opacity:.55;cursor:not-allowed}
.sm-btn-primary{background:var(--sm-primary-2);color:#fff!important}.sm-btn-primary:hover{background:var(--sm-primary)}
.sm-btn-light{background:#fff;border-color:var(--sm-border);color:var(--sm-text)!important}.sm-btn-light:hover{background:#f8fafc}
.sm-btn-outline{background:#fff;border-color:var(--sm-primary-2);color:var(--sm-primary-2)}
.sm-btn-green{background:#16a34a;color:#fff!important}
.sm-btn-red{background:#dc2626;color:#fff!important}
.sm-btn-amber{background:#f59e0b;color:#fff!important}
.sm-btn-block{width:100%}
.sm-btn.is-busy{opacity:.7}
.sm-link{background:none;border:0;color:var(--sm-primary-2);cursor:pointer;padding:0;font-size:14px}
.sm-link:disabled{color:var(--sm-muted)}
.sm-danger{color:var(--sm-red)!important}
.sm-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.1);color:#fff!important;cursor:pointer;font-size:18px}

/* login */
.sm-login-wrap{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;background:linear-gradient(160deg,#1e3a8a 0%,#2563eb 55%,#38bdf8 100%)}
.sm-login-card{width:100%;max-width:420px;background:#fff;border-radius:22px;padding:28px 24px;box-shadow:0 20px 60px rgba(15,23,42,.3)}
.sm-login-head{text-align:center;margin-bottom:18px}
.sm-login-head h1{font-size:21px;margin:10px 0 4px;color:#1e3a8a}
.sm-login-head p{margin:0;color:var(--sm-muted);font-size:13px}
.sm-login-logo{width:84px;height:84px;object-fit:contain}
.sm-login-step label{display:block;font-weight:500;margin-bottom:14px;font-size:14px}
.sm-login-step input{display:block;width:100%;margin-top:6px;padding:12px 14px;border:1px solid var(--sm-border);border-radius:12px;font-size:17px;direction:ltr;text-align:center;letter-spacing:1px;background:#f8fafc}
.sm-login-step input:focus{outline:2px solid #93c5fd;border-color:var(--sm-primary-2);background:#fff}
.sm-otp-input{font-size:26px!important;letter-spacing:10px!important}
.sm-login-links{display:flex;justify-content:space-between;margin-top:12px}
.sm-login-msg{margin-top:14px;font-size:14px;border-radius:10px}
.sm-login-msg:empty{display:none}
.sm-login-msg.is-error{background:#fef2f2;color:#b91c1c;padding:10px 12px}
.sm-login-msg.is-info{background:#fffbeb;color:#92400e;padding:10px 12px;border:1px dashed #f59e0b}
.sm-login-msg.is-ok{background:#f0fdf4;color:#166534;padding:10px 12px}
.sm-login-sent{font-size:14px;color:var(--sm-muted)}
.sm-role-list{display:grid;gap:10px}
.sm-login-foot{color:rgba(255,255,255,.8);font-size:12px;margin-top:18px}

/* top bar + nav */
.sm-top{position:sticky;top:0;z-index:50;background:linear-gradient(90deg,#1e3a8a,#1d4ed8);color:#fff;box-shadow:0 2px 10px rgba(30,58,138,.25)}
.sm-top-in{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:8px 14px}
.sm-brand{display:flex;align-items:center;gap:8px;color:#fff!important;min-width:0}
.sm-brand span{display:flex;flex-direction:column;line-height:1.3;min-width:0}
.sm-brand b{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sm-brand small{font-size:11px;opacity:.8}
.sm-nav{display:none;gap:4px;margin-inline-start:auto}
.sm-nav a{display:flex;align-items:center;gap:6px;color:#dbeafe!important;padding:7px 12px;border-radius:10px;font-size:14px}
.sm-nav a.active,.sm-nav a:hover{background:rgba(255,255,255,.16);color:#fff!important}
.sm-user{display:flex;align-items:center;gap:6px;margin-inline-start:auto}
.sm-role-sel{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.3);border-radius:10px;padding:6px 8px;font-size:13px}
.sm-role-sel option{color:#000}
.sm-role-tag{font-size:12px;background:rgba(255,255,255,.15);padding:4px 10px;border-radius:20px;white-space:nowrap}
.sm-main{max-width:1200px;margin:0 auto;padding:14px 12px 96px}
.sm-bottom{position:fixed;bottom:0;right:0;left:0;z-index:50;display:flex;background:#fff;border-top:1px solid var(--sm-border);box-shadow:0 -2px 12px rgba(15,23,42,.08);padding-bottom:env(safe-area-inset-bottom)}
.sm-bottom a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:7px 2px;color:var(--sm-muted)!important;font-size:11px}
.sm-bottom a.active{color:var(--sm-primary-2)!important}
.sm-bottom a .sm-ic{width:22px;height:22px}
.sm-dot-count{display:inline-flex;min-width:18px;height:18px;padding:0 5px;align-items:center;justify-content:center;background:#ef4444;color:#fff;border-radius:9px;font-size:11px;font-style:normal;line-height:1}
@media(min-width:900px){.sm-nav{display:flex}.sm-user{margin-inline-start:12px}.sm-bottom{display:none}.sm-main{padding:20px 16px 40px}}

/* cards */
.sm-card{background:var(--sm-card);border-radius:var(--sm-radius);box-shadow:var(--sm-shadow);margin:0 0 14px;border:1px solid #eef2f7}
.sm-card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid #f1f5f9;flex-wrap:wrap}
.sm-card-h h3{margin:0;font-size:16px;font-weight:700}
.sm-card-h h3 small{font-weight:400;color:var(--sm-muted);font-size:12px}
.sm-card-b{padding:14px 16px}
.sm-cols2{display:grid;grid-template-columns:1fr;gap:0 14px}
@media(min-width:900px){.sm-cols2{grid-template-columns:1fr 1fr}}
.sm-back{display:inline-block;margin-bottom:10px;font-size:14px}
.sm-readonly-bar{background:#fef3c7;color:#92400e;border:1px solid #fde68a;padding:6px 12px;border-radius:10px;margin-bottom:10px;font-size:13px}
.sm-page-title{font-size:20px;margin:0 0 10px}

/* hero */
.sm-hero{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg,#eff6ff,#fff);border:1px solid #dbeafe;border-radius:18px;padding:16px;margin-bottom:14px}
.sm-hero-av{position:relative;display:block;flex:none}
.sm-hero-edit{position:absolute;bottom:-4px;right:50%;transform:translateX(50%);background:var(--sm-primary-2);color:#fff;font-size:10px;padding:1px 8px;border-radius:8px}
.sm-hero-t h2{margin:0;font-size:19px}
.sm-hero-t p{margin:2px 0 0;color:var(--sm-muted);font-size:14px}
.sm-avatar{border-radius:50%;object-fit:cover;background:#e2e8f0;width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;flex:none;vertical-align:middle}
.sm-avatar-ph{background:linear-gradient(135deg,#93c5fd,#6366f1);color:#fff;font-weight:700;font-size:14px}
.sm-avatar.xs{width:24px;height:24px;font-size:10px}
.sm-avatar.sm{width:32px;height:32px;font-size:12px}
.sm-avatar.lg{width:68px;height:68px;font-size:22px;border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.sm-avatar.xl{width:110px;height:110px;font-size:32px}
.sm-photo-up{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.sm-kids{display:flex;gap:8px;overflow-x:auto;margin-bottom:12px;padding-bottom:4px}
.sm-kids button{display:flex;align-items:center;gap:6px;border:1px solid var(--sm-border);background:#fff;border-radius:30px;padding:4px 12px 4px 6px;cursor:pointer;white-space:nowrap}
.sm-kids button.on{border-color:var(--sm-primary-2);background:#eff6ff;color:var(--sm-primary)}

/* tiles */
.sm-tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}
@media(min-width:700px){.sm-tiles{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}}
.sm-tile{background:#fff;border-radius:14px;padding:12px;text-align:center;box-shadow:var(--sm-shadow);border-top:3px solid var(--sm-primary-2)}
.sm-tile b{display:block;font-size:22px;color:var(--sm-primary)}
.sm-tile span{font-size:12px;color:var(--sm-muted)}
.sm-tile.red{border-top-color:#ef4444}.sm-tile.red b{color:#dc2626}
.sm-tile.amber{border-top-color:#f59e0b}.sm-tile.amber b{color:#d97706}

/* class-subject cards */
.sm-cs-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
@media(min-width:700px){.sm-cs-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}
.sm-cs-card{display:flex;flex-direction:column;gap:2px;padding:14px;border-radius:14px;color:#fff!important;min-height:120px;position:relative;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.1);transition:transform .15s}
.sm-cs-card:hover{transform:translateY(-2px)}
.sm-cs-card b{font-size:16px}
.sm-cs-card span{font-size:14px;opacity:.95}
.sm-cs-card small{font-size:12px;opacity:.85;margin-top:auto}
.sm-cs-ic{position:absolute;left:10px;top:10px;opacity:.25}.sm-cs-ic .sm-ic{width:40px;height:40px}
.c0{background:linear-gradient(135deg,#2563eb,#1e40af)}.c1{background:linear-gradient(135deg,#0d9488,#0f766e)}.c2{background:linear-gradient(135deg,#7c3aed,#5b21b6)}.c3{background:linear-gradient(135deg,#db2777,#9d174d)}.c4{background:linear-gradient(135deg,#ea580c,#c2410c)}.c5{background:linear-gradient(135deg,#0891b2,#155e75)}
.sm-class-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
@media(min-width:700px){.sm-class-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}}
.sm-class-card{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 6px;border-radius:14px;color:#fff!important;text-align:center;min-height:84px}
.sm-class-card b{font-size:17px}.sm-class-card small{font-size:11px;opacity:.9}
.sm-teacher-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(min-width:700px){.sm-teacher-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}}
.sm-teacher-grid a{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:10px 4px;border-radius:12px;color:var(--sm-text)!important}
.sm-teacher-grid a:hover{background:#f8fafc}
.sm-teacher-grid b{font-size:13px}.sm-teacher-grid small{font-size:11px;color:var(--sm-muted)}

/* announcements, threads */
.sm-ann{list-style:none;margin:0;padding:0}
.sm-ann li{padding:10px 0;border-bottom:1px solid #f1f5f9}
.sm-ann li:last-child{border:0}
.sm-ann-h{display:flex;flex-direction:column}
.sm-ann-h small{color:var(--sm-muted);font-size:12px}
.sm-ann p{margin:6px 0 2px;font-size:14px}
.sm-threads{list-style:none;margin:0;padding:0}
.sm-threads a{display:grid;grid-template-columns:1fr auto;gap:0 8px;padding:10px 6px;border-bottom:1px solid #f1f5f9;color:var(--sm-text)!important;position:relative}
.sm-threads a:hover{background:#f8fafc}
.sm-th-title{font-weight:700;font-size:14px}
.sm-th-last{grid-column:1;color:var(--sm-muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sm-threads small{grid-column:2;grid-row:1;color:var(--sm-muted);font-size:11px}
.sm-threads .sm-dot-count{grid-column:2;grid-row:2;justify-self:end}
.sm-chat-body{max-height:60vh;min-height:240px;overflow-y:auto;padding:14px;background:#f8fafc;display:flex;flex-direction:column;gap:8px}
.sm-bubble{max-width:80%;background:#fff;border:1px solid var(--sm-border);border-radius:14px 14px 14px 4px;padding:8px 12px;align-self:flex-end}
.sm-bubble.mine{align-self:flex-start;background:#dbeafe;border-color:#bfdbfe;border-radius:14px 14px 4px 14px}
.sm-bubble b{font-size:12px;color:var(--sm-primary)}
.sm-bubble p{margin:0;font-size:14px}
.sm-bubble small{font-size:10px;color:var(--sm-muted)}
.sm-chat-form{display:flex;gap:8px;padding:10px;border-top:1px solid var(--sm-border)}
.sm-chat-form textarea{flex:1;border:1px solid var(--sm-border);border-radius:10px;padding:8px 10px;resize:vertical;min-height:42px}

/* forms */
.sm-form label{display:block;margin-bottom:12px;font-size:14px;font-weight:500}
.sm-form input:not([type=checkbox]):not([type=radio]):not([type=file]),.sm-form select,.sm-form textarea,.sm-range input,.sm-datepick input,#subsel{display:block;width:100%;margin-top:4px;padding:9px 12px;border:1px solid var(--sm-border);border-radius:10px;background:#fff;font-weight:400}
.sm-form input:disabled{background:#f1f5f9;color:var(--sm-muted)}
.sm-fgrid{display:grid;grid-template-columns:1fr;gap:0 12px}
@media(min-width:700px){.sm-fgrid{grid-template-columns:repeat(3,1fr)}}
.sm-targets{border:1px solid var(--sm-border);border-radius:12px;padding:8px 14px;margin:0 0 14px}
.sm-targets h4{margin:10px 0 4px;font-size:14px}
.sm-checks{display:flex;flex-wrap:wrap;gap:6px 16px;margin:6px 0}
.sm-checks label{display:inline-flex!important;align-items:center;gap:6px;font-weight:400!important;margin:0!important}
.sm-inline select{display:inline-block!important;width:auto!important}
.sm-dl{display:grid;grid-template-columns:110px 1fr;gap:6px;margin:0;font-size:14px}
.sm-dl dt{color:var(--sm-muted)}.sm-dl dd{margin:0}

/* register */
.sm-reg-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.sm-reg-head h2{margin:0;font-size:20px}.sm-reg-head h2 span{color:var(--sm-muted);font-weight:400}
.sm-reg-head p{margin:0;color:var(--sm-muted);font-size:13px}
.sm-reg-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.sm-reg-actions #subsel{width:auto;margin:0}
.sm-notes-box{background:#fffbeb;border:1px solid #fde68a;border-radius:12px;padding:10px 14px;margin-bottom:12px;font-size:14px}
.sm-notes-box ul{margin:4px 0 0;padding-right:18px}.sm-notes-box p{margin:4px 0 0}
.sm-sesnav{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.sm-sesnav-cur{flex:1;text-align:center;background:#fff;border-radius:12px;padding:6px 10px;box-shadow:var(--sm-shadow);display:flex;flex-direction:column;align-items:center;font-size:14px}
.sm-sesnav .sm-btn{padding:9px 10px;font-size:13px}
.sm-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.sm-table{width:100%;border-collapse:collapse;font-size:14px}
.sm-table th{background:#f8fafc;color:#334155;font-weight:700;padding:8px;border-bottom:2px solid var(--sm-border);white-space:nowrap;text-align:right}
.sm-table td{padding:7px 8px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.sm-table tr.st-absent td{background:#fef2f2}.sm-table tr.st-late td{background:#fffbeb}
.sm-reg td.nm{display:flex;align-items:center;gap:8px;min-width:170px}
.sm-reg td.nm span{display:flex;flex-direction:column;line-height:1.4}
.sm-reg td.nm small{color:var(--sm-muted);font-size:11px}
.sm-seg{display:inline-flex;border:1px solid var(--sm-border);border-radius:10px;overflow:hidden}
.sm-seg button{border:0;background:#fff;padding:6px 10px;cursor:pointer;font-size:13px;color:#475569}
.sm-seg button+button{border-right:1px solid var(--sm-border)}
.sm-seg button.present.on{background:#16a34a;color:#fff}.sm-seg button.absent.on{background:#dc2626;color:#fff}.sm-seg button.late.on{background:#f59e0b;color:#fff}
.sm-seg button:disabled{cursor:default}
.late-min{width:64px;margin-right:6px;padding:5px;border:1px solid #f59e0b;border-radius:8px;text-align:center}
.sm-reg input.grade{width:56px;padding:6px 4px;border:1px solid var(--sm-border);border-radius:8px;text-align:center}
.sm-reg input.grade.bad{border-color:#dc2626;background:#fef2f2}
.sm-reg input.comment{width:100%;min-width:160px;padding:6px 8px;border:1px solid var(--sm-border);border-radius:8px}
.sm-reg input:disabled{background:transparent;border-color:transparent;color:var(--sm-text)}
.sm-savebar{position:sticky;bottom:64px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border-top:1px solid var(--sm-border);padding:10px 14px;border-radius:0 0 var(--sm-radius) var(--sm-radius);z-index:5}
@media(min-width:900px){.sm-savebar{bottom:0}}
.sm-save-state{font-size:13px;color:var(--sm-green)}.sm-save-state.warn{color:var(--sm-amber)}
.sm-bulk{font-size:13px}
/* register as cards on phones */
@media(max-width:760px){
  .sm-reg thead{display:none}
  .sm-reg,.sm-reg tbody,.sm-reg tr,.sm-reg td{display:block;width:100%}
  .sm-reg tr{border:1px solid var(--sm-border);border-radius:12px;margin:0 0 10px;padding:8px;background:#fff}
  .sm-reg td{border:0;padding:4px}
  .sm-reg td.rn{display:none}
  .sm-reg td.gcol{display:inline-flex;width:50%;align-items:center;gap:6px;font-size:13px}
  .sm-reg td.gcol::before,.sm-reg td.cm::before{content:attr(data-label);color:var(--sm-muted);min-width:64px}
  .sm-reg td.att{display:flex;align-items:center;flex-wrap:wrap}
  .sm-stack thead{display:none}
  .sm-stack,.sm-stack tbody,.sm-stack tr,.sm-stack td{display:block;width:100%}
  .sm-stack tr{border:1px solid var(--sm-border);border-radius:12px;margin-bottom:8px;padding:6px 10px}
  .sm-stack td{border:0;padding:3px 0}
  .sm-stack td::before{content:attr(data-label) ": ";color:var(--sm-muted);font-size:12px}
}
.sm-future td{color:#94a3b8;background:#f8fafc}
.sm-seslist{list-style:none;margin:0;padding:0;max-height:60vh;overflow:auto}
.sm-seslist li a{display:block;padding:8px 10px;border-bottom:1px solid #f1f5f9;color:var(--sm-text)!important}
.sm-seslist li.future a{color:#94a3b8!important}
.sm-seslist li.cur a{background:#eff6ff;font-weight:700}
.sm-notes-list{list-style:none;padding:0;margin:0}
.sm-notes-list li{border:1px solid var(--sm-border);border-radius:10px;padding:8px 12px;margin-bottom:8px}
.sm-notes-list li.past{opacity:.6}
.sm-notes-list p{margin:4px 0}

/* badges & chips */
.sm-badge{display:inline-block;padding:1px 10px;border-radius:20px;font-size:12px;font-weight:500}
.sm-badge.present{background:#dcfce7;color:#166534}.sm-badge.absent{background:#fee2e2;color:#991b1b}.sm-badge.late{background:#fef3c7;color:#92400e}.sm-badge.muted{background:#f1f5f9;color:#64748b}
.sm-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:20px;background:#f1f5f9;font-size:12px;margin:2px}
.sm-chip button{border:0;background:none;cursor:pointer;color:#ef4444;padding:0 2px}
.g-homework{background:#ccfbf1}.g-question{background:#dbeafe}.g-exam{background:#e0e7ff}.g-discipline{background:#fce7f3}
.sm-glist{display:flex;flex-wrap:wrap}
.sm-events{list-style:none;margin:0;padding:0}
.sm-events li{padding:7px 0;border-bottom:1px solid #f1f5f9;font-size:14px}
.sm-events li small{display:block;color:var(--sm-muted);font-size:12px}
.sm-parents{margin:-6px 0 12px}
.sm-student-list{columns:1;padding-right:20px;margin:0}
@media(min-width:700px){.sm-student-list{columns:3}}
.sm-student-list li{break-inside:avoid;margin-bottom:4px}
.sm-student-list a{display:inline-flex;align-items:center;gap:8px;color:var(--sm-text)!important}
.sm-student-list span{display:flex;flex-direction:column;line-height:1.3;font-size:14px}.sm-student-list small{color:var(--sm-muted);font-size:11px}
.sm-subj-cards{display:grid;grid-template-columns:1fr;gap:0 14px}
@media(min-width:900px){.sm-subj-cards{grid-template-columns:1fr 1fr}}

/* charts */
.sm-chart{position:relative;height:260px}
.sm-chart.sm{height:200px}.sm-chart.tall{height:380px}

/* tabs */
.sm-tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:12px;padding-bottom:2px}
.sm-tabs a{padding:7px 14px;border-radius:10px;background:#fff;border:1px solid var(--sm-border);color:var(--sm-text)!important;white-space:nowrap;font-size:14px}
.sm-tabs a.on{background:var(--sm-primary-2);color:#fff!important;border-color:var(--sm-primary-2)}
.sm-range{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.sm-range input{width:140px!important;display:inline-block!important;margin:0!important}

/* principal */
.sm-mgr-head{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,#1e3a8a,#3b82f6);color:#fff;border-radius:18px;padding:18px;margin-bottom:12px}
.sm-mgr-head h1{margin:0;font-size:22px;color:#fff}.sm-mgr-head p{margin:2px 0 0;opacity:.9;font-size:13px}
.sm-mgr-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;align-items:center}
.sm-datepick{display:flex;gap:6px;align-items:center;position:relative}
.sm-datepick input{width:160px!important;margin:0!important}
.sm-bigsearch{position:relative;display:flex;align-items:center;background:#fff;border-radius:14px;box-shadow:var(--sm-shadow);padding:4px 12px;margin-bottom:14px;border:1px solid var(--sm-border)}
.sm-bigsearch input{flex:1;border:0;padding:10px;font-size:15px;background:transparent;outline:0}
.sm-ss-res{position:absolute;top:100%;right:0;left:0;background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.15);z-index:20;max-height:360px;overflow:auto;margin-top:4px}
.sm-ss-res a{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid #f1f5f9;color:var(--sm-text)!important}
.sm-ss-res a:hover{background:#f8fafc}
.sm-ss-res span{display:flex;flex-direction:column;line-height:1.4}.sm-ss-res small{color:var(--sm-muted);font-size:12px}
.sm-quick{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sm-quick a{display:flex;align-items:center;gap:8px;padding:14px;border-radius:12px;background:#f8fafc;border:1px solid var(--sm-border);color:var(--sm-text)!important;font-weight:500}
.sm-quick a .sm-ic{color:var(--sm-primary-2)}

/* grid */
.sm-grid-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.sm-search-in{display:flex;align-items:center;gap:6px;border:1px solid var(--sm-border);border-radius:10px;padding:0 10px;background:#fff;flex:1;min-width:200px}
.sm-search-in input{border:0!important;outline:0;padding:8px 4px!important;flex:1;background:transparent;margin:0!important}
.sm-g-cols{position:relative}
.sm-g-cols summary{list-style:none}
.sm-g-colbox{position:absolute;z-index:10;background:#fff;border:1px solid var(--sm-border);border-radius:10px;padding:8px 12px;box-shadow:0 8px 20px rgba(0,0,0,.1);min-width:180px}
.sm-g-colbox label{display:block;font-size:13px;white-space:nowrap}
.sm-g-count{font-size:13px;color:var(--sm-muted)}
.sm-g-table th.sm-sort{cursor:pointer;user-select:none}
.sm-g-table th.sm-sort.asc::after{content:" ▲";font-size:10px}.sm-g-table th.sm-sort.desc::after{content:" ▼";font-size:10px}
.sm-g-filters th{padding:4px;background:#fff}
.sm-g-filters input,.sm-g-filters select{width:100%;min-width:70px;padding:4px 6px;border:1px solid var(--sm-border);border-radius:6px;font-size:12px;font-weight:400}
.sm-g-more{text-align:center;margin-top:10px}

/* calendar */
.smj-cal{background:#fff;border-radius:12px;user-select:none}
.smj-head{display:flex;align-items:center;justify-content:space-between;padding:6px 4px 10px}
.smj-head b{font-size:16px}
.smj-nav{border:1px solid var(--sm-border);background:#fff;border-radius:8px;width:34px;height:34px;cursor:pointer;font-size:20px;line-height:1}
.smj-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.smj-dn{text-align:center;font-size:12px;color:var(--sm-muted);padding:2px 0}
.smj-day{min-height:62px;border:1px solid #eef2f7;background:#fff;border-radius:10px;cursor:pointer;padding:4px;display:flex;flex-direction:column;align-items:stretch;text-align:right;font-family:inherit;overflow:hidden}
.smj-day:hover{border-color:#93c5fd}
.smj-n{font-size:13px;font-weight:700}
.smj-day.is-fri .smj-n{color:#dc2626}
.smj-day.is-today{border-color:var(--sm-primary-2);box-shadow:inset 0 0 0 1px var(--sm-primary-2)}
.smj-day.is-sel{background:#eff6ff}
.smj-day.has-mark{background:#f0fdf4}.smj-day.has-mark.is-sel{background:#dbeafe}
.smj-mark{display:flex;flex-direction:column;gap:1px}
.smj-mark em{font-style:normal;font-size:10px;background:#bbf7d0;color:#166534;border-radius:4px;padding:0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smj-dot{display:block;width:6px;height:6px;border-radius:50%;background:#16a34a;margin:2px auto 0}
.smj-compact .smj-day{min-height:34px;align-items:center;justify-content:center;text-align:center;padding:2px}
.smj-pop{position:absolute;z-index:60;top:100%;right:0;width:280px;background:#fff;border:1px solid var(--sm-border);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.15);padding:8px;margin-top:4px}
@media(max-width:600px){.smj-day{min-height:48px}.smj-mark em{font-size:9px}}
.sm-cal-wrap{display:grid;grid-template-columns:1fr;gap:14px}
@media(min-width:900px){.sm-cal-wrap{grid-template-columns:3fr 2fr}}
.sm-cal-day{background:#f8fafc;border-radius:12px;padding:10px 14px}
.sm-cal-day h4{margin:0 0 8px}
.sm-day-sub{background:#fff;border-radius:10px;padding:8px 12px;margin-bottom:8px;border-right:4px solid #16a34a}
.sm-day-sub small{color:var(--sm-muted);margin-right:6px}
.sm-day-sub ul{margin:4px 0 0;padding-right:18px;font-size:14px}
.sm-month-list h4{margin:16px 0 8px}
.sm-tasks{list-style:none;margin:0;padding:0}
.sm-tasks li{display:grid;grid-template-columns:auto 1fr;gap:0 10px;padding:8px 0;border-bottom:1px solid #f1f5f9}
.sm-tasks li.past{opacity:.55}
.sm-task-date{grid-row:span 2;background:#eff6ff;color:var(--sm-primary);border-radius:8px;padding:4px 8px;font-size:12px;align-self:start}
.sm-tasks p{margin:0;font-size:14px}

/* modal & toast */
.sm-modal{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:1000;display:flex;align-items:flex-end;justify-content:center}
@media(min-width:700px){.sm-modal{align-items:center}}
.sm-modal-box{background:#fff;width:100%;max-width:520px;max-height:90vh;overflow:auto;border-radius:18px 18px 0 0}
.sm-modal-box.wide{max-width:720px}
@media(min-width:700px){.sm-modal-box{border-radius:18px}}
.sm-modal-h{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--sm-border);position:sticky;top:0;background:#fff}
.sm-modal-h h3{margin:0;font-size:16px}
.sm-x{border:0;background:none;font-size:26px;cursor:pointer;line-height:1}
.sm-modal-b{padding:14px 16px}
.sm-noscroll{overflow:hidden}
.sm-picked{margin-bottom:8px}
.sm-rlist{max-height:240px;overflow:auto;border:1px solid var(--sm-border);border-radius:10px;margin:8px 0 12px}
.sm-rlist button{display:flex;justify-content:space-between;width:100%;border:0;border-bottom:1px solid #f1f5f9;background:#fff;padding:8px 12px;cursor:pointer;text-align:right}
.sm-rlist button.on{background:#dbeafe}
.sm-rlist small{color:var(--sm-muted)}
.sm-toast{position:fixed;bottom:84px;right:50%;transform:translate(50%,20px);background:#0f172a;color:#fff;padding:10px 18px;border-radius:12px;z-index:2000;opacity:0;transition:.25s;max-width:92vw;font-size:14px}
.sm-toast.show{opacity:1;transform:translate(50%,0)}
.sm-toast.err{background:#b91c1c}
.sm-import{border:1px solid var(--sm-border);border-radius:12px;padding:12px;margin-bottom:10px}
.sm-import-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:8px}
#sm-print{display:none}

/* print */
@media print{
  @page{size:A4;margin:12mm}
  body{background:#fff!important}
  .sm-top,.sm-bottom,.sm-back,.sm-btn,.sm-link,.sm-savebar,.sm-sesnav .sm-btn,.sm-bigsearch,.sm-mgr-actions,.sm-tabs,.sm-range,.sm-grid-tools,.sm-g-filters,.sm-toast,#wpadminbar,.site-header,.site-footer,.sm-datepick{display:none!important}
  .sm-main{padding:0!important;max-width:none}
  .sm-card{box-shadow:none;border:1px solid #cbd5e1;break-inside:avoid}
  .sm-chart{height:220px}
  .sm-table{font-size:11px}
  .sm-table th{background:#e2e8f0!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .sm-badge,.sm-tile,.sm-cs-card,.sm-class-card,.sm-table tr.st-absent td,.sm-table tr.st-late td{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .sm-cols2{grid-template-columns:1fr 1fr}
  body.sm-printing-part > *:not(#sm-print){display:none!important}
  body.sm-printing-part #sm-print{display:block!important}
  .sm-print-head{display:flex;justify-content:space-between;border-bottom:2px solid #1e3a8a;padding-bottom:6px;margin-bottom:10px;font-size:13px}
}
[hidden]{display:none!important}
@media(max-width:600px){.sm-sesnav{flex-wrap:wrap}.sm-sesnav-cur{order:-1;flex-basis:100%}.sm-sesnav .sm-btn{flex:1}}
.sm-register input:disabled::placeholder,.sm-app input:disabled::placeholder{color:transparent}
