:root {
  --navy: #132B45;
  --navy-dark: #0B1B2D;
  --navy-light: #1E3F63;
  --ivory: #F8F5EF;
  --ivory-warm: #F1ECE1;
  --gold: #BC9655;
  --gold-dark: #9B783B;
  --gold-light: #F5EBD6;
  --white: #FFFFFF;
  --text-main: #182635;
  --text-muted: #526273;
  --border-color: #DFD8CA;
  --success: #1D6F42;
  --success-bg: #E7F5EC;
  --warning: #996515;
  --warning-bg: #FDF3E1;
  --danger: #A62626;
  --danger-bg: #FDECEC;
  --info: #1E5088;
  --info-bg: #E8F1FA;
  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --shadow-sm: 0 2px 6px rgba(19, 43, 69, 0.06);
  --shadow-md: 0 8px 24px rgba(19, 43, 69, 0.09);
  --shadow-lg: 0 14px 36px rgba(19, 43, 69, 0.14);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--ivory);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif-heading {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.25;
  margin-top: 0;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-dark);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  background: var(--navy);
  color: var(--white);
  padding: 8px 16px;
  z-index: 9999;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: 12px;
}

/* Top info bar */
.top-bar {
  background-color: var(--navy-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(188, 150, 85, 0.35);
}
.top-bar-inner {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.top-bar a {
  color: var(--gold-light);
  font-weight: 500;
}
.top-bar a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Main Public Navbar */
.site-header {
  background-color: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
  text-decoration: none;
}
.brand-link:hover {
  color: var(--white);
}
.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: #000;
  flex-shrink: 0;
}
.brand-title {
  display: flex;
  flex-direction: column;
}
.brand-title-main {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  line-height: 1.2;
}
.brand-title-sub {
  font-size: 0.78rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.15s ease;
}
.nav-link svg {
  width: 16px;
  height: 16px;
  stroke: var(--gold-light);
  flex-shrink: 0;
}
.nav-link:hover, .nav-link.active {
  color: var(--white);
  background-color: rgba(188, 150, 85, 0.22);
}
.nav-link.active {
  border-bottom: 2px solid var(--gold);
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--gold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  z-index: 1100;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 18px;
  color: var(--navy);
  background: none;
  border: none;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-dropdown-item:hover {
  background-color: var(--ivory);
  color: var(--gold-dark);
}

/* Mobile Header Actions & App Components (Hidden on Desktop by default) */
.mobile-header-actions {
  display: none;
  align-items: center;
  gap: 8px;
}
.mobile-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(188, 150, 85, 0.18);
  color: var(--gold-light);
  border: 1px solid rgba(188, 150, 85, 0.45);
  text-decoration: none;
  transition: all 0.15s ease;
}
.mobile-icon-btn:hover, .mobile-icon-btn:active {
  background: var(--gold);
  color: var(--navy-dark);
}
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(188, 150, 85, 0.25), rgba(188, 150, 85, 0.12));
  color: var(--white);
  border: 1px solid var(--gold);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mobile-menu-btn svg {
  stroke: var(--gold-light);
}
.mobile-menu-btn:active {
  transform: scale(0.96);
}

