@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ════════════════════════════════════════════════════════════════
   ITI Ke Gyani — Professional Design System
   Inspired by Udemy's clean, modern interface
   ════════════════════════════════════════════════════════════════ */

:root {
  /* ── ITI Ke Gyani v2 Brand Override ── */
  --saffron:        #FF6B00;
  --saffron-dark:   #D45600;
  --saffron-light:  #FFF3E8;
  --saffron-glow:   rgba(255,107,0,0.14);
  --navy:           #0A1628;
  --navy-mid:       #0F2040;
  --navy-light:     #162B50;
  /* Legacy aliases → saffron */
  --purple:         #FF6B00;
  --purple-dark:    #D45600;
  --purple-light:   #FFF3E8;
  --primary:        #FF6B00;
  --primary-dark:   #D45600;
  --primary-light:  #FFF3E8;
  /* Text */
  --dark:    #0F1629;
  --dark2:   #4A4F6A;
  --muted:   #8B90A7;
  /* Surfaces */
  --bg:      #F3F5FA;
  --border:  rgba(0,0,0,0.07);
  --white:   #FFFFFF;
  /* Semantic */
  --green:   #00C978;
  --red:     #EF4444;
  --sky:     #1A91FF;
  --gold:    #F5A623;

  --purple:       #FF6B00;
  --purple-dark:  #D45600;
  --purple-light: #FFF3E8;
  --dark: #0F1629; --navy: #0A1628;
  --dark2: #4A4F6A;
  --muted: #8B90A7;
  --border:       #e5e7eb;
  --bg:           #f7f9fa;
  --white:        #ffffff;
  --success:      #22c55e;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --radius:       6px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; max-width: 100%; }
html { scroll-behavior: smooth; }

/* Mobile safety net: force every direct section/container child to honor viewport width.
   Without this, an inner element with fixed pixel width can push the page wider than the
   viewport — Safari then auto-zooms-out and the user sees a blank band on the right side. */
@media (max-width: 900px) {
  body > *,
  .navbar-pub, .navbar-pub > *,
  .ticker-bar, .ticker-bar > *,
  .hero, .hero > *,
  .section, .section > *,
  .footer, .footer > *,
  .site-footer, .site-footer > *,
  .def-hero, .def-final {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .container, .container-sm, .navbar-inner, .footer-inner, .section-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  img, video, iframe { max-width: 100%; height: auto; }
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--dark2);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--saffron, #FF6B00); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Layout Utilities ───────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1   { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.w-full   { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden   { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }

/* Spacing */
.p-0  { padding: 0; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }
.p-6  { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* Typography */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }
.text-2xl  { font-size: 22px; }
.fw-500    { font-weight: 500; }
.fw-600    { font-weight: 600; }
.fw-bold   { font-weight: 700; }
.fw-black  { font-weight: 900; }
.text-muted   { color: var(--muted); }
.text-dark    { color: var(--dark); }
.text-purple  { color: var(--saffron, #FF6B00); }
.text-success { color: #065f46; }
.text-danger  { color: #991b1b; }

/* ── Grid Layouts ──────────────────────────────────────────────── */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: .01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-primary { background: var(--saffron, #FF6B00); color: #fff; border-color: var(--saffron, #FF6B00); }
.btn-primary:hover { background: var(--saffron-dark, #D45600); border-color: var(--saffron-dark, #D45600); color: #fff; }
.btn-outline { background: #fff; color: var(--dark); border-color: var(--border); }
.btn-outline:hover { border-color: var(--saffron, #FF6B00); color: var(--saffron, #FF6B00); background: var(--saffron-light, #FFF3E8); }
.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger  { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-yellow  { background: #f59e0b; color: #1c1d1f; border-color: #f59e0b; }
.btn-ghost   { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--dark); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 4px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 8px; }

/* ── Form Elements ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.req { color: var(--danger); margin-left: 2px; }

.input, textarea, select.input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--dark);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
.input:focus, textarea:focus, select.input:focus {
  border-color: var(--saffron, #FF6B00);
  box-shadow: 0 0 0 3px rgba(164,53,240,.1);
}
.input::placeholder { color: #9ca3af; }
textarea { resize: vertical; min-height: 90px; }
.input[readonly] { background: var(--bg); color: var(--muted); }

/* Password field wrapper */
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 44px; }
.pass-eye {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 42px; background: none; border: none;
  cursor: pointer; font-size: 16px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.pass-eye:hover { color: var(--dark); }

/* Checkbox & Radio */
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check-label input { width: 16px; height: 16px; accent-color: var(--saffron, #FF6B00); cursor: pointer; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  flex-wrap: wrap;
  gap: 8px;
}
.card-header h2, .card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}
.card-body { padding: 20px; }

/* ── Stat Cards ──────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 900; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 500; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.table thead tr { background: #f9fafb; }
.table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--dark);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafafa; }

/* ── Tabs ────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
  transition: all .15s;
}
.tab-btn:hover { color: var(--dark); background: #f9fafb; }
.tab-btn.active { color: var(--saffron, #FF6B00); border-bottom-color: var(--saffron, #FF6B00); background: var(--saffron-light, #FFF3E8); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Progress Bar ────────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron, #FF6B00), #7c3aed);
  border-radius: 9999px;
  transition: width .4s ease;
}

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #065f46; }
.alert-danger  { background: #fff5f5; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #fff;
}
.modal-header h3 { font-size: 16px; font-weight: 800; color: var(--dark); margin: 0; }
.modal-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #9ca3af;
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: #f3f4f6; color: var(--dark); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  background: #fafafa;
}

/* ── Dashboard Layout ────────────────────────────────────────────── */
.dash-wrap {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.topbar h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  margin: 0;
  flex: 1;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--dark);
  padding: 4px;
}
.content { padding: 24px; flex: 1; }

/* ── Public Navbar ───────────────────────────────────────────────── */
.navbar {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand-box {
  width: 32px; height: 32px;
  background: var(--saffron, #FF6B00);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
}
.nav-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer { background: var(--dark); color: rgba(255,255,255,.5); margin-top: 48px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 20px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px; margin-bottom: 32px; }
.footer-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links a { color: rgba(255,255,255,.45); font-size: 13px; text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ── HR Rule ─────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Section header (public pages) ──────────────────────────────── */
.section-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-title { font-size: 20px; font-weight: 800; color: var(--dark); }
.section-sub   { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── Responsive ──────────────────────────────────────────────────── */
/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  .hamburger { display: block; }
  #main-sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
    z-index: 200;
    transition: left .25s ease;
    box-shadow: none;
    overflow-y: auto;
  }
  #main-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar h1 { font-size: 16px; }
  .dash-wrap { overflow-x: hidden; }
}
@media (max-width: 768px) {
  /* Public pages */
  .section-inner, .navbar-inner, .footer-inner { padding-left: 16px !important; padding-right: 16px !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-auto { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .modal { max-height: 95vh; border-radius: 10px 10px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .stat-value { font-size: 22px; }
  .grid-auto { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
}

/* ── Public-page 2-column layout (main + sidebar) — mobile-safe ── */
.pub-2col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: flex-start; max-width: 1200px; margin: 32px auto; padding: 0 20px; }
@media (max-width: 900px) { .pub-2col { grid-template-columns: 1fr; padding: 0 16px; margin: 20px auto; } }

/* ── Panel Shared Components ─────────────────────────────────── */
.page-hdr{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:24px;flex-wrap:wrap;gap:12px}
.page-title{font-size:22px;font-weight:800;color:var(--dark)}
.page-sub{font-size:13px;color:var(--muted);margin-top:3px}
.topbar-right{display:flex;align-items:center;gap:10px}

/* Quick action buttons - professional card style */
.qa-btn{
  display:flex;align-items:center;gap:8px;
  padding:10px 14px;
  border:1.5px solid var(--border);
  border-radius:8px;
  color:var(--dark);
  text-decoration:none;
  font-size:12px;font-weight:600;
  transition:all .15s ease;
  background:#fff;
  cursor:pointer;
  min-width:0;
  overflow:hidden;
}
.qa-btn:hover{
  border-color:var(--saffron, #FF6B00);
  background:var(--saffron-light, #FFF3E8);
  color:var(--saffron, #FF6B00);
  text-decoration:none;
  transform:translateX(4px);
  box-shadow:0 2px 8px rgba(164,53,240,.12);
}
.qa-btn .qa-ic{
  width:30px;height:30px;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;flex-shrink:0;
}
.qa-btn .qa-txt{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qa-btn .qa-arr{color:var(--muted);font-size:14px;transition:.15s}
.qa-btn:hover .qa-arr{color:var(--saffron, #FF6B00)}

/* Course / content rows */
.content-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #f3f4f6}
.content-row:last-child{border-bottom:none}
.content-thumb{width:48px;height:36px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0}

/* Welcome banner */
.welcome-banner{
  background:linear-gradient(135deg,#1c1d1f 0%,#2d1f47 60%,#1a2540 100%);
  border-radius:10px;padding:24px 28px;color:#fff;
  margin-bottom:24px;
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:16px;
}
.welcome-banner h2{font-size:22px;font-weight:800;margin:0 0 4px;color:#fff}
.welcome-banner p{font-size:13px;color:rgba(255,255,255,.6);margin:0}
.pending-warn{
  background:#fef9c3;border:1px solid #fde68a;
  border-radius:8px;padding:14px 18px;
  margin-bottom:20px;font-size:13px;color:#854d0e;
  display:none;line-height:1.6;
}

/* ══════════════════════════════════════════════════════════════════════
   MOB-1: HARDENED MOBILE OVERFLOW GUARD
   ──────────────────────────────────────────────────────────────────────
   Fixes the "blank space on the side" symptom that several public pages
   exhibited on phones. Even with `overflow-x:hidden` on body, a single
   inline-styled fixed-pixel sidebar (e.g. `width:200px;flex-shrink:0`)
   was enough to push iOS Safari into shrink-to-fit, painting the empty
   margin band on the right. This block:
     1. clamps html + body to 100vw with `overflow-x:clip` (better than
        hidden — doesn't create a stacking context that breaks sticky
        positioning on inner elements);
     2. wraps every <table>/<pre>/<code> in horizontal scroll so they
        never push the page width;
     3. forces every known fixed-pixel sidebar to collapse to full-width
        below the 900-px breakpoint;
     4. neutralises any inline `style="width:NNNpx"` element via a
        :where() catch-all that respects specificity.
   Keep this block at the END of compat.css so it overrides earlier rules.
   ══════════════════════════════════════════════════════════════════════ */

/* 1. Root-level clamp — strongest guarantee no element makes the page
      wider than the viewport. `clip` is the preferred value over `hidden`
      because hidden creates a scroll container that breaks `position:sticky`
      on inner elements (we have sticky toolbars on /about-trade.php, etc.) */
html, body {
  max-width: 100vw;
  overflow-x: clip;
}

/* 2. Long content (tables, pre, code blocks) — scroll inside its container
      instead of bleeding past the viewport edge */
table          { max-width: 100%; }
pre, code, kbd { max-width: 100%; overflow-x: auto; word-wrap: break-word; }

/* 3. Media — never wider than container (defensive; itigyani.css does this
      for <img>, but we also catch <video>/<iframe>/<embed>/<object>) */
img, video, iframe, embed, object, svg {
  max-width: 100%;
  height: auto;
}

/* 4. Mobile-only hardening — covers every known offender across public
      pages (study-material.php, courses.php, jobs.php, course-detail.php,
      exam-take.php, course-learn.php, about-trade.php, etc.) */
@media (max-width: 900px) {
  /* a) Any direct child of body must respect viewport width. */
  body > *,
  body > * > * {
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  /* b) Collapse known fixed-pixel sidebars to full-width. These selectors
        match the *.flex-shrink:0 sidebars hard-coded in the public pages. */
  .courses-filter-sidebar,
  .sidebar-curriculum,
  .cd-aside,
  .pub-2col > aside,
  .pub-2col > .aside {
    width: 100% !important;
    flex: 1 1 100% !important;
    border-left: none !important;
  }

  /* c) Two-col grids in inline style="grid-template-columns:NNNpx 1fr" —
        force single column for any rule that didn't already define one. */
  [style*="grid-template-columns:1fr 380px"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns:1fr 270px"],
  [style*="grid-template-columns:1fr 220px"],
  [style*="grid-template-columns:220px 1fr"],
  [style*="grid-template-columns:200px 1fr"],
  [style*="grid-template-columns:240px 1fr"],
  [style*="grid-template-columns:260px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* d) Inline width:NNNpx on flex children (e.g. <div style="width:200px;
        flex-shrink:0"> in jobs.php). Drop to auto so the flex parent
        can collapse them. */
  [style*="width:200px"][style*="flex-shrink:0"],
  [style*="width:220px"][style*="flex-shrink:0"],
  [style*="width:240px"][style*="flex-shrink:0"],
  [style*="width:260px"][style*="flex-shrink:0"],
  [style*="width:280px"][style*="flex-shrink:0"],
  [style*="width:300px"][style*="flex-shrink:0"],
  [style*="width:320px"][style*="flex-shrink:0"] {
    width: 100% !important;
    flex-shrink: 1 !important;
  }
}

/* 5. Phone-sized — tighter container padding so cards don't kiss the edge */
@media (max-width: 480px) {
  .container,
  .container-sm,
  [style*="padding:0 20px"],
  [style*="padding: 0 20px"] {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  /* Hero text size cascade — keep headings from triggering h-scroll on
     very long single words (Hindi compound nouns occasionally do this) */
  h1, h2 { overflow-wrap: anywhere; word-break: break-word; }
}

/* ══════════════════════════════════════════════════════════════════════
   MOB-2: PANEL (DASHBOARD) MOBILE LAYOUT GUARD
   ──────────────────────────────────────────────────────────────────────
   All role panels (admin/instructor/institute/hr/student) share the same
   layout: .app-layout > .app-sidebar + .app-main > .app-topbar + .app-content
   Below 900 px the sidebar is fixed off-screen (handled in sidebar.php) so
   .app-main fills the viewport. The remaining failure modes that produced
   "blank space on the side" inside panels:
     a) several .dash-table tables are NOT wrapped in .table-wrap and have
        min-width:600px (from itigyani.css line 830) — they overflow on
        narrow viewports;
     b) .app-content has default overflow-x:visible, so an overflowing
        child pushes layout wider than the viewport on iOS;
     c) the .app-topbar and .welcome-banner use padding:0 24px which is
        excessive on 320–360 px phones;
     d) ::before/::after decorations on the welcome-banner / hero strips
        in some panel pages can leak past the viewport.
   This block fixes a–d with surgical rules. Keep AFTER MOB-1.
   ══════════════════════════════════════════════════════════════════════ */

/* Panel layout — root sizing on every viewport. .app-layout already has
   height:100vh from itigyani.css; we also pin its width so it can never
   exceed 100vw, and explicitly clip horizontal overflow on every direct
   wrapper. */
.app-layout {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

/* Panel pages use ~5 different DOM patterns for the narrow-form layout:
     a) .app-main  > .content[style="max-width:NNN"]                12 pages
     b) .app-main  > .app-content > .content[style="max-width:NNN"]  1 page
     c) .app-main  > .app-content > .card[style="max-width:NNN"]    settings.php (3 cards stacked)
     d) .app-main  > .app-content > div[style="max-width:NNN"]       coupons.php etc.
     e) inline plain wrapper with style="max-width:NNN"              one-offs
   Rather than enumerate every class, we center ANY direct child of the
   panel-layout containers that carries an inline `max-width`. We exclude
   the topbar/sidebar/app-content themselves so the layout stays intact. */
.app-content > [style*="max-width"],
.app-main    > [style*="max-width"]:not(.app-topbar):not(.app-sidebar):not(.app-content):not(.app-main) {
  margin-left:  auto !important;
  margin-right: auto !important;
  /* Bump the narrow caps (560–900 px on most forms / cards) up to 1200 px
     so two-column field rows breathe. The inline `max-width:NNNpx` is
     overridden here. The element keeps shrinking on narrower viewports. */
  max-width: 1200px !important;
}

/* .content has flex:1 (from line 515) which makes it stretch in column
   flex — we also need to set width:100% explicitly so the centered
   element fills up to the 1200 px cap. */
.app-content > .content,
.app-main    > .content {
  width: 100%;
  padding-left:  24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* Tablet + phone — let everything fill the column. */
@media (max-width: 768px) {
  .app-content > [style*="max-width"],
  .app-main    > [style*="max-width"]:not(.app-topbar):not(.app-sidebar):not(.app-content):not(.app-main) {
    max-width: 100% !important;
  }
  .app-content > .content,
  .app-main    > .content {
    padding-left:  14px;
    padding-right: 14px;
  }
}
.app-main {
  min-width: 0; /* belt-and-braces — itigyani.css already sets this, but if
                   that file fails to load (e.g. behind a stale CDN) the
                   flex item still respects its content width */
  max-width: 100%;
}
.app-content {
  /* default was overflow-y:auto with no overflow-x constraint, so a wide
     child (unwrapped table, code block, etc.) escapes the column and
     pushes the layout wider. We use `hidden` not `clip` here because
     `clip` + `overflow-y:auto` is invalid per spec — browsers downgrade
     it inconsistently. `hidden` is the safe horizontal clamp; vertical
     sticky children still work because they scroll with this element. */
  overflow-x: hidden;
  max-width: 100%;
}

/* Below the sidebar breakpoint */
@media (max-width: 900px) {
  /* Drop the global min-width:600px hard floor on .dash-table — on small
     phones it's the biggest single cause of "blank space" (the table
     pushes layout wider than viewport, iOS then shrink-to-fit and paints
     the unused band). Tables inside .table-wrap already scroll inside;
     this rule helps the unwrapped ones too. */
  .dash-table { min-width: 0 !important; }

  /* Auto-wrap unwrapped .dash-table so it scrolls inside its column
     instead of pushing the dashboard. display:block changes table layout
     but is the only CSS-only way to add a scroll container without
     editing 6 panel pages. The table's own column widths come from cell
     content because we don't set table-layout:fixed. */
  .app-content > table.dash-table,
  .card-body  > table.dash-table,
  .card       > table.dash-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Topbar + content padding tightened so 24-px edges don't eat 13 % of
     a 360-px phone. Cards remain comfortable inside. */
  .app-topbar  { padding: 0 14px !important; gap: 10px !important; }
  .app-content { padding: 14px !important; }

  /* Stat-grid 4-col → 2-col fallback for any panel that forgot its own
     media query (defensive — most panels already define it). */
  .stat-g4, .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Generic 2-col grids on dashboard pages collapse to 1-col */
  .grid-2 { grid-template-columns: 1fr !important; }
}

/* Phone sizing — even tighter, and stop welcome-banner decorations from
   leaking past the viewport edge */
@media (max-width: 480px) {
  .app-content { padding: 12px !important; }
  .welcome-banner, .welcome-grad {
    padding: 16px !important;
    overflow: hidden;            /* contain ::before / ::after blobs */
  }
  .welcome-banner h2 { font-size: 18px !important; }
  .stat-g4, .stats-grid-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  /* Topbar title/subtitle wrap rather than push the right-side actions
     off-screen */
  .app-topbar > div { min-width: 0; }
  .app-topbar h1, .app-topbar .topbar-page-title { font-size: 14px !important; }
  /* Modal sheets — full-width with safe edge gutter */
  .modal-overlay { padding: 12px !important; }
  .modal { max-width: 100% !important; }
}


