
@layer ag-modules{
:root{--portal-bg:#f5f7fb;--portal-surface:var(--ag-surface);--portal-text:var(--ag-text);--portal-muted:#6b7280;--portal-border:#e5e9f1;--portal-primary:var(--ag-primary);--portal-primary-soft:var(--ag-primary-soft);--portal-success:#18875d;--portal-warning:#b76b00;--portal-danger:#c43b4d}
*{box-sizing:border-box}html{direction:rtl}body.portal-body{margin:0;background:var(--portal-bg);color:var(--portal-text);font-family:var(--ag-font-family,Cairo);line-height:1.65}.portal-shell{max-width:1180px;margin:auto;padding:24px}.portal-topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.portal-brand{display:flex;align-items:center;gap:12px}.portal-mark{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#172a55,var(--ag-primary));color:var(--ag-on-primary);display:grid;place-items:center;font-weight:800}.portal-brand strong{display:block}.portal-brand small{color:var(--portal-muted)}.portal-actions{display:flex;align-items:center;gap:8px}.portal-hero{background:linear-gradient(135deg,#172a55,var(--ag-primary));color:var(--ag-on-primary);border-radius:24px;padding:26px;margin-bottom:20px;box-shadow:0 12px 38px rgba(23,42,85,.13)}.portal-hero h1{margin:0 0 6px;font-size:28px}.portal-hero p{margin:0;color:#e7ecff}.portal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.portal-card{background:var(--ag-surface);border:1px solid var(--portal-border);border-radius:18px;padding:18px;box-shadow:0 2px 12px rgba(23,32,51,.04)}.portal-card h2,.portal-card h3{margin-top:0}.portal-kpi strong{font-size:30px;display:block}.portal-muted{color:var(--portal-muted)}.portal-section{margin-top:20px}.portal-section-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:10px}.portal-list{display:grid;gap:10px}.portal-row{padding:13px 14px;border:1px solid var(--portal-border);border-radius:13px;background:var(--ag-surface);display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.portal-row-main{min-width:0}.portal-row-main strong{display:block}.portal-row-meta{color:var(--portal-muted);font-size:13px}.portal-badge{display:inline-flex;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700;background:var(--portal-primary-soft);color:var(--portal-primary)}.portal-badge.success{background:#eaf8f1;color:var(--portal-success)}.portal-badge.warning{background:#fff6df;color:var(--portal-warning)}.portal-badge.danger{background:#fff0f2;color:var(--portal-danger)}.portal-btn{appearance:none;border:1px solid transparent;border-radius:10px;padding:9px 14px;font:inherit;font-weight:700;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-height:40px}.portal-btn.primary{background:var(--portal-primary);color:var(--ag-on-primary)}.portal-btn.secondary{background:var(--ag-surface);border-color:var(--portal-border);color:var(--portal-text)}.portal-btn.ghost{background:var(--portal-primary-soft);color:var(--portal-primary)}.portal-btn.danger{background:#fff0f2;color:var(--portal-danger);border-color:#f5d0d5}.portal-select,.portal-input{width:100%;min-height:44px;border:1px solid var(--ag-border);border-radius:10px;padding:10px 12px;font:inherit;background:var(--ag-surface);color:var(--portal-text)}.portal-field label{display:block;font-weight:700;font-size:13px;margin-bottom:6px}.portal-form{display:grid;gap:14px}.portal-alert{border:1px solid #f0d2d7;background:#fff2f4;color:#a32c3c;border-radius:12px;padding:12px 14px;margin-bottom:14px}.portal-empty{text-align:center;padding:24px;color:var(--portal-muted);background:var(--ag-surface);border:1px dashed var(--ag-border);border-radius:14px}.portal-permissions{display:flex;gap:7px;flex-wrap:wrap}.portal-login{max-width:460px;margin:7vh auto;padding:18px}.portal-login .portal-card{padding:26px}.portal-login h1{margin:0 0 6px}.portal-divider{height:1px;background:var(--portal-border);margin:18px 0}.portal-footer{color:var(--portal-muted);font-size:12px;text-align:center;margin-top:20px}@media(max-width:900px){.portal-shell{padding:16px}.portal-grid{grid-template-columns:1fr}.portal-topbar{align-items:flex-start}.portal-section-head{align-items:flex-start;flex-direction:column}}@media(max-width:560px){.portal-shell{padding:11px}.portal-topbar{flex-direction:column}.portal-actions{width:100%}.portal-actions .portal-btn{flex:1}.portal-hero{border-radius:18px;padding:20px}.portal-hero h1{font-size:23px}.portal-row{flex-direction:column}.portal-login{margin:2vh auto;padding:10px}}


/* Portal functional navigation */
.portal-nav{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
    padding:10px 0 16px;
}
.portal-nav a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:8px 12px;
    border-radius:10px;
    text-decoration:none;
    color:var(--text,var(--ag-text));
    background:var(--ag-surface);
    border:1px solid #e6eaf0;
    font-weight:700;
    font-size:13px;
}
.portal-nav a:hover,
.portal-nav a.active{
    color:var(--ag-primary);
    background:var(--ag-primary-soft);
    border-color:#cfd7ff;
}
@media(max-width:640px){
    .portal-nav{
        flex-wrap:nowrap;
        overflow-x:auto;
        padding-bottom:12px;
        -webkit-overflow-scrolling:touch;
    }
    .portal-nav a{white-space:nowrap;flex:0 0 auto}
}

/* Closure Wave 6B — Student Portal Digital Identity */
.portal-identity-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:18px;align-items:start}
.portal-identity-card{overflow:hidden;position:relative}.portal-identity-card:before{content:"";position:absolute;inset:0 0 auto 0;height:5px;background:linear-gradient(90deg,#172a55,var(--ag-primary))}
.portal-identity-card-head{display:flex;align-items:center;gap:16px;margin-bottom:20px}.portal-identity-card-head h1{margin:2px 0 4px;font-size:25px}.portal-identity-avatar{width:64px;height:64px;flex:0 0 64px;border-radius:20px;background:var(--portal-primary-soft);color:var(--portal-primary);display:grid;place-items:center;font-size:28px;font-weight:800}.portal-identity-number{color:var(--portal-muted)}
.portal-identity-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.portal-identity-meta>div{padding:12px;border:1px solid var(--portal-border);border-radius:13px;background:#fafbfe}.portal-identity-meta span{display:block;color:var(--portal-muted);font-size:12px;margin-bottom:4px}.portal-identity-meta strong{display:block;font-size:14px}
.portal-identity-qr-card{text-align:center}.portal-identity-qr-card .portal-section-head{text-align:right}.portal-identity-qr-stage{display:grid;place-items:center;gap:10px;transition:opacity .18s ease}.portal-identity-qr-stage.is-hidden{display:none}.portal-identity-qr-stage canvas{max-width:100%;height:auto;border:1px solid var(--portal-border);border-radius:18px;background:var(--ag-surface);padding:8px}.portal-identity-countdown{font-size:13px;color:var(--portal-muted)}.portal-identity-countdown strong{color:var(--portal-primary)}.portal-identity-actions{display:flex;justify-content:center;margin-top:14px}.portal-identity-actions .portal-btn{min-width:160px}.portal-identity-message{min-height:26px}.portal-identity-security{font-size:12px;color:var(--portal-muted);margin:16px 0 0}
@media(max-width:900px){.portal-identity-layout{grid-template-columns:1fr}.portal-identity-meta{grid-template-columns:1fr}}


/* Closure Wave 7C — Portal/PWA visual unification */
.portal-auth-brand{margin-bottom:20px}
.portal-auth-brand.compact{margin-bottom:18px}
.portal-choice-group{display:flex;gap:10px;flex-wrap:wrap}
.portal-choice{display:flex;align-items:center;gap:7px;margin:0;padding:9px 12px;border:1px solid var(--portal-border);border-radius:11px;background:var(--ag-surface);cursor:pointer;font-weight:700}
.portal-choice input{accent-color:var(--portal-primary)}
.portal-auth-links{margin:16px auto 0;text-align:center;font-size:13px;line-height:1.9;color:var(--portal-muted)}
.portal-auth-links a,.portal-footer a{color:var(--portal-primary);text-decoration:none;font-weight:700}
.portal-auth-links a:hover,.portal-footer a:hover{text-decoration:underline}
.portal-inline-form{margin:0}
.portal-alert.success{border-color:#c8ead9;background:var(--ag-success-soft);color:var(--ag-success)}
.portal-pwa-note{margin-top:12px;color:var(--portal-muted);font-size:12px;line-height:1.7}
.portal-card .portal-btn.primary[type="submit"]{width:100%}
.portal-login .portal-field input[type="radio"]{width:auto}
@media(max-width:560px){
  .portal-login .portal-card{padding:20px 16px}
  .portal-choice-group{display:grid;grid-template-columns:1fr 1fr}
  .portal-choice{justify-content:center}
  .portal-auth-links{padding-inline:4px}
}

}