/* Mobile Quick-Action App Launcher (Home Page) */
.mobile-app-launcher {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
}
.mobile-app-launcher-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.app-quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--ivory);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}
.app-quick-tile:hover, .app-quick-tile:active {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: var(--gold-light);
  box-shadow: var(--shadow-sm);
}
.app-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(19, 43, 69, 0.18);
  border: 1.5px solid rgba(188, 150, 85, 0.45);
}
.app-quick-tile.tile-gold .app-quick-icon {
  background: linear-gradient(135deg, #D4AF6A, var(--gold));
  color: var(--navy-dark);
  border-color: var(--gold-dark);
}
.app-quick-icon svg {
  width: 22px;
  height: 22px;
}
.app-quick-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.app-quick-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

/* Native Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1600;
  background: rgba(11, 27, 45, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(188, 150, 85, 0.38);
  box-shadow: 0 -6px 24px rgba(11, 27, 45, 0.32);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
}
.bottom-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.bottom-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.16s ease;
}
.bottom-nav-item.active {
  color: var(--gold-light);
  font-weight: 700;
}
.bottom-nav-item.active .bottom-nav-icon-wrap {
  background: rgba(188, 150, 85, 0.22);
  color: var(--gold);
}
.bottom-nav-item.active svg {
  stroke: var(--gold);
  transform: translateY(-1px);
}
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -6px;
  width: 22px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--gold);
  box-shadow: 0 2px 8px rgba(188, 150, 85, 0.8);
}
.bottom-nav-item:active {
  transform: scale(0.93);
}

/* Center Elevated Action Button in Bottom Nav */
.bottom-nav-item.nav-item-fab {
  color: var(--gold-light);
}
.bottom-nav-item.nav-item-fab .bottom-nav-icon-wrap {
  width: 48px;
  height: 48px;
  margin-top: -22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DFBE7F 0%, var(--gold) 60%, var(--gold-dark) 100%);
  color: var(--navy-dark);
  border: 3px solid var(--navy-dark);
  box-shadow: 0 6px 16px rgba(188, 150, 85, 0.45);
}
.bottom-nav-item.nav-item-fab svg {
  width: 22px;
  height: 22px;
  stroke: var(--navy-dark);
  stroke-width: 2.4;
}
.bottom-nav-item.nav-item-fab.active::before {
  display: none;
}
.bottom-nav-item.nav-item-fab.active .bottom-nav-icon-wrap {
  box-shadow: 0 0 0 2px var(--gold-light), 0 8px 20px rgba(188, 150, 85, 0.65);
}

/* Status Dot & Notification Badge on Bottom Nav */
.nav-status-dot {
  position: absolute;
  top: 2px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ECC71;
  border: 1.5px solid var(--navy-dark);
}
.nav-badge-count {
  position: absolute;
  top: -2px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #E05252;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--navy-dark);
}

/* Mobile App Bottom Sheet Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 45, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInBackdrop 0.18s ease-out;
}
.mobile-drawer-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  background: var(--ivory);
  border-top: 3px solid var(--gold);
  border-radius: 22px 22px 0 0;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 12px));
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  animation: slideUpSheet 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-handle {
  width: 44px;
  height: 5px;
  background: #C5B9A5;
  border-radius: 999px;
  margin: 0 auto 14px;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.drawer-user-card {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  border: 1px solid rgba(188, 150, 85, 0.45);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.drawer-section-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  margin: 14px 0 8px;
}
.drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.drawer-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.drawer-tile svg {
  width: 22px;
  height: 22px;
  stroke: var(--navy);
}
.drawer-tile.active, .drawer-tile:active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--gold);
}
.drawer-tile.active svg, .drawer-tile:active svg {
  stroke: var(--gold);
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
  line-height: 1.3;
}
.btn-sm {
  padding: 7px 13px;
  font-size: 0.85rem;
}
.btn-gold {
  background-color: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
}
.btn-gold:hover {
  background-color: #cfa966;
  color: var(--navy-dark);
  transform: translateY(-1px);
}
.btn-navy {
  background-color: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover {
  background-color: var(--navy-light);
  color: var(--white);
}
.btn-outline-light {
  background-color: transparent;
  color: var(--white);
  border-color: var(--gold);
}
.btn-outline-light:hover {
  background-color: rgba(188, 150, 85, 0.2);
  color: var(--white);
}
.btn-outline-navy {
  background-color: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-navy:hover {
  background-color: var(--navy);
  color: var(--white);
}
.btn-danger {
  background-color: var(--danger);
  color: var(--white);
}
.btn-danger:hover {
  opacity: 0.9;
}

/* Hero Section */
.hero-section {
  background: radial-gradient(circle at 80% 20%, rgba(188, 150, 85, 0.18), transparent 45%),
              linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 65%, #1A3A5C 100%);
  color: var(--white);
  padding: 68px 24px 76px;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--gold);
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 44px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(188, 150, 85, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-heading {
  color: var(--white);
  font-size: clamp(2rem, 3.6vw, 3rem);
  margin-bottom: 18px;
  font-weight: 700;
}
.hero-subtitle {
  color: rgba(248, 245, 239, 0.9);
  font-size: 1.12rem;
  margin-bottom: 28px;
  max-width: 640px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-emblem-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(188, 150, 85, 0.45);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg);
}
.hero-emblem-logo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  margin-bottom: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.hero-schedule-pill {
  background: rgba(19, 43, 69, 0.85);
  border: 1px solid rgba(188, 150, 85, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ivory);
}

