:root {
  --green-950: #062b20;
  --green-900: #083d2b;
  --green-800: #0b5739;
  --green-700: #0b6b45;
  --green-500: #168a59;
  --gold: #d7ae45;
  --gold-soft: #f4df9f;
  --white: #ffffff;
  --ink: #17312a;
  --muted: #667a73;
  --line: rgba(11, 107, 69, .16);
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: #ffffff;
  --shadow: 0 24px 70px rgba(5, 42, 30, .16);
  --radius: 8px;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 174, 69, .18), transparent 36rem),
    linear-gradient(180deg, #f7fbf8 0%, #edf7f2 100%);
  min-height: 100vh;
}

body.dark {
  --ink: #eefaf5;
  --muted: #afc7bd;
  --line: rgba(255, 255, 255, .14);
  --surface: rgba(11, 42, 32, .78);
  --surface-strong: #0b2a20;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  background:
    radial-gradient(circle at top left, rgba(215, 174, 69, .12), transparent 34rem),
    linear-gradient(180deg, #041a14 0%, #092b21 100%);
}

body.theme-royal {
  --green-950: #071b3d;
  --green-900: #0a2a5f;
  --green-800: #103f88;
  --green-700: #1d5fbf;
  --green-500: #3a86ff;
  --gold: #f4c95d;
  --gold-soft: #ffe6a3;
}

body.theme-rose {
  --green-950: #35111c;
  --green-900: #541729;
  --green-800: #7c203c;
  --green-700: #9f2d4c;
  --green-500: #c94362;
  --gold: #e8b85b;
  --gold-soft: #ffe3ac;
}

body.theme-sunrise {
  --green-950: #3b2404;
  --green-900: #613b08;
  --green-800: #8a570d;
  --green-700: #b87416;
  --green-500: #d99222;
  --gold: #0b6b45;
  --gold-soft: #e9fff4;
}

body.theme-emerald {
  --green-950: #062b20;
  --green-900: #083d2b;
  --green-800: #0b5739;
  --green-700: #0b6b45;
  --green-500: #168a59;
  --gold: #d7ae45;
  --gold-soft: #f4df9f;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.site-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--gold-soft);
  background: var(--green-950);
  border-top: 1px solid rgba(215, 174, 69, .28);
}

.site-footer p {
  margin: 0;
  font-weight: 800;
  letter-spacing: .04em;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  gap: 1rem;
  text-align: center;
  background: var(--green-950);
  color: var(--gold-soft);
  transition: opacity .35s ease, visibility .35s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark {
  width: 76px;
  height: 76px;
  margin: auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 223, 159, .45);
  border-radius: 50%;
  animation: pulse 1.1s infinite alternate ease-in-out;
}
.loader-mark i { font-size: 2rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  backdrop-filter: blur(22px);
  background: rgba(255, 255, 255, .76);
  border-bottom: 1px solid var(--line);
}
body.dark .site-header { background: rgba(4, 26, 20, .76); }

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 230px;
}
.brand-icon, .stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--green-800), var(--green-500));
  box-shadow: 0 12px 26px rgba(11, 107, 69, .24);
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  border-radius: var(--radius);
}
.brand strong { display: block; font-size: .92rem; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: .72rem; }

.main-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.main-nav a {
  padding: .7rem .95rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: .92rem;
}
.main-nav a.active, .main-nav a:hover {
  color: var(--green-900);
  background: rgba(215, 174, 69, .18);
}
body.dark .main-nav a.active, body.dark .main-nav a:hover { color: var(--gold-soft); }

.header-actions { display: flex; gap: .5rem; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.menu-btn { display: none; }

.page { display: none; animation: fadeUp .35s ease both; }
.page.active { display: block; }
.section-band, .content-section, .inner-hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.pattern-bg {
  position: relative;
  overflow: hidden;
}
.pattern-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    linear-gradient(30deg, transparent 46%, var(--gold) 47%, var(--gold) 53%, transparent 54%),
    linear-gradient(150deg, transparent 46%, var(--gold) 47%, var(--gold) 53%, transparent 54%);
  background-size: 46px 46px;
  pointer-events: none;
}

