/* ================================================================
   EduManager Pro — Responsive Mobile / Tablet
   Breakpoints: 480px | 768px | 1024px
   Brand OMBF: #4A148C #6A1B9A #1E88E5 #00BCD4 #F9A825
   ================================================================ */

/* ---- Hamburger nav button (mobil) ---- */
.nhbg {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: .4rem .5rem;
  margin-left: .5rem;
  z-index: 220;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background .15s;
}
.nhbg:hover { background: rgba(255,255,255,.12); }
.nhbg span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform .22s ease, opacity .15s;
}
.nhbg.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nhbg.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nhbg.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---- Overlay fundal meniu mobil ---- */
.novl {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.novl.open { display: block; }

/* ================================================================
   TABLET LANDSCAPE + DESKTOP  ≥ 1025px — nimic de modificat
   ================================================================ */

/* ================================================================
   TABLET  769px – 1024px
   ================================================================ */
@media (max-width: 1024px) {
  .w { padding: 1.2rem; }
  nav a { font-size: .79rem; padding: .28rem .6rem; }
}

/* ================================================================
   TABLET PORTRAIT  481px – 768px
   ================================================================ */
@media (max-width: 768px) {
  /* --- Nav: ascunde link-urile, arată hamburger --- */
  nav { display: none; }
  .nhbg { display: flex; }
  .ub { display: none !important; }

  /* Meniu fullscreen pe mobil */
  nav.nav-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(160deg, #2B174F 0%, #4A148C 50%, #1E88E5 100%);
    z-index: 210;
    padding: 4.5rem 1.5rem 2rem;
    gap: .3rem;
    overflow-y: auto;
  }
  nav.nav-open a {
    font-size: .98rem;
    padding: .72rem 1rem;
    border-radius: 10px;
    color: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(255,255,255,.07);
    transition: background .15s;
  }
  nav.nav-open a:hover,
  nav.nav-open a.on {
    background: rgba(255,255,255,.15);
    color: #fff;
  }

  /* Header mai compact */
  header { padding: .65rem .9rem; gap: .5rem; }
  .logo { font-size: .95rem; }

  /* Container */
  .w { padding: 1rem; }

  /* Card */
  .card { padding: 1.1rem .9rem; }

  /* Titlu pagina */
  .pt { font-size: 1.25rem; }

  /* Tabele */
  .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: .78rem; min-width: 520px; }
  th, td { padding: .42rem .6rem; }

  /* Butoane touch-friendly */
  .btn { min-height: 44px; font-size: .82rem; }
  .btn.sm { min-height: 36px; padding: .3rem .65rem; font-size: .74rem; }

  /* Grid-uri formular */
  .g3 { grid-template-columns: 1fr 1fr; }

  /* Cockpit KPI — 2 coloane pe tabletă */
  .cpc-kpi-grid { grid-template-columns: 1fr 1fr !important; }
  /* Cockpit QA — 3 coloane pe tabletă */
  .cpc-qa-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ================================================================
   TELEFON MARE  481px – 640px (deja are unele reguli de la 768)
   ================================================================ */
@media (max-width: 640px) {
  .cpc-wrap { padding: 1rem .85rem; border-radius: 12px; }
  .cpc-kpi-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ================================================================
   TELEFON MIC  ≤ 480px
   ================================================================ */
@media (max-width: 480px) {
  /* Container */
  .w { padding: .75rem; }

  /* Card */
  .card { padding: .9rem .75rem; border-radius: 10px; }
  .pt { font-size: 1.1rem; margin-bottom: .75rem; }

  /* Header */
  header { padding: .6rem .75rem; }
  .logo { font-size: .88rem; }

  /* Tabele: scroll orizontal forțat */
  .tw { border-radius: 8px; }
  table { font-size: .72rem; min-width: 480px; }
  th, td { padding: .35rem .42rem; white-space: nowrap; }

  /* Butoane */
  .btn { min-height: 44px; font-size: .8rem; padding: .45rem .7rem; }
  .btn.sm { min-height: 36px; font-size: .72rem; }

  /* Formular — previne zoom pe iOS la focus */
  .fg input, .fg select, .fg textarea { font-size: 16px !important; }

  /* Grid 1 coloana */
  .g2, .g3 { grid-template-columns: 1fr; }

  /* Flex wrap forțat pe grupuri de butoane */
  div[style*="display:flex"][style*="gap"] { flex-wrap: wrap; }

  /* Cockpit KPI — 1 coloana pe telefon mic */
  .cpc-kpi-grid { grid-template-columns: 1fr !important; }
  .cpc-wrap { padding: .85rem .7rem; }

  /* Cockpit QA — scroll orizontal pe telefon */
  .cpc-qa-grid {
    display: flex !important;
    gap: .42rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
  }
  .cpc-qa-grid .cpc-qa { min-width: 96px; flex-shrink: 0; }

  /* Cockpit next-step card */
  .cpc-wrap .cpc-step { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   Utilitar: scroll indicator pe tabele mobile
   ================================================================ */
@media (max-width: 768px) {
  .tw::after {
    content: "";
    display: none;
  }
  .tw {
    position: relative;
  }
}

/* ================================================================
   Print — nu afecta layout-ul mobil
   ================================================================ */
@media print {
  .nhbg, .novl, header nav { display: none !important; }
  .w { padding: 0; max-width: 100%; }
}