/* Containers & Sections */
.section {
  padding: 60px 24px;
}
.section-alt {
  background-color: var(--ivory-warm);
}
.container {
  max-width: 1220px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 44px;
}
.section-eyebrow {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: block;
}
.section-title {
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  margin-bottom: 12px;
}
.gold-divider {
  width: 72px;
  height: 3px;
  background-color: var(--gold);
  margin: 14px auto 0;
  border-radius: 2px;
}

/* Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 26px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 26px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-program {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--gold);
  position: relative;
}
.card-program:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.program-level-tag {
  display: inline-block;
  background-color: var(--gold-light);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 11px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-demo {
  background: #FFF3CD;
  color: #7A4F01;
  border: 1px solid #FFECB5;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #C8C0B0;
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--text-main);
  transition: border-color 0.15s ease;
}
.form-control:focus {
  border-color: var(--navy);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Alerts & Banners */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border-left: 4px solid var(--navy);
  background: var(--white);
  font-size: 0.93rem;
}
.alert-info { background: var(--info-bg); border-left-color: var(--info); color: #10325A; }
.alert-success { background: var(--success-bg); border-left-color: var(--success); color: #124A2B; }
.alert-warning { background: var(--warning-bg); border-left-color: var(--warning); color: #664209; }
.alert-danger { background: var(--danger-bg); border-left-color: var(--danger); color: #6E1616; }

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background-color: var(--navy);
  color: var(--white);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.data-table tr:hover td {
  background-color: rgba(248, 245, 239, 0.65);
}

/* Portal Layout (Admin / Teacher / Student) */
.portal-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: calc(100vh - 86px);
}
.portal-sidebar {
  background-color: var(--navy-dark);
  color: var(--white);
  padding: 20px 14px;
  border-right: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-section-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  padding: 10px 12px 4px;
  font-weight: 700;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.91rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-btn:hover {
  background-color: rgba(188, 150, 85, 0.16);
  color: var(--white);
}
.sidebar-btn.active {
  background-color: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
}
.portal-main {
  padding: 28px 32px;
  background-color: var(--ivory);
  overflow-x: hidden;
}
.portal-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Stat Cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--navy);
  margin: 4px 0;
}
.stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Tabs */
.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -2px;
}
.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  background: rgba(188, 150, 85, 0.1);
}

/* Modal / Printable Document Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 45, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  overflow-y: auto;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--gold);
}

/* Official Printable Document Styling */
.printable-sheet {
  border: 2px double var(--navy);
  padding: 32px;
  background: var(--white);
  color: #000;
}
.printable-header {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.printable-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

/* Official Student ID Badge (CR80 Standard Proportion Recto / Verso) */
.id-badge-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  align-items: stretch;
  margin: 12px 0;
}
.id-badge-card {
  width: 390px;
  min-height: 246px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--gold);
  box-shadow: 0 10px 28px rgba(11, 27, 45, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  color: var(--text-main);
  font-family: var(--font-sans);
  page-break-inside: avoid;
  break-inside: avoid;
}
.id-badge-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 70%, #1E3F63 100%);
  color: var(--white);
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid var(--gold);
}
.id-badge-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  background: #000;
  flex-shrink: 0;
}
.id-badge-header-text {
  flex: 1;
  min-width: 0;
}
.id-badge-school-main {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.15;
  text-transform: uppercase;
}
.id-badge-school-sub {
  font-size: 0.63rem;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}