.hero {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 2rem;
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) 0;
}
.hero-content, .hero-panel, .inner-hero > * { position: relative; z-index: 1; }
.eyebrow, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--green-700);
  font-weight: 900;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .08em;
}
body.dark .eyebrow, body.dark .section-kicker { color: var(--gold-soft); }

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: .95;
  letter-spacing: 0;
}
h2 { font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1.05; margin-bottom: 1rem; }
h3 { margin-bottom: .5rem; }
p { color: var(--muted); line-height: 1.7; }
.hero p { max-width: 680px; font-size: 1.1rem; }

.hero-actions, .form-actions, .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .85rem 1.05rem;
  min-height: 46px;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(5, 42, 30, .14); }
.btn.primary { background: linear-gradient(135deg, var(--green-800), var(--green-500)); color: var(--white); }
.btn.secondary { background: linear-gradient(135deg, var(--gold), #f1d889); color: #322508; }
.btn.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn.danger { background: #b42318; color: #fff; }
.btn.full { width: 100%; }

.hero-stats {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.hero-stats div { padding: 1rem; border-right: 1px solid var(--line); }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { display: block; font-size: 1.6rem; color: var(--green-700); }
body.dark .hero-stats strong { color: var(--gold-soft); }
.hero-stats span { color: var(--muted); font-size: .85rem; font-weight: 800; }

.glass-card, .form-panel, .login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.hero-panel { padding: 1.1rem; }
.prayer-card {
  min-height: 420px;
  display: grid;
  align-content: end;
  padding: 2rem;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(6, 43, 32, .22), rgba(6, 43, 32, .95)),
    radial-gradient(circle at 50% 20%, rgba(244, 223, 159, .5), transparent 12rem),
    linear-gradient(135deg, #0b6b45, #062b20);
}
.prayer-card i { color: var(--gold-soft); font-size: 3rem; margin-bottom: 1rem; }
.prayer-card p { color: rgba(255, 255, 255, .78); }

.live-donation-section {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
  align-items: stretch;
}
.live-object-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  min-height: 260px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  perspective: 900px;
}
.live-orbit {
  position: relative;
  height: 210px;
  display: grid;
  place-items: center;
}
.live-orbit > span {
  position: absolute;
  border: 1px solid rgba(215, 174, 69, .52);
  border-radius: 50%;
  animation: orbitSpin 8s linear infinite;
}
.live-orbit > span:nth-child(1) { width: 180px; height: 72px; transform: rotateX(68deg); }
.live-orbit > span:nth-child(2) { width: 150px; height: 150px; transform: rotateY(62deg); animation-duration: 10s; }
.live-orbit > span:nth-child(3) { width: 120px; height: 120px; transform: rotateZ(38deg); animation-duration: 6s; }
.madrasah-cube {
  position: relative;
  width: 82px;
  height: 82px;
  transform-style: preserve-3d;
  animation: cubeFloat 5s ease-in-out infinite, cubeTurn 12s linear infinite;
}
.cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  border: 1px solid rgba(244, 223, 159, .55);
  background: linear-gradient(145deg, var(--green-800), var(--green-950));
  font-size: 1.6rem;
}
.cube-face.front { transform: translateZ(41px); }
.cube-face.back { transform: rotateY(180deg) translateZ(41px); }
.cube-face.right { transform: rotateY(90deg) translateZ(41px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(41px); }
.cube-face.top { transform: rotateX(90deg) translateZ(41px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(41px); }
.donation-card {
  padding: 1.3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 1rem;
  align-items: center;
}
.donation-card img {
  width: 145px;
  height: 145px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .35rem;
}
.donation-card h2 { font-size: clamp(1.35rem, 2vw, 2rem); }
.donation-card p { margin-bottom: .8rem; }

.content-section { padding: clamp(2.7rem, 6vw, 5rem) 0; }
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: 1.5rem;
  align-items: center;
}
.top-align { align-items: start; }
.mission-grid, .stat-grid, .cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.mission-grid article, .feature-card, .stat-card, .content-card {
  padding: 1.2rem;
}
.mission-grid i, .feature-card i {
  color: var(--gold);
  font-size: 1.55rem;
  margin-bottom: .9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.section-head.compact { margin-bottom: .9rem; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.feature-card { min-height: 170px; transition: transform .2s ease; }
.feature-card:hover { transform: translateY(-5px); }

.notice-list { display: grid; gap: .75rem; }
.notice-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.notice-date {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: var(--radius);
  color: #322508;
  background: var(--gold-soft);
  font-weight: 900;
  text-align: center;
  font-size: .78rem;
}
.notice-item h3 { font-size: 1rem; margin: 0; }
.notice-item p { margin: 0; font-size: .88rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.gallery-card {
  border: 0;
  padding: 0;
  overflow: hidden;
  min-height: 150px;
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}
.gallery-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform .25s ease;
}
.gallery-card:hover img { transform: scale(1.04); }
.gallery-card span {
  position: absolute;
  left: .65rem;
  right: .65rem;
  bottom: .65rem;
  padding: .5rem .65rem;
  border-radius: var(--radius);
  background: rgba(6, 43, 32, .78);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
}

.contact-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 1rem;
}
.contact-card { padding: 1.5rem; }
.contact-card p i { color: var(--green-700); width: 22px; }
.map-frame {
  width: 100%;
  min-height: 370px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.inner-hero {
  margin-top: 1.2rem;
  padding: clamp(2.5rem, 6vw, 4.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(11, 107, 69, .95), rgba(6, 43, 32, .96)),
    var(--green-800);
  color: #fff;
}
.inner-hero p { color: rgba(255,255,255,.75); max-width: 780px; }
.inner-hero h1 { font-size: clamp(2.1rem, 5vw, 4.6rem); }

.form-panel, .login-card { padding: clamp(1rem, 3vw, 1.5rem); }
.form-grid, .upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
label {
  display: grid;
  gap: .45rem;
  color: var(--ink);
  font-weight: 800;
  font-size: .88rem;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .82rem .85rem;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(215, 174, 69, .18); }
.upload-grid, .form-actions { margin-top: 1rem; }
.check-row { display: flex; align-items: center; gap: .6rem; }
.check-row input { width: auto; }
.helper { margin: .75rem 0 0; font-size: .85rem; }

.portal-shell { min-height: 520px; }
.login-card { width: min(430px, 100%); margin: 0 auto; }
.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 430px));
  justify-content: center;
  gap: 1rem;
}
.dashboard, .admin-layout { animation: fadeUp .3s ease both; }
.hidden { display: none !important; }

.admin-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 92px;
  padding: .8rem;
  display: grid;
  gap: .45rem;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem;
  color: var(--green-900);
  font-weight: 900;
}
body.dark .admin-user { color: var(--gold-soft); }
.admin-tab {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  padding: .78rem .85rem;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  text-align: left;
}
.admin-tab.active, .admin-tab:hover { background: rgba(215, 174, 69, .16); color: var(--ink); }
.admin-tab.danger { color: #b42318; }
.admin-content { min-width: 0; display: grid; gap: 1rem; }

.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.stat-card strong { font-size: 1.55rem; display: block; }
.stat-card span { color: var(--muted); font-weight: 800; font-size: .82rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .9rem;
}
.toolbar .filters {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}
.toolbar input, .toolbar select { width: min(250px, 100%); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: .82rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: .9rem;
}
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--gold-soft);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: rgba(11, 107, 69, .12);
  color: var(--green-700);
  font-size: .76rem;
  font-weight: 900;
}
.pill.warn { background: rgba(215, 174, 69, .18); color: #8a640e; }
.pill.bad { background: rgba(180, 35, 24, .12); color: #b42318; }

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.content-card { min-width: 0; }

.student-profile {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.student-profile .photo {
  width: 190px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--gold-soft);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}
.detail-grid div {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.detail-grid small { display: block; color: var(--muted); font-weight: 800; margin-bottom: .25rem; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 26, 20, .82);
}
.lightbox .icon-btn { position: fixed; top: 1rem; right: 1rem; color: #fff; background: rgba(255,255,255,.1); }
.lightbox img, .lightbox iframe {
  max-width: min(980px, 94vw);
  max-height: 86vh;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
}

.floating-whatsapp {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #25d366;
  box-shadow: 0 16px 38px rgba(37, 211, 102, .35);
  font-size: 1.55rem;
}

.toast-host {
  position: fixed;
  top: 86px;
  right: 1rem;
  z-index: 1001;
  display: grid;
  gap: .6rem;
}
.toast {
  padding: .8rem 1rem;
  border-radius: var(--radius);
  background: var(--green-900);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: slideIn .2s ease both;
}
.toast.error { background: #b42318; }

.print-area { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  from { transform: scale(.94); opacity: .72; }
  to { transform: scale(1.04); opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes cubeTurn {
  from { transform: rotateX(-14deg) rotateY(0deg); }
  to { transform: rotateX(-14deg) rotateY(360deg); }
}
@keyframes cubeFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}
@keyframes orbitSpin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@media (max-width: 980px) {
  .menu-btn { display: inline-grid; }
  .main-nav {
    position: fixed;
    top: 70px;
    left: 1rem;
    right: 1rem;
    display: none;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav.open { display: flex; }
  .hero, .two-col, .contact-section, .admin-layout, .split-grid, .student-profile, .live-donation-section { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: minmax(0, 430px); }
  .feature-grid, .stat-grid, .form-grid, .upload-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .brand { min-width: 0; }
  .brand strong { font-size: .78rem; }
  .brand small { display: none; }
  .site-header { padding: .65rem .8rem; }
  .section-band, .content-section, .inner-hero { width: min(100% - 1rem, 1180px); }
  .hero { min-height: auto; padding-top: 2.2rem; }
  h1 { font-size: clamp(2.4rem, 16vw, 3.6rem); }
  .hero-stats, .feature-grid, .mission-grid, .stat-grid, .form-grid, .upload-grid, .detail-grid, .gallery-grid, .admin-sidebar { grid-template-columns: 1fr; }
  .hero-stats div { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-stats div:last-child { border-bottom: 0; }
  .live-object-wrap, .donation-card { grid-template-columns: 1fr; }
  .donation-card img { width: 180px; height: 180px; }
  .section-head { align-items: start; flex-direction: column; }
  .notice-item { grid-template-columns: 48px 1fr; }
  .notice-item .row-actions { grid-column: 1 / -1; }
  .student-profile .photo { width: 100%; max-width: 220px; }
}

@media print {
  @page { margin: 8mm; }
  body > *:not(.print-area) { display: none !important; }
  .print-area {
    display: block !important;
    color: #111;
    background: #fff;
    font-family: Arial, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-doc {
    width: 190mm;
    min-height: 260mm;
    margin: 0 auto;
    padding: 12mm;
    border: 2px solid #0b6b45;
  }
  .print-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d7ae45;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }
  .print-head h1 { font-size: 28px; margin: 0; color: #0b6b45; }
  .print-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .print-grid div, .print-box { border: 1px solid #ddd; padding: 8px; }

  .id-sheet {
    width: 190mm;
    min-height: 125mm;
    padding: 8mm;
    border: 0;
    display: flex;
    gap: 14mm;
    align-items: flex-start;
    justify-content: center;
    background: #efefef;
  }
  .id-card-modern {
    width: 68mm;
    height: 108mm;
    position: relative;
    overflow: hidden;
    border-radius: 4mm;
    background: #fff;
    box-shadow: 0 5mm 10mm rgba(0, 0, 0, .18);
    text-align: center;
    color: #242936;
  }
  .id-dark-top {
    height: 27mm;
    padding-top: 8mm;
    background: #2b303a;
    color: #fff;
    position: relative;
    z-index: 1;
  }
  .id-dark-top.slim { height: 12mm; padding: 0; }
  .id-dark-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8mm;
    background: #2b303a;
  }
  .id-dark-top h2,
  .id-card-modern h2 {
    margin: 0;
    font-size: 13pt;
    letter-spacing: .5px;
  }
  .id-dark-top p,
  .id-role {
    margin: 1mm 0 0;
    color: #e51c2c;
    font-size: 7.5pt;
    font-weight: 700;
  }
  .id-wave {
    position: absolute;
    left: -8mm;
    right: -8mm;
    height: 18mm;
    background: #e51c2c;
    z-index: 2;
  }
  .top-wave {
    top: 23mm;
    transform: rotate(-4deg);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
  }
  .bottom-wave {
    bottom: 5mm;
    transform: rotate(4deg);
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
  }
  .id-photo-modern {
    width: 23mm;
    height: 23mm;
    object-fit: cover;
    border-radius: 50%;
    border: 2.2mm solid #e51c2c;
    margin: 17mm auto 5mm;
    position: relative;
    z-index: 3;
    background: #f3f3f3;
  }
  .id-front h3 {
    margin: 0;
    font-size: 18pt;
    line-height: 1.05;
  }
  .id-back h3 {
    margin: 17mm 0 2mm;
    font-size: 10pt;
    letter-spacing: .2px;
  }
  .id-back h2 {
    margin-top: 5mm;
    font-size: 13pt;
  }
  .id-terms {
    width: 46mm;
    margin: 0 auto 5mm;
    font-size: 7pt;
    line-height: 1.35;
    color: #555;
  }
  .id-details {
    width: 44mm;
    margin: 7mm auto 0;
    display: grid;
    gap: 1.7mm;
    text-align: left;
    position: relative;
    z-index: 3;
  }
  .id-details.back { margin-top: 4mm; }
  .id-details div {
    display: grid;
    grid-template-columns: 16mm 1fr;
    gap: 2mm;
    font-size: 7.5pt;
  }
  .id-details dt { font-weight: 700; }
  .id-details dd { margin: 0; }
  .signature-script {
    margin-top: 5mm;
    font-family: "Brush Script MT", cursive;
    font-size: 16pt;
    color: #222;
  }
  .signature-name {
    display: block;
    width: 28mm;
    margin: 0 auto 3mm;
    padding-top: 1mm;
    border-top: .35mm solid #e51c2c;
    font-size: 7pt;
  }
  .qr-print {
    width: 16mm;
    height: 16mm;
    margin: 2mm auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9mm;
    padding: 1.2mm;
    border: .6mm solid #242936;
    background: #fff;
    position: relative;
  }
  .qr-print span { background: #fff; border: .25mm solid #242936; }
  .qr-print span.on { background: #e51c2c; }
  .qr-print small {
    position: absolute;
    inset: 5mm 3.5mm;
    display: grid;
    place-items: center;
    background: #242936;
    color: #fff;
    font-size: 4pt;
    overflow: hidden;
  }

  .admit-reference {
    width: 135mm;
    min-height: 88mm;
    padding: 2mm;
    border: 0;
    background: #e3ff92;
    font-family: Georgia, "Times New Roman", serif;
  }
  .admit-border {
    min-height: 82mm;
    border: 1.2mm double #8b1a2b;
    padding: 4mm 7mm 5mm;
    color: #7e1629;
    background: #e3ff92;
  }
  .admit-border header {
    display: grid;
    grid-template-columns: 18mm 1fr 18mm;
    gap: 4mm;
    align-items: center;
    text-align: center;
  }
  .admit-border h1 {
    margin: 0 0 3mm;
    font-size: 18pt;
    line-height: 1;
    color: #8b1021;
  }
  .admit-border header span {
    display: inline-block;
    padding: 1.2mm 5mm;
    border: .8mm solid #8b1021;
    border-radius: 999px;
    background: #7a2030;
    color: #fff;
    font-size: 12pt;
    font-weight: 900;
  }
  .admit-logo {
    width: 16mm;
    height: 16mm;
    display: grid;
    place-items: center;
    border: .7mm solid #8b1021;
    border-radius: 50%;
    background: #f7ffc9;
    font-size: 6pt;
    font-weight: 900;
    line-height: 1.1;
  }
  .admit-logo img {
    width: 13mm;
    height: 13mm;
    object-fit: contain;
  }
  .admit-lines {
    margin-top: 5mm;
    font-size: 11pt;
    font-weight: 700;
  }
  .admit-lines p {
    display: flex;
    align-items: end;
    gap: 2mm;
    margin: 3.5mm 0;
    color: #7e1629;
  }
  .admit-lines span {
    min-width: 35mm;
    flex: 1;
    border-bottom: .55mm solid #7e1629;
    color: #111;
    padding-left: 2mm;
    font-family: Arial, sans-serif;
    font-size: 10pt;
  }
  .admit-subjects {
    margin: 4mm 0;
    padding: 2mm;
    border: .45mm solid #8b1021;
    color: #111;
    font-size: 9pt;
    background: rgba(255, 255, 255, .28);
  }
  .admit-border footer {
    display: flex;
    justify-content: space-around;
    margin-top: 7mm;
    text-align: center;
    color: #7e1629;
    font-size: 11pt;
  }
  .admit-border footer div {
    min-width: 38mm;
    padding-top: 2mm;
    border-top: .65mm solid #7e1629;
  }

  .admission-premium {
    width: 190mm;
    min-height: 270mm;
    padding: 0;
    border: .6mm solid #633c73;
    background: #fff;
    color: #1d1d1d;
    font-family: Arial, sans-serif;
  }
  .admission-head {
    display: grid;
    grid-template-columns: 28mm 1fr 30mm;
    gap: 4mm;
    align-items: center;
    padding: 5mm 6mm 4mm;
    border-bottom: .6mm solid #633c73;
    background: linear-gradient(180deg, #fff 0%, #f3e8f7 100%);
    text-align: center;
  }
  .admission-head h1 {
    margin: 0;
    font-size: 18pt;
    color: #633c73;
    text-decoration: underline;
  }
  .admission-head p {
    margin: 1mm 0 0;
    color: #333;
    font-size: 7.5pt;
    line-height: 1.35;
  }
  .admission-logo {
    width: 24mm;
    height: 24mm;
    border: .7mm solid #633c73;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #633c73;
    font-weight: 900;
    background: #f9f1fc;
  }
  .admission-logo img {
    width: 16mm;
    height: 16mm;
    object-fit: contain;
  }
  .admission-logo i { font-size: 14pt; }
  .admission-logo small { font-size: 5pt; }
  .admission-photo {
    width: 26mm;
    height: 30mm;
    border: .55mm solid #222;
    display: grid;
    place-items: center;
    font-size: 6pt;
    font-weight: 700;
    background: #fff;
    transform: rotate(90deg);
  }
  .admission-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(-90deg);
  }
  .admission-title {
    padding: 2.5mm;
    text-align: center;
    font-size: 15pt;
    font-weight: 900;
    font-style: italic;
    color: #633c73;
    background: #f7edf9;
    border-bottom: .45mm solid #633c73;
  }
  .admission-note {
    margin: 0;
    padding: 2mm 6mm;
    font-size: 8pt;
    color: #333;
    border-bottom: .3mm solid #cbb7d2;
  }
  .admission-premium h2 {
    margin: 0;
    padding: 2mm 6mm;
    background: #eadbed;
    border-top: .35mm solid #c6abc9;
    border-bottom: .35mm solid #c6abc9;
    color: #333;
    font-size: 9pt;
    text-transform: uppercase;
  }
  .admission-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0 6mm 4mm;
  }
  .admission-field {
    min-height: 12mm;
    padding: 2mm;
    border-right: .25mm solid #d5c7d9;
    border-bottom: .25mm solid #d5c7d9;
  }
  .admission-field:nth-child(3n) { border-right: 0; }
  .admission-field.wide {
    grid-column: 1 / -1;
    border-right: 0;
  }
  .admission-field span {
    display: block;
    margin-bottom: 1.5mm;
    color: #5e4767;
    font-size: 6.8pt;
    font-weight: 800;
  }
  .admission-field strong {
    display: block;
    min-height: 5mm;
    border-bottom: .35mm solid #777;
    color: #111;
    font-size: 8.5pt;
    font-weight: 700;
  }
  .admission-signatures {
    display: flex;
    justify-content: space-between;
    gap: 8mm;
    padding: 14mm 8mm 7mm;
  }
  .admission-signatures span {
    flex: 1;
    padding-top: 2mm;
    border-top: .45mm solid #333;
    text-align: center;
    font-size: 8pt;
    font-weight: 800;
  }
}
