/* ============================================================
   GURUDEV INTERNATIONAL -- COMPLETE RESPONSIVE CSS OVERHAUL
   Mobile-First | 320px to 1920px+
   ============================================================ */

/* GLOBAL RESET */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { overflow-x: hidden; max-width: 100vw; -webkit-text-size-adjust: 100%; }
img, video, iframe, canvas, svg { max-width: 100%; height: auto; display: block; }

/* CONTAINER */
.container {
  width: 100%;
  max-width: var(--container-width, 1280px);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* FLUID TYPOGRAPHY */
h1, .hero-title      { font-size: clamp(1.8rem, 5vw, 4rem); line-height: 1.15; }
h2, .section-title   { font-size: clamp(1.4rem, 3.5vw, 2.8rem); line-height: 1.2; }
h3                   { font-size: clamp(1.05rem, 2.5vw, 1.6rem); }
h4                   { font-size: clamp(0.95rem, 2vw, 1.3rem); }
.section-subtitle    { font-size: clamp(0.88rem, 1.8vw, 1.1rem); }
.page-hero-title     { font-size: clamp(1.5rem, 5vw, 3rem); }

/* SECTION PADDING */
.section-padding    { padding: clamp(40px, 8vw, 100px) 0; }
.section-padding-sm { padding: clamp(24px, 5vw, 60px) 0; }

/* ============================================================
   1440px -- LARGE DESKTOP
   ============================================================ */
@media (max-width: 1440px) {
  :root { --container-width: 1200px; }
}

/* ============================================================
   1200px -- DESKTOP
   ============================================================ */
@media (max-width: 1200px) {
  :root { --container-width: 960px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
  .mega-menu   { min-width: 540px; }
  .facilities-grid { grid-template-columns: repeat(3, 1fr); }
  .toppers-grid    { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   992px -- TABLET LANDSCAPE
   ============================================================ */
@media (max-width: 992px) {
  :root { --container-width: 100%; --section-padding: 70px 0; }

  .navbar-menu { display: none !important; }
  .hamburger   { display: flex !important; }
  .navbar-actions .btn-nav-outline { display: none; }
  .contact-header { display: none; }
  .mega-menu { min-width: 260px; }
  .mega-menu-grid { grid-template-columns: 1fr; }

  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-arrows     { display: none; }

  .about-content     { grid-template-columns: 1fr; gap: 40px; }
  .about-image-block { max-width: 560px; margin: 0 auto; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .stats-grid      { grid-template-columns: repeat(2, 1fr); }
  .messages-grid   { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
  .facilities-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid        { grid-template-columns: repeat(2, 1fr); }
  .testimonial-card { min-width: calc(50% - 12px); }
  .news-grid       { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid    { grid-template-columns: repeat(3, 1fr); }
  .gallery-item.large, .gallery-item.wide { grid-column: span 1; grid-row: span 1; }
  .toppers-grid    { grid-template-columns: repeat(3, 1fr); }

  .footer-grid  { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: span 2; }

  .contact-form-wrapper { grid-template-columns: 1fr; gap: 40px; }
  .admission-content { flex-direction: column; text-align: center; }
  .admission-actions { justify-content: center; }

  .timeline::before { left: 20px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 60px;
    transform: translateX(0);
  }
  .timeline-dot { left: 20px; }

  .video-wrapper { max-width: 700px; margin: 0 auto; }

  .faculty-card { flex: 0 0 calc(33.333% - 20px); }
  .faculty-slider-wrapper { padding: 0 50px; }

  .career-apply-grid    { grid-template-columns: 1fr; gap: 40px; }
  .career-process-grid { grid-template-columns: 1fr; }
  .career-openings-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   768px -- TABLET PORTRAIT
   ============================================================ */
@media (max-width: 768px) {
  :root { --section-padding: 60px 0; }

  html, body { overflow-x: hidden !important; max-width: 100vw; }

  .container { padding: 0 clamp(12px, 3vw, 20px); }

  .top-bar { padding: 7px 0; }
  .marquee-item { font-size: 0.75rem; padding: 0 18px; }

  .navbar-inner { height: 62px; }
  .logo-text    { display: none; }
  .logo-emblem  { width: 44px; height: 44px; }
  .navbar-actions .btn-nav { display: none; }
  .navbar-actions .btn-nav-primary { display: none !important; font-size: 0.72rem; padding: 6px 14px; }

  .hero { height: 92vh; min-height: 560px; }
  .hero-text    { max-width: 100%; padding: 0; }
  .hero-subtitle { font-size: 0.92rem; }
  .hero-buttons  { flex-wrap: wrap; gap: 10px; }
  .hero-buttons .btn { font-size: 0.85rem; padding: 12px 20px; }
  .hero-stats   { bottom: 16px; }

  .hero-stats-grid { width: 100%; gap: 0; }
  .hero-stat { padding: 12px 10px; }

  .hero-stat-number { font-size: 1.5rem; }
  .scroll-indicator { display: none; }
  .hero-controls { display: none !important; }

  .about-features     { grid-template-columns: 1fr; }
  .about-image-accent { display: none; }
  .about-image-badge  { left: 8px; bottom: 8px; }

  .section-header-flex { flex-direction: column; align-items: center; text-align: center; gap: 16px; }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stats-grid      { grid-template-columns: repeat(2, 1fr); }
  .facilities-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .why-grid        { grid-template-columns: 1fr; }
  .news-grid       { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .gallery-grid    { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .gallery-item.large, .gallery-item.wide, .gallery-item.tall { grid-column: span 1; grid-row: span 1; }
  .toppers-grid    { grid-template-columns: repeat(2, 1fr); }
  .messages-grid   { max-width: 100%; }

  .testimonial-card { min-width: 100%; margin-right: 24px; }

  .form-row { grid-template-columns: 1fr; }
  .contact-form-card { padding: 24px 16px; }
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="number"], input[type="password"], select, textarea { font-size: 16px !important; }

  .footer      { padding-bottom: 88px; }
  .footer-main { padding: 48px 0 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 0; }
  .footer-brand { grid-column: auto; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 4px; }
  .footer-col   { border-bottom: 1px solid rgba(255,255,255,0.07); overflow: hidden; }
  .footer-col-title { padding: 14px 0; margin-bottom: 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
  .footer-col-title::after { content: '+'; font-size: 1.1rem; color: var(--accent, #d4af37); }
  .footer-col.open .footer-col-title::after { content: '-'; }
  .footer-links, .footer-contact-items-wrap { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; padding-bottom: 0; }
  .footer-col.open .footer-links, .footer-col.open .footer-contact-items-wrap { max-height: 400px; padding-bottom: 16px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; padding: 16px 0; }
  .footer-copyright { font-size: 0.76rem; }
  .footer-social    { gap: 12px; }
  .footer-social-icon { width: 42px; height: 42px; font-size: 0.95rem; }

  .timeline-item { flex-direction: column; padding-left: 56px; padding-right: 0; }
  .timeline-dot  { left: 16px; }
  .timeline::before { left: 16px; }

  .admission-content { flex-direction: column; text-align: center; gap: 20px; }
  .admission-actions { justify-content: center; flex-wrap: wrap; }
  .admission-actions .btn { width: 100%; max-width: 280px; }

  .disclosure-table-wrap, .marks-table-wrap, .table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .disclosure-table, .marks-table { min-width: 480px; }
  .disclosure-table th, .disclosure-table td { padding: 10px 12px; font-size: 0.82rem; }

  .gallery-lightbox-content { width: 96% !important; max-height: 80vh !important; }
  .gallery-lightbox-close { top: 8px !important; right: 8px !important; }

  .result-card        { padding: 20px !important; }
  .result-header-info { flex-direction: column !important; gap: 12px !important; }
  .result-footer      { flex-direction: column !important; gap: 12px !important; }

  .faculty-card { flex: 0 0 calc(50% - 15px); }
  .faculty-slider-wrapper { padding: 0 40px; }
  .faculty-placeholder { height: 180px; }

  .career-process-grid  { grid-template-columns: 1fr; }
  .career-openings-grid { grid-template-columns: 1fr; }
  .career-apply-box { padding: 32px 20px; }
  .career-step-connector { display: none; }

  #bus-route-canvas { height: 200px !important; }
  .bm-info-panel { flex-direction: column; }
  .bm-stop-card, .bm-bus-status { min-width: 100%; }
  .bm-title { font-size: 1.6rem; }
  .bm-tabs  { gap: 6px; flex-wrap: wrap; }
  .bm-tab   { padding: 6px 14px; font-size: 0.78rem; }

  #lab-network-canvas { height: 220px !important; }
  .lm-info-panel { flex-direction: column; }
  .lm-node-card, .lm-network-status { min-width: 100%; }
  .lm-title   { font-size: 1.6rem; }
  .lm-metrics { grid-template-columns: 1fr 1fr; }

  .page-hero { padding: 80px 0 40px; }
  .page-hero-title  { font-size: clamp(1.4rem, 6vw, 2.2rem) !important; }
  .about-content    { grid-template-columns: 1fr !important; }
  .about-image-main img { height: 280px !important; }
  .services-grid    { grid-template-columns: 1fr !important; }
  .features-grid    { grid-template-columns: 1fr !important; }

  .admin-grid-4, .admin-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .admin-table-wrap { overflow-x: auto; }
  .admin-chart      { width: 100% !important; height: auto !important; }
}

/* ============================================================
   576px -- LARGE MOBILE
   ============================================================ */
@media (max-width: 576px) {
  .hero-buttons        { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn   { width: 100%; text-align: center; justify-content: center; }
  .facilities-grid     { grid-template-columns: 1fr; }
  .gallery-grid        { grid-template-columns: 1fr; grid-auto-rows: 200px; }
  .faculty-card        { flex: 0 0 calc(50% - 15px); }
  .admission-actions .btn { width: 100%; max-width: 100%; }
}

/* ============================================================
   480px -- MOBILE
   ============================================================ */
@media (max-width: 480px) {
  :root { --section-padding: 50px 0; }

  .logo-image { width: 38px; height: 38px; }
  .hero { height: 100dvh; min-height: 520px; }
  .hero-stat { padding: 10px 8px; }

  .hero-title { font-size: 1.6rem !important; word-wrap: break-word; }
  .hero-title .highlight { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .hero-stats-grid { grid-template-columns: 1fr 1fr; border-radius: 12px; }
  .hero-stat { padding: 8px 4px; }
  .hero-stat-number { font-size: 1.15rem; }
  .hero-stat-label { font-size: 0.65rem; letter-spacing: 0; word-wrap: break-word; white-space: normal; }

  .hero-badge { font-size: 0.7rem; }

  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card   { padding: 20px 12px; border-radius: 12px; }
  .stat-number { font-size: 2rem; }
  .stat-icon   { width: 44px; height: 44px; font-size: 1.2rem; }

  .facilities-grid { grid-template-columns: 1fr; gap: 14px; }
  .facility-card   { height: 260px; width: 100%; aspect-ratio: unset; }
  .why-card { padding: 24px 18px; }

  .message-card   { padding: 20px; }
  .message-avatar { width: 68px; height: 68px; }

  .faculty-card   { flex: 0 0 100%; }
  .faculty-slider-wrapper { padding: 0 30px; }
  .faculty-placeholder { height: 200px; }
  .faculty-name   { font-size: 1.1rem; }

  .career-process-step { padding: 24px 16px; }
  .career-step-number  { width: 48px; height: 48px; font-size: 1.1rem; }
  .career-opening-card { padding: 20px 16px; }
  .career-apply-box    { padding: 28px 16px; }
  .career-download-btn { flex-direction: column; text-align: center; width: 100%; }

  .erp-auth-card { padding: 24px 14px !important; width: 95%; }

  .about-image-main img { height: 220px !important; }

  #bus-route-canvas   { height: 160px !important; }
  .bm-title           { font-size: 1.3rem; }
  .bm-canvas-wrap     { padding: 12px; }
  #lab-network-canvas { height: 180px !important; }
  .lm-canvas-wrap     { padding: 12px; }

  .admin-grid-4, .admin-grid-3, .admin-grid-2 { grid-template-columns: 1fr !important; }

  .footer-logo-text .name { font-size: 0.8rem; }
  .footer-desc            { font-size: 0.82rem; }
  .footer-social-icon     { width: 40px; height: 40px; }
}

/* ============================================================
   375px -- SMALL MOBILE
   ============================================================ */
@media (max-width: 375px) {
  .container    { padding: 0 12px; }
  .hero-title   { font-size: 1.55rem; }
  .stats-grid   { gap: 10px; }
  .navbar-actions { gap: 8px; }
  .why-card-icon { width: 50px; height: 50px; }
}

/* TOUCH TARGETS */
@media (max-width: 1024px) {
  a, button, [role="button"], input[type="submit"], input[type="button"] { min-height: 44px; }
  .facility-link, .news-read-more, .message-read-more,
  .dropdown-item, .mega-menu-item, .drawer-nav-link { min-height: 44px; display: flex; align-items: center; }
}

/* CONSISTENT IMAGE COVERS */
.facility-card img,
.news-image img,
.gallery-item img,
.about-image-main img,
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* MOBILE DRAWER */
.mobile-drawer  { width: min(340px, 90vw) !important; }
.mobile-overlay { width: 100vw; height: 100vh; }

/* FOOTER LINK ARROW */
.footer-link::before { content: '\203a'; }

/* LARGE DESKTOP (1441px+) */
@media (min-width: 1441px) {
  :root { --container-width: 1320px; }
  .hero-title    { font-size: 4.2rem; }
  .section-title { font-size: 3rem; }
  .facilities-grid { grid-template-columns: repeat(4, 1fr); }
  .why-grid { grid-template-columns: repeat(3, 1fr); }
}

/* PRINT */
@media print {
  .navbar, .footer, .hero-arrows, .scroll-indicator,
  .floating-buttons, .hamburger, .top-bar { display: none !important; }
  body { font-size: 12pt; }
}

/* ============================================================
   ERP / ADMIN / STUDENT PORTAL — RESPONSIVE CSS
   Applied to: erp-login, erp-register, erp-dashboard,
               erp-admin, admin-login, gurudev-super,
               student-portal, examination-result, notice-board,
               e-library
   ============================================================ */

/* ── ERP AUTH PAGES (login / register) ── */
.erp-auth-page,
body[style*="flex"][style*="center"] {
  padding: 16px;
}
.erp-auth-card {
  width: 90%;
  max-width: 460px;
  padding: clamp(24px, 5vw, 40px);
}
.erp-auth-card.wide { max-width: 800px; }

.erp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
  .erp-auth-card       { padding: 28px 20px; max-height: 95dvh; overflow-y: auto; }
  .erp-auth-card.wide  { max-width: 100%; }
  .erp-form-grid       { grid-template-columns: 1fr; gap: 14px; }
  .erp-auth-header h2  { font-size: 1.4rem; }
  .erp-auth-header p   { font-size: 0.85rem; }
}
@media (max-width: 480px) {
  .erp-auth-card       { padding: 20px 14px; width: 96%; }
  .erp-auth-header h2  { font-size: 1.2rem; }
}

/* ── ERP DASHBOARD ── */
.erp-top-nav {
  padding: clamp(10px, 2vw, 16px) clamp(16px, 4vw, 32px);
}
.erp-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.feature-card {
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.erp-profile-banner {
  border-radius: clamp(12px, 3vw, 24px);
  padding: clamp(20px, 4vw, 36px);
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  flex-wrap: wrap;
  align-items: center;
}
.erp-profile-img-wrapper img {
  width: clamp(70px, 15vw, 110px);
  height: clamp(70px, 15vw, 110px);
  border-radius: 50%;
  object-fit: cover;
}
.erp-profile-info h1 { font-size: clamp(1.2rem, 4vw, 2rem); }

.erp-modal { width: min(94vw, 600px); max-height: 88vh; overflow-y: auto; }

@media (max-width: 768px) {
  .erp-top-nav > div { flex-wrap: wrap; gap: 10px; }
  .erp-top-nav h2    { font-size: 1rem; }
  .erp-features-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .erp-profile-banner { flex-direction: column; text-align: center; }
  .erp-profile-banner .badges-row { justify-content: center; flex-wrap: wrap; }
  .erp-modal { width: 96vw; }
  .erp-modal-header h3 { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .erp-features-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .feature-card       { padding: 14px 10px; flex-direction: column; text-align: center; gap: 8px; }
  .icon-box           { width: 40px !important; height: 40px !important; font-size: 1.1rem !important; }
  .text-box h3        { font-size: 0.85rem; }
  .text-box p         { font-size: 0.75rem; }
  .erp-profile-info h1 { font-size: 1.2rem; }
}

/* ── ERP ADMIN TABLE ── */
.admin-table-wrap,
.erp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.admin-table { min-width: 600px; }

@media (max-width: 768px) {
  .admin-table th, .admin-table td { padding: 10px 12px; font-size: 0.82rem; }
}

/* ── SUPER ADMIN / GURUDEV-SUPER ── */
.admin-layout, .sa-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar, .sa-sidebar {
  width: 260px;
  flex-shrink: 0;
  transition: transform 0.3s ease, width 0.3s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-main, .sa-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  padding: clamp(16px, 3vw, 32px);
}
.admin-stats-grid, .sa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  color: inherit;
}

@media (max-width: 992px) {
  .admin-layout, .sa-layout { position: relative; }
  .admin-sidebar, .sa-sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    z-index: 9999;
    height: 100dvh;
    width: min(280px, 80vw);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  }
  .admin-sidebar.open, .sa-sidebar.open { transform: translateX(0); }
  .admin-main, .sa-main { margin-left: 0 !important; }
  .mobile-sidebar-toggle { display: flex; align-items: center; }
  .admin-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9998; display: none; }
  .admin-overlay.visible { display: block; }
}
@media (max-width: 768px) {
  .admin-stats-grid, .sa-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .admin-topbar { padding: 12px 16px; }
}
@media (max-width: 480px) {
  .admin-stats-grid, .sa-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-main, .sa-main { padding: 12px; }
  .stat-number { font-size: 1.6rem; }
}

/* ── ADMIN LOGIN (admin-login.html — standalone dark theme) ── */
.login-wrapper {
  width: 100%;
  max-width: 480px;
  padding: clamp(16px, 4vw, 24px);
  margin: 0 auto;
}
.login-card {
  border-radius: clamp(12px, 3vw, 24px);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
}
@media (max-width: 480px) {
  .login-wrapper { padding: 16px; }
  .login-card    { padding: 24px 16px; border-radius: 16px; }
}

/* ── STUDENT PORTAL ── */
.portal-hero { padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 6vw, 80px); }
.portal-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
@media (max-width: 768px) {
  .portal-features-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 480px) {
  .portal-features-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── EXAMINATION RESULT ── */
.result-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 20px);
}
.marks-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.marks-table { min-width: 480px; }

@media (max-width: 768px) {
  .result-card         { border-radius: 12px; }
  .result-header-info  { flex-direction: column; gap: 12px; }
  .result-footer       { flex-direction: column; gap: 12px; }
  .marks-table th, .marks-table td { padding: 10px 12px; font-size: 0.83rem; }
}
@media (max-width: 480px) {
  .result-marks-bar    { height: 8px; }
  .result-grade        { font-size: 2rem; }
}

/* ── NOTICE BOARD ── */
.notice-list { display: flex; flex-direction: column; gap: 16px; }
.notice-card {
  border-radius: 12px;
  padding: clamp(16px, 3vw, 24px);
}
.notice-card-header { flex-wrap: wrap; gap: 10px; }

@media (max-width: 480px) {
  .notice-badge { font-size: 0.72rem; padding: 4px 8px; }
}

/* ── E-LIBRARY ── */
.elibrary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
@media (max-width: 600px) {
  .elibrary-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 380px) {
  .elibrary-grid { grid-template-columns: 1fr; }
}

/* ── MODALS on ERP pages ── */
.erp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  place-items: center;
  z-index: 10000;
  padding: 16px;
}
.erp-modal-overlay.active { display: grid; }
.erp-modal {
  background: #fff;
  border-radius: 20px;
  width: min(94vw, 600px);
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.erp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.erp-modal-body { padding: 20px 24px; }

@media (max-width: 480px) {
  .erp-modal-header { padding: 16px; }
  .erp-modal-body   { padding: 16px; }
  .erp-modal-header h3 { font-size: 1rem; }
}

/* ── CAREER APPLICATION FORM (print layout) ── */
@media (max-width: 768px) {
  .page { padding: 20px !important; }
  .field-row { flex-direction: column !important; gap: 12px !important; }
  .photo-box { width: 90px !important; height: 110px !important; }
  table { font-size: 11pt !important; }
  .sign-row { flex-direction: column; gap: 20px; }
}
@media print {
  body { padding: 0; font-size: 11pt; }
  .page { border: none; padding: 0; }
}

/* ── GLOBAL TABLE WRAPPER — ensure no page scrolls horizontally ── */
table {
  width: 100%;
  max-width: 100%;
}
.table-responsive,
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ── GLOBAL CHART FIX ── */
canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* ── INPUT FONT SIZE — prevent iOS auto-zoom ── */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="date"],
  select,
  textarea { font-size: 16px !important; }
}