.id-badge-ribbon {
  background: var(--gold-light);
  color: var(--navy-dark);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 3px 10px;
  border-bottom: 1px solid rgba(188, 150, 85, 0.45);
}
.id-badge-body {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 12px 14px 8px;
  align-items: start;
  flex: 1;
  background: radial-gradient(circle at 90% 80%, rgba(188, 150, 85, 0.1), transparent 55%), var(--white);
}
.id-badge-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.id-badge-photo {
  width: 86px;
  height: 102px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  object-fit: cover;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(19, 43, 69, 0.15);
  overflow: hidden;
}
.id-badge-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.id-badge-status-pill {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  width: 100%;
  text-align: center;
}
.id-badge-status-actif {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #A3D9B6;
}
.id-badge-status-suspendu, .id-badge-status-expire {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #F1B0B0;
}
.id-badge-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.id-badge-student-name {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 2px;
}
.id-badge-matricule-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--navy);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 5px;
  width: fit-content;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.id-badge-field {
  font-size: 0.71rem;
  line-height: 1.3;
  color: var(--text-main);
}
.id-badge-field strong {
  color: var(--navy);
}
.id-badge-footer {
  background: var(--ivory);
  border-top: 1px solid var(--border-color);
  padding: 5px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.62rem;
  color: var(--text-muted);
}
.id-badge-back-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  font-size: 0.69rem;
  line-height: 1.38;
  background: var(--white);
}
.id-badge-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  margin-top: 6px;
}
.id-badge-sig-box {
  font-size: 0.6rem;
  line-height: 1.2;
  color: var(--navy);
}
.id-badge-sig-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--navy-dark);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
  margin-bottom: 2px;
}
@media (max-width: 440px) {
  .id-badge-card {
    width: 100%;
    min-width: 0;
  }
  .id-badge-body {
    grid-template-columns: 82px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .id-badge-photo {
    width: 76px;
    height: 92px;
  }
}

/* Footer */
.site-footer {
  background-color: var(--navy-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 52px 24px 28px;
  border-top: 4px solid var(--gold);
  margin-top: 60px;
}
.footer-grid {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 36px;
  margin-bottom: 36px;
}
.footer-title {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 8px;
}
.footer-links a, .footer-links button {
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.92rem;
}
.footer-links a:hover, .footer-links button:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* Toast Notification */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--navy-dark);
  color: var(--white);
  border-left: 4px solid var(--gold);
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  font-size: 0.92rem;
}

/* Responsive Breakpoints & Native Mobile App Experience */
@media (max-width: 960px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav {
    display: grid;
  }
  .mobile-header-actions {
    display: inline-flex;
  }
  .main-nav {
    display: none !important;
  }
  #toast-container {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    left: 16px;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .portal-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .portal-sidebar {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 14px;
    gap: 8px;
    border-right: none;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 67px;
    z-index: 900;
  }
  .portal-sidebar::-webkit-scrollbar {
    display: none;
  }
  .sidebar-section-label {
    display: none;
  }
  .sidebar-btn {
    white-space: nowrap;
    width: auto;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(188, 150, 85, 0.28);
  }
  .sidebar-btn.active {
    background: var(--gold);
    color: var(--navy-dark);
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(188, 150, 85, 0.4);
  }
  .portal-main {
    padding: 18px 14px 32px;
  }
}

@media (max-width: 768px) {
  .top-bar {
    display: none;
  }
  .site-header {
    background: rgba(19, 43, 69, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--gold);
  }
  .header-inner {
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .brand-link {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
  .brand-title {
    min-width: 0;
  }
  .brand-title-main {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-title-sub {
    font-size: 0.66rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-menu-btn-label {
    display: none;
  }
  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .hero-section {
    padding: 26px 16px 32px;
  }
  .hero-badge {
    font-size: 0.72rem;
    padding: 5px 12px;
    margin-bottom: 12px;
  }
  .hero-heading {
    font-size: 1.65rem;
    margin-bottom: 12px;
  }
  .hero-subtitle {
    font-size: 0.96rem;
    margin-bottom: 20px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    padding: 11px 12px;
    font-size: 0.86rem;
  }
  .hero-emblem-card {
    padding: 18px 16px;
    border-radius: 16px;
  }
  .hero-emblem-logo {
    width: 110px;
    height: 110px;
    margin-bottom: 10px;
  }
  .mobile-app-launcher {
    padding: 14px 12px;
  }
  .mobile-app-launcher-inner {
    gap: 8px;
  }
  .app-quick-tile {
    padding: 10px 4px;
    border-radius: 12px;
    gap: 6px;
  }
  .app-quick-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .app-quick-icon svg {
    width: 19px;
    height: 19px;
  }
  .app-quick-label {
    font-size: 0.7rem;
  }
  .app-quick-sub {
    display: none;
  }
  .section {
    padding: 36px 14px;
  }
  .section-header {
    margin-bottom: 26px;
  }
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card {
    padding: 18px 16px;
    border-radius: 14px;
  }
  .stat-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .stat-value {
    font-size: 1.45rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }
  .form-control, button, input, select, textarea {
    font-size: 16px;
  }
  .tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    white-space: nowrap;
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 12px));
  }
  .site-footer {
    margin-top: 32px;
    padding: 36px 16px 28px;
  }
}

@media print {
  .top-bar, .site-header, .portal-sidebar, .site-footer, .mobile-bottom-nav, #mobile-drawer-root, .mobile-app-launcher, .no-print {
    display: none !important;
  }
  body, .portal-main, .modal-backdrop, .modal-card {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

