/* =====================================================================
   SAU UMS — design system
   Colours of Sindh Agriculture University, Tandojam: deep green + gold.
   Mobile first. Works with Bootstrap 5.3 (stored in /public/assets/vendor).
   ===================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Merriweather"; font-weight: 700; font-display: swap; src: url("../fonts/merriweather-700.woff2") format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 600; font-display: swap; src: url("../fonts/noto-nastaliq-urdu-600.woff2") format("woff2"); }

:root {
  --sau-green-950: #042617;
  --sau-green-900: #06331f;
  --sau-green-800: #0a4a2d;
  --sau-green-700: #0b5d37;
  --sau-green-600: #0f7343;
  --sau-green-500: #178a52;
  --sau-green-200: #bfe1cc;
  --sau-green-100: #e4f3ea;
  --sau-green-50:  #f2f9f5;
  --sau-gold-600:  #c99a12;
  --sau-gold-500:  #e6b422;
  --sau-gold-200:  #f6e3a4;
  --sau-gold-100:  #fbf4da;
  --sau-ink:       #15241c;
  --sau-text:      #26352d;
  --sau-muted:     #5d6d64;
  --sau-line:      #dde6e0;
  --sau-bg:        #f3f6f2;
  --sau-white:     #ffffff;
  --sau-red:       #b42318;
  --sau-amber:     #b54708;
  --sau-blue:      #1849a9;
  --sau-radius:    14px;
  --sau-radius-sm: 10px;
  --sau-shadow:    0 1px 2px rgba(6, 51, 31, .06), 0 6px 18px rgba(6, 51, 31, .06);
  --sau-shadow-lg: 0 18px 40px rgba(6, 51, 31, .16);
  --sau-sidebar:   268px;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: var(--sau-text);
  --bs-body-bg: var(--sau-bg);
  --bs-primary: #0b5d37;
  --bs-primary-rgb: 11, 93, 55;
  --bs-link-color: #0b5d37;
  --bs-link-color-rgb: 11, 93, 55;
  --bs-link-hover-color: #06331f;
  --bs-border-color: #dde6e0;
  --bs-success: #0f7343;
  --bs-success-rgb: 15, 115, 67;
  --bs-focus-ring-color: rgba(23, 138, 82, .25);
}

html { -webkit-text-size-adjust: 100%; }
body { font-size: .94rem; line-height: 1.55; background: var(--sau-bg); color: var(--sau-text); }
h1, h2, h3, h4, h5, h6 { color: var(--sau-ink); font-weight: 700; letter-spacing: -.01em; }
.font-serif { font-family: "Merriweather", Georgia, serif; }
.urdu { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; direction: rtl; line-height: 2.1; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .app-menu a:hover, .sau-nav a:hover, .tile-link:hover { text-decoration: none; }
::selection { background: var(--sau-gold-200); }
:focus-visible { outline: 3px solid rgba(230, 180, 34, .55); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--sau-gold-500); color: #000; padding: .5rem 1rem; }
.skip-link:focus { left: 0; }

/* ---------- Bootstrap colour overrides ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .65rem; font-size: .82rem; }
.btn-primary, .btn-success {
  --bs-btn-bg: var(--sau-green-700); --bs-btn-border-color: var(--sau-green-700);
  --bs-btn-hover-bg: var(--sau-green-800); --bs-btn-hover-border-color: var(--sau-green-800);
  --bs-btn-active-bg: var(--sau-green-900); --bs-btn-active-border-color: var(--sau-green-900);
  --bs-btn-disabled-bg: var(--sau-green-500); --bs-btn-disabled-border-color: var(--sau-green-500);
}
.btn-outline-primary, .btn-outline-success {
  --bs-btn-color: var(--sau-green-700); --bs-btn-border-color: var(--sau-green-700);
  --bs-btn-hover-bg: var(--sau-green-700); --bs-btn-hover-border-color: var(--sau-green-700); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--sau-green-800); --bs-btn-active-color: #fff;
}
.btn-gold {
  --bs-btn-bg: var(--sau-gold-500); --bs-btn-border-color: var(--sau-gold-500); --bs-btn-color: #2a1f00;
  --bs-btn-hover-bg: var(--sau-gold-600); --bs-btn-hover-border-color: var(--sau-gold-600); --bs-btn-hover-color: #1d1500;
  --bs-btn-active-bg: var(--sau-gold-600); --bs-btn-active-color: #1d1500;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--sau-line); --bs-btn-hover-bg: var(--sau-green-50); --bs-btn-hover-border-color: var(--sau-green-200); }
.text-sau { color: var(--sau-green-700) !important; }
.text-gold { color: var(--sau-gold-600) !important; }
.bg-sau { background: var(--sau-green-700) !important; color: #fff; }
.bg-sau-soft { background: var(--sau-green-50) !important; }
.bg-gold-soft { background: var(--sau-gold-100) !important; }
.form-control, .form-select { border-radius: 10px; border-color: #cfdad3; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--sau-green-500); box-shadow: 0 0 0 .2rem rgba(23, 138, 82, .18); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-label { font-weight: 600; font-size: .82rem; color: var(--sau-ink); margin-bottom: .3rem; }
.form-label.req::after { content: " *"; color: var(--sau-red); }
.form-text { font-size: .78rem; }
/* cards, tables and tick boxes are white on the grey page (they took the page colour before) */
.card { --bs-card-bg: #fff; }
.table { --bs-table-bg: #fff; }
.form-control, .form-select { background-color: #fff; }
.form-check-input { --bs-form-check-bg: #fff; background-color: #fff; border: 1.5px solid #8fa79a; width: 1.1em; height: 1.1em; cursor: pointer; }
.form-check-input:hover:not(:disabled) { border-color: var(--sau-green-600); }
.form-check-input:disabled { opacity: .45; cursor: not-allowed; }
.form-check-input:checked { background-color: var(--sau-green-700); border-color: var(--sau-green-700); }
.perm-matrix tbody tr:not(.grp-row):hover td { background: var(--sau-green-50); }
.form-switch .form-check-input:focus { border-color: var(--sau-green-500); }
.nav-pills .nav-link.active { background: var(--sau-green-700); }
.nav-tabs .nav-link { color: var(--sau-muted); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--sau-green-700); border-bottom-color: #fff; }
.page-link { color: var(--sau-green-700); }
.active > .page-link, .page-link.active { background: var(--sau-green-700); border-color: var(--sau-green-700); }
.progress-bar { background-color: var(--sau-green-600); }
.dropdown-menu { border-color: var(--sau-line); border-radius: 12px; box-shadow: var(--sau-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item:active { background: var(--sau-green-700); }
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--sau-shadow-lg); }
.modal-header { border-bottom-color: var(--sau-line); }
.alert { border-radius: 12px; border-width: 0 0 0 4px; }
.alert-success { background: var(--sau-green-50); border-color: var(--sau-green-600); color: var(--sau-green-900); }
.alert-danger { background: #fef3f2; border-color: var(--sau-red); color: #7a271a; }
.alert-warning { background: #fffaeb; border-color: #f79009; color: #7a2e0e; }
.alert-info { background: #eff8ff; border-color: #2e90fa; color: #194185; }

/* ---------- soft badges ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.badge-soft-success { background: #dcfae6; color: #085d3a; }
.badge-soft-warning { background: #fef0c7; color: #93370d; }
.badge-soft-danger  { background: #fee4e2; color: #912018; }
.badge-soft-info    { background: #d1e9ff; color: #1849a9; }
.badge-soft-secondary { background: #eaecf0; color: #344054; }
.badge-soft-gold    { background: var(--sau-gold-100); color: #7a5b00; }
.badge-soft-dark    { background: #d0d5dd; color: #101828; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--sau-line); border-radius: var(--sau-radius); box-shadow: var(--sau-shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--sau-line); font-weight: 700; color: var(--sau-ink); padding: .8rem 1rem; border-radius: var(--sau-radius) var(--sau-radius) 0 0 !important; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-header > .bi, .card-header > span > .bi { color: var(--sau-green-600); }
.card-footer { background: #fafcfb; border-top-color: var(--sau-line); }
.card-accent { border-top: 4px solid var(--sau-green-700); }
.card-accent-gold { border-top: 4px solid var(--sau-gold-500); }

.stat-tile { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--sau-line); border-radius: var(--sau-radius); box-shadow: var(--sau-shadow); height: 100%; color: inherit; }
.stat-tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--sau-green-100); color: var(--sau-green-700); flex: 0 0 auto; }
.stat-tile .ic.gold { background: var(--sau-gold-100); color: var(--sau-gold-600); }
.stat-tile .ic.red { background: #fee4e2; color: var(--sau-red); }
.stat-tile .ic.blue { background: #d1e9ff; color: var(--sau-blue); }
.stat-tile .num { font-size: 1.45rem; font-weight: 700; color: var(--sau-ink); line-height: 1.1; }
.stat-tile .lbl { font-size: .78rem; color: var(--sau-muted); font-weight: 500; }
a.stat-tile:hover { border-color: var(--sau-green-200); transform: translateY(-1px); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--sau-muted); }
.empty-state .bi { font-size: 2.2rem; color: var(--sau-green-200); display: block; margin-bottom: .4rem; }

/* ---------- tables ---------- */
.table { --bs-table-striped-bg: #f7faf8; --bs-table-hover-bg: #eff6f2; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; border-bottom-color: #e8eee9; }
.table thead th { background: var(--sau-green-50); color: var(--sau-green-900); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--sau-green-200); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--sau-radius) var(--sau-radius); }
.table-wrap .table { min-width: 560px; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " \2195"; opacity: .35; font-size: .8em; }
th[data-sort].asc::after { content: " \2191"; opacity: .9; }
th[data-sort].desc::after { content: " \2193"; opacity: .9; }
.td-actions { white-space: nowrap; text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }

/* phones: tables marked .table-stack become cards */
@media screen and (max-width: 767.98px) {
  .table-stack { min-width: 0 !important; }
  .table-stack thead { display: none; }
  .table-stack tbody tr { display: block; border: 1px solid var(--sau-line); border-radius: 12px; margin: .6rem; background: #fff; box-shadow: var(--sau-shadow); }
  .table-stack tbody td { display: flex; justify-content: space-between; gap: 1rem; text-align: right; border: 0; border-bottom: 1px dashed #e7ede9; padding: .5rem .8rem; }
  .table-stack tbody td:last-child { border-bottom: 0; }
  .table-stack tbody td::before { content: attr(data-label); font-weight: 600; color: var(--sau-muted); text-align: left; font-size: .78rem; }
  .table-stack tbody td.td-actions { justify-content: flex-end; }
  .table-stack tbody td.td-actions::before { content: none; }
}

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar .form-control, .toolbar .form-select { min-width: 140px; }
.toolbar .grow { flex: 1 1 220px; }
.filter-card .card-body { padding: .8rem 1rem; }

/* =====================================================================
   PUBLIC WEBSITE (same look as the university website)
   ===================================================================== */
.sau-topbar { background: var(--sau-green-950); color: #cfe3d7; font-size: .8rem; }
.sau-topbar a { color: #e6f1ea; }
.sau-topbar a:hover { color: var(--sau-gold-500); }
.sau-topbar .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1rem; padding-top: .35rem; padding-bottom: .35rem; }
.sau-topbar .social a { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.08); margin-left: .25rem; }

.sau-header { background: #fff; border-bottom: 4px solid var(--sau-gold-500); }
.sau-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.sau-brand { display: flex; align-items: center; gap: .85rem; color: inherit; min-width: 0; }
.sau-brand:hover { text-decoration: none; }
.sau-brand img { width: 64px; height: auto; flex: 0 0 auto; }
.sau-brand .en { font-family: "Merriweather", Georgia, serif; font-weight: 700; color: var(--sau-green-800); font-size: 1.12rem; line-height: 1.25; }
.sau-brand .ur { font-family: "Noto Nastaliq Urdu", serif; color: var(--sau-gold-600); font-size: .95rem; line-height: 2; direction: rtl; text-align: left; }
.sau-brand .sub { font-size: .74rem; color: var(--sau-muted); letter-spacing: .02em; }
@media (min-width: 992px) { .sau-brand img { width: 82px; } .sau-brand .en { font-size: 1.45rem; } .sau-brand .ur { font-size: 1.1rem; } }

.sau-nav { background: linear-gradient(180deg, var(--sau-green-700), var(--sau-green-800)); position: sticky; top: 0; z-index: 1020; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.sau-nav .container { display: flex; align-items: center; justify-content: space-between; }
.sau-nav ul { list-style: none; margin: 0; padding: 0; display: none; }
.sau-nav ul.open { display: block; width: 100%; padding-bottom: .5rem; }
.sau-nav li a { display: block; color: #f2f8f4; padding: .8rem .9rem; font-weight: 600; font-size: .9rem; }
.sau-nav li a:hover, .sau-nav li a.active { background: rgba(255,255,255,.1); color: var(--sau-gold-500); }
.sau-nav .burger { background: none; border: 0; color: #fff; font-size: 1.6rem; padding: .35rem .2rem; }
.sau-nav .wrap { display: flex; flex-wrap: wrap; width: 100%; align-items: center; justify-content: space-between; }
@media (min-width: 992px) {
  .sau-nav ul { display: flex !important; width: auto; padding: 0; }
  .sau-nav .burger { display: none; }
  .sau-nav li a { padding: .95rem 1rem; border-bottom: 3px solid transparent; }
  .sau-nav li a:hover, .sau-nav li a.active { border-bottom-color: var(--sau-gold-500); background: rgba(255,255,255,.06); }
}

.sau-hero { position: relative; color: #fff; background:
    radial-gradient(1000px 400px at 85% -10%, rgba(230,180,34,.25), transparent 60%),
    repeating-linear-gradient(120deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px),
    linear-gradient(135deg, var(--sau-green-900), var(--sau-green-700)); padding: 2.6rem 0 4.5rem; overflow: hidden; }
.sau-hero h1 { color: #fff; font-family: "Merriweather", Georgia, serif; font-size: 1.6rem; }
.sau-hero p { color: #d5e8dc; max-width: 640px; }
.sau-hero .kicker { color: var(--sau-gold-500); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }
@media (min-width: 992px) { .sau-hero { padding: 3.6rem 0 5.5rem; } .sau-hero h1 { font-size: 2.3rem; } }
.lift { margin-top: -3rem; position: relative; z-index: 2; }

.portal-card { display: flex; flex-direction: column; gap: .5rem; background: #fff; border-radius: var(--sau-radius); padding: 1.3rem; height: 100%; border: 1px solid var(--sau-line); border-top: 4px solid var(--sau-green-700); box-shadow: var(--sau-shadow); }
.portal-card.gold { border-top-color: var(--sau-gold-500); }
.portal-card .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--sau-green-100); color: var(--sau-green-700); }
.portal-card.gold .ic { background: var(--sau-gold-100); color: var(--sau-gold-600); }
.portal-card .btn { margin-top: auto; }
.tile-link { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--sau-line); border-radius: 12px; padding: .85rem 1rem; color: var(--sau-ink); font-weight: 600; box-shadow: var(--sau-shadow); height: 100%; }
.tile-link .bi { font-size: 1.35rem; color: var(--sau-green-700); }
.tile-link:hover { border-color: var(--sau-green-200); background: var(--sau-green-50); }
.section-title { font-family: "Merriweather", Georgia, serif; color: var(--sau-green-800); font-size: 1.2rem; display: flex; align-items: center; gap: .6rem; }
.section-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--sau-gold-500), transparent); }

.sau-footer { background: var(--sau-green-950); color: #b9cfc2; margin-top: 3rem; border-top: 4px solid var(--sau-gold-500); font-size: .87rem; }
.sau-footer h6 { color: var(--sau-gold-500); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: .8rem; }
.sau-footer a { color: #dbe9e0; }
.sau-footer a:hover { color: var(--sau-gold-500); }
.sau-footer ul { list-style: none; padding: 0; margin: 0; }
.sau-footer li { margin-bottom: .4rem; }
.sau-footer .bottom { border-top: 1px solid rgba(255,255,255,.08); color: #8fab9b; font-size: .78rem; }

/* =====================================================================
   STAFF + STUDENT PANEL
   ===================================================================== */
.app-shell { min-height: 100vh; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sau-sidebar); background:
    linear-gradient(180deg, var(--sau-green-900), var(--sau-green-950)); color: #cfe3d7; z-index: 1045;
  transform: translateX(-100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.app-sidebar.open { transform: none; box-shadow: var(--sau-shadow-lg); }
.app-backdrop { position: fixed; inset: 0; background: rgba(4, 38, 23, .45); z-index: 1040; display: none; }
.app-backdrop.show { display: block; }
.app-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.07); color: #fff; }
.app-brand img { width: 42px; background: #fff; border-radius: 50%; padding: 3px; }
.app-brand b { display: block; font-family: "Merriweather", Georgia, serif; font-size: .95rem; color: #fff; line-height: 1.2; }
.app-brand small { color: var(--sau-gold-500); font-size: .72rem; font-weight: 600; letter-spacing: .04em; }
.app-menu { flex: 1; overflow-y: auto; padding: .5rem .55rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.app-menu .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7fa38e; padding: .9rem .7rem .35rem; font-weight: 700; }
.app-menu a { display: flex; align-items: center; gap: .65rem; color: #d7e8de; padding: .52rem .7rem; border-radius: 9px; font-size: .87rem; font-weight: 500; position: relative; }
.app-menu a .bi { font-size: 1.02rem; opacity: .85; width: 20px; text-align: center; }
.app-menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-menu a.active { background: rgba(230, 180, 34, .14); color: #fff; font-weight: 600; }
.app-menu a.active::before { content: ""; position: absolute; left: -.55rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sau-gold-500); }
.app-menu a .count { margin-left: auto; background: var(--sau-gold-500); color: #1d1500; border-radius: 999px; font-size: .7rem; padding: 0 .45rem; font-weight: 700; }
.app-sidebar .foot { padding: .75rem 1rem; font-size: .72rem; color: #7fa38e; border-top: 1px solid rgba(255,255,255,.07); }

.app-main { min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--sau-line); display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; min-height: 60px; }
.app-topbar .menu-btn { border: 0; background: var(--sau-green-50); color: var(--sau-green-800); width: 40px; height: 40px; border-radius: 10px; font-size: 1.3rem; display: grid; place-items: center; }
.app-topbar .ttl { font-weight: 700; color: var(--sau-ink); font-size: 1rem; line-height: 1.2; min-width: 0; }
.app-topbar .ttl small { display: block; color: var(--sau-muted); font-weight: 500; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--sau-line); border-radius: 999px; padding: .2rem .25rem .2rem .7rem; background: #fff; color: var(--sau-ink); font-weight: 600; font-size: .84rem; }
.user-chip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--sau-green-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.app-content { padding: 1rem .8rem 2rem; flex: 1; }
.app-footer { padding: .9rem 1rem; color: var(--sau-muted); font-size: .76rem; border-top: 1px solid var(--sau-line); background: #fff; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.25rem; margin: 0; }
.page-head .sub { color: var(--sau-muted); font-size: .84rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.session-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--sau-gold-100); color: #6b4f00; border: 1px solid var(--sau-gold-200); border-radius: 999px; font-size: .78rem; font-weight: 600; padding: .25rem .65rem; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) {
  .app-sidebar { transform: none; }
  .app-backdrop { display: none !important; }
  .app-main { margin-left: var(--sau-sidebar); }
  .app-topbar .menu-btn { display: none; }
  .app-content { padding: 1.4rem 1.6rem 2.5rem; }
  .page-head h1 { font-size: 1.45rem; }
}

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--sau-bg); }
.auth-side { background:
    radial-gradient(700px 300px at 100% 0, rgba(230,180,34,.22), transparent 60%),
    repeating-linear-gradient(120deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px),
    linear-gradient(160deg, var(--sau-green-900), var(--sau-green-700)); color: #fff; padding: 1.6rem 1.4rem; display: flex; flex-direction: column; justify-content: center; }
.auth-side .logo { width: 74px; background: #fff; border-radius: 50%; padding: 4px; }
.auth-side h1 { color: #fff; font-family: "Merriweather", Georgia, serif; font-size: 1.25rem; margin: .8rem 0 .1rem; }
.auth-side .ur { font-family: "Noto Nastaliq Urdu", serif; color: var(--sau-gold-500); font-size: 1.05rem; line-height: 2.1; }
.auth-side ul { list-style: none; padding: 0; margin: 1rem 0 0; display: none; }
.auth-side li { display: flex; gap: .6rem; margin-bottom: .6rem; color: #d7eadf; font-size: .9rem; }
.auth-side li .bi { color: var(--sau-gold-500); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem 2.5rem; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--sau-line); border-radius: 18px; box-shadow: var(--sau-shadow-lg); padding: 1.6rem 1.4rem; }
.auth-card h2 { font-size: 1.25rem; }
.auth-card .hint { font-size: .8rem; color: var(--sau-muted); }
.otp-input { letter-spacing: .6em; font-size: 1.4rem; text-align: center; font-weight: 700; }
@media (min-width: 992px) {
  .auth-wrap { grid-template-columns: 1.05fr 1fr; }
  .auth-side { padding: 3rem; }
  .auth-side h1 { font-size: 1.8rem; }
  .auth-side ul { display: block; }
  .auth-card { padding: 2.2rem 2rem; }
}

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .35rem .9rem; font-size: .9rem; }
.kv dt { color: var(--sau-muted); font-weight: 600; font-size: .8rem; }
.kv dd { margin: 0; color: var(--sau-ink); word-break: break-word; }
.doc-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--sau-line); background: #f7f9f8; }
.steps { display: flex; gap: .4rem; flex-wrap: wrap; counter-reset: s; }
.steps .s { flex: 1 1 120px; padding: .5rem .7rem; border-radius: 10px; background: #fff; border: 1px solid var(--sau-line); font-size: .8rem; font-weight: 600; color: var(--sau-muted); }
.steps .s.done { background: var(--sau-green-50); border-color: var(--sau-green-200); color: var(--sau-green-800); }
.steps .s.now { background: var(--sau-gold-100); border-color: var(--sau-gold-200); color: #6b4f00; }
.toast-area { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast-area .toast { border: 0; border-radius: 12px; box-shadow: var(--sau-shadow-lg); }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.perm-matrix .grp-row td { background: var(--sau-green-50); font-weight: 700; color: var(--sau-green-800); text-align: left; }
.chart-box { position: relative; height: 280px; }
.qr-box { max-width: 420px; margin: 0 auto; border-radius: 14px; overflow: hidden; border: 1px solid var(--sau-line); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cursor-pointer { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- print ---------- */
@media print {
  .app-sidebar, .app-topbar, .app-footer, .no-print, .sau-topbar, .sau-nav, .sau-footer, .toast-area, .btn { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; }
  .table-wrap { overflow: visible; }
  .table-wrap .table { min-width: 0; }
  a { color: inherit; }
  /* report printing: no search boxes, paging, action buttons or pop-ups on paper */
  .pagination, .td-actions, .modal, .modal-backdrop, details:not([open]), .alert-dismissible .btn-close, input[type="search"], .input-group:has(input[type="search"]) { display: none !important; }
  .page-head { border-bottom: 2px solid #000; margin-bottom: .6rem; padding-bottom: .3rem; }
  .page-head .actions { display: none !important; }
  .form-select { border: 0; background-image: none; padding: 0; font-weight: 600; }
  .table { font-size: 9.5pt; }
  .table th, .table td { padding: .25rem .4rem !important; }
  .table thead { display: table-header-group; }
  .table tr { page-break-inside: avoid; }
  .chart-box { height: 260px; page-break-inside: avoid; }
  .badge { border: 1px solid #999; color: #000 !important; background: #fff !important; }
  @page { margin: 12mm; }
}
.app-menu .app-logout { color: #f6b8b0; padding: .52rem .7rem; font-size: .87rem; font-weight: 500; border-radius: 9px; }
.app-menu .app-logout:hover { background: rgba(255,255,255,.07); color: #fff; }
.app-topbar .ttl { flex: 1 1 auto; overflow: hidden; }
.app-topbar .ttl, .app-topbar .ttl small { white-space: nowrap; text-overflow: ellipsis; }
.app-topbar .right { flex: 0 0 auto; }

/* sticky save bar at the bottom of long forms */
.sticky-save{position:sticky;bottom:0;z-index:5;background:var(--bs-body-bg,#fff);padding:.75rem 0;border-top:1px solid var(--bs-border-color,#dee2e6);text-align:end}
.form-section { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sau-green-700); border-bottom: 1px solid var(--bs-border-color, #dee2e6); padding-bottom: .25rem; margin-top: .25rem; }
.scroll-list { max-height: 420px; overflow-y: auto; }
.list-group-item.active-soft { background: var(--sau-gold-100); border-left: 3px solid var(--sau-gold-500, #c9a227); }
table.matrix th:first-child, table.matrix td:first-child { position: sticky; left: 0; background: var(--bs-body-bg, #fff); z-index: 1; min-width: 200px; }
/* scrutiny tiles */
.scr-tile { border: 1px solid var(--bs-border-color, #dee2e6); color: var(--sau-ink, #1d2b22); background: #fff; transition: transform .1s, box-shadow .1s; }
.scr-tile:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.scr-tile.active { outline: 2px solid var(--sau-green-700); outline-offset: 1px; }
.scr-info .fs-5 { color: #0b6e99; } .scr-warning .fs-5 { color: #a66b00; } .scr-danger .fs-5 { color: #b42318; } .scr-success .fs-5 { color: var(--sau-green-700); }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--bs-border-color, #dee2e6); flex: 0 0 38px; }
.avatar-blank { display: inline-flex; align-items: center; justify-content: center; background: var(--sau-green-50, #eef6f0); color: var(--sau-green-700); }
.doc-thumb { display: block; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .5rem; overflow: hidden; background: #fafafa; text-decoration: none; }
.doc-thumb img { width: 100%; height: 180px; object-fit: contain; background: #fff; }
.doc-thumb .doc-pdf { height: 180px; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #b42318; }
.doc-thumb .doc-cap { padding: .35rem .5rem; font-size: .8rem; font-weight: 600; color: var(--sau-ink, #1d2b22); border-top: 1px solid var(--bs-border-color, #dee2e6); }
.app-photo { width: 140px; height: 170px; object-fit: cover; border-radius: .5rem; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
/* admit slip designer */
.slip-designer { display: grid; grid-template-columns: 240px 1fr 260px; gap: 1rem; align-items: start; }
.sd-tools .card-body, .sd-props .card-body { max-height: 75vh; overflow-y: auto; }
.sd-add { display: block; width: 100%; text-align: left; border: 1px solid var(--bs-border-color, #dee2e6); background: #fff; border-radius: .4rem; padding: .3rem .5rem; margin-bottom: .3rem; font-size: .8rem; }
.sd-add:hover { background: var(--sau-green-50); border-color: var(--sau-green-200); }
.sd-canvas-wrap { overflow: auto; background: #e9ecef; border-radius: .75rem; padding: 1rem; }
.sd-canvas { position: relative; width: 794px; height: 1123px; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.15); transform-origin: top left; touch-action: none; }
.sd-item { position: absolute; cursor: move; white-space: pre-wrap; line-height: 1.15; user-select: none; outline: 1px dashed transparent; }
.sd-item:hover { outline-color: #9fb8a8; }
.sd-item.selected { outline: 2px solid var(--sau-gold-500); }
.sd-item.sd-img { display: flex; align-items: center; justify-content: center; background: #f4f4f4; border: 1px dashed #999; color: #888; font-size: 12px; text-align: center; }
@media (max-width: 1199.98px) { .slip-designer { grid-template-columns: 1fr; } .sd-canvas-wrap { order: -1; } }
.verify-card { border-left: 6px solid #adb5bd; border-radius: .75rem; }
.verify-ok { border-left-color: var(--sau-green-600, #1f7a46); background: linear-gradient(90deg, #f0faf3, #fff 40%); }
.verify-warn { border-left-color: #e0a800; background: linear-gradient(90deg, #fff8e1, #fff 40%); }
/* compact stat tiles on phones */
@media (max-width: 575.98px) { .stat-tile { padding: .7rem .75rem; gap: .6rem; } .stat-tile .ic { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; } .stat-tile .num { font-size: 1.15rem; } }
/* application form steps */
.apply-steps { display: flex; gap: .25rem; list-style: none; margin: 0; padding: .6rem .75rem; overflow-x: auto; scrollbar-width: thin; }
.apply-steps li { flex: 0 0 auto; display: flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--sau-muted); cursor: default; white-space: nowrap; }
.apply-steps li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #e7ece9; font-size: .72rem; }
.apply-steps li.active { background: var(--sau-green-100); color: var(--sau-green-800); }
.apply-steps li.active span, .apply-steps li.done span { background: var(--sau-green-700); color: #fff; }
.apply-steps li.done { color: var(--sau-green-700); cursor: pointer; }
.check-group.border-danger { border-color: var(--sau-red) !important; }
.sau-topbar .social { display: flex; align-items: center; gap: .6rem; white-space: nowrap; } .sau-topbar .social a { display: inline-flex; align-items: center; }
.sau-topbar .social a { justify-content: center; } .sau-topbar .social a.staff-link { width: auto; height: auto; border-radius: 999px; padding: .2rem .7rem; }

/* scrutiny window: pictures left, details right, buttons below (staff/scrutiny -> View) */
/* the window has a fixed height: the top part (pictures | details) scrolls inside,
   the bottom part (buttons, reason box) always stays below it — nothing lies on top of the pictures */
#scrModal .modal-content { height: calc(100vh - 2rem); }
#scrModal .modal-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#scrModal .scr-pop { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#scrModal .scr-pop-body { flex: 1 1 auto; min-height: 0; display: flex; flex-wrap: nowrap; overflow: hidden; margin: 0; }
#scrModal .scr-pop-body > .row { flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; margin: 0; width: 100%; }
#scrModal .scr-pop-docs, #scrModal .scr-pop-fields { min-height: 0; max-height: 100%; overflow-y: auto; }
.scr-pop-docs { background: #f6f3ea; }
.scr-pop-docs img { max-height: 480px; object-fit: contain; }
.scr-pop-foot { background: #fff; flex: 0 0 auto; position: relative; z-index: 2; max-height: 45vh; overflow-y: auto; box-shadow: 0 -4px 10px rgba(0,0,0,.06); }
.scr-pop-foot .scr-reason { max-height: 28vh; overflow-y: auto; }
#scrModal .alert { flex: 0 0 auto; }
@media (max-width: 767.98px) {
  #scrModal .modal-content { height: 100%; }
  #scrModal .scr-pop-body, #scrModal .scr-pop-body > .row { display: block; overflow-y: auto; }
  #scrModal .scr-pop-docs, #scrModal .scr-pop-fields { max-height: none; overflow: visible; }
}

/* scrutiny edit: pictures left, data right (both scroll on big screens) */
@media (min-width: 992px) {
  .scr-edit-docs, .scr-edit-fields { max-height: calc(100vh - 210px); overflow-y: auto; }
}
.scr-edit-docs { background: #f6f3ea; }

/* directorate: complete student record (pictures left, details right) */
@media (min-width: 768px) { .dir-student-docs, .dir-student-fields { max-height: calc(100vh - 140px); overflow-y: auto; } }
.dir-student-docs { background: #f6f3ea; }
