/* ============================================================
   PGP DATA ENTRY – styles.css COMPLETO E DEFINITIVO
   ============================================================ */

:root {
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-soft:   #e0edff;
  --bg:          #f3f4f6;
  --border:      #d1d5db;
  --text:        #111827;
  --muted:       #6b7280;
  --white:       #ffffff;
  --backheader:  #f1f6f7;
}

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

body.pgp-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================================
   HEADER – sfondo bianco
   ============================================================ */
.pgp-header {
  background-color: var(--backheader);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.pgp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  min-height: 90px;
}

.pgp-header-logo img {
  display: block;
}

.pgp-header-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.pgp-navbar {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.pgp-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 50px;
}

/* Voci menu */
.pgp-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.1rem;
  margin-left: auto;
}

.pgp-nav-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  color: #1f2937;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  /* nessun transition sul background per evitare stati residui */
  transition: color 0.15s;
  background: transparent;
  outline: none;
}

/* Hover: solo quando il mouse è sopra */
.pgp-nav-links a:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

/* Focus: nessuno sfondo */
.pgp-nav-links a:focus,
.pgp-nav-links a:focus-visible,
.pgp-nav-links a:focus-within {
  background: transparent;
  color: #1f2937;
  outline: none;
  box-shadow: none;
}

/* Attivo: solo la pagina corrente */
.pgp-nav-links a.pgp-active {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 600;
}

/* Hamburger a destra */
.pgp-ham {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  margin-left: auto;
  outline: none;
}
.pgp-ham:focus,
.pgp-ham:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: var(--border);
}
.pgp-ham span {
  display: block;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transition: all 0.25s;
}
.pgp-ham.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pgp-ham.open span:nth-child(2) { opacity: 0; }
.pgp-ham.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile a tendina */
.pgp-mobile-drop {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.pgp-mobile-drop.open { display: block; }
.pgp-mobile-drop ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1rem;
}
.pgp-mobile-drop ul li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  color: #1f2937;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 6px;
  outline: none;
  transition: color 0.15s;
  background: transparent;
}
.pgp-mobile-drop ul li a:hover {
  color: var(--blue);
  background: var(--blue-soft);
}
.pgp-mobile-drop ul li a:focus,
.pgp-mobile-drop ul li a:focus-visible {
  background: transparent;
  outline: none;
}

/* Responsive navbar */
@media (max-width: 991px) {
  .pgp-ham       { display: flex; }
  .pgp-nav-links { display: none; }
  .pgp-nav-inner { padding: 0 1rem; }
}

/* ============================================================
   INFO UTENTE
   ============================================================ */
.pgp-uinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.pgp-uname {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.pgp-uname i { color: var(--blue); margin-right: 3px; }

.pgp-upills {
  display: flex;
  gap: 0.25rem;
  margin-top: 2px;
}
.pgp-pill {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pgp-pill-blue { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.pgp-pill-gray { background: #e5e7eb; color: #374151; border-color: var(--border); }

.pgp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(37,99,235,0.3);
  cursor: default;
}
.pgp-logout {
  color: var(--muted);
  font-size: 1.1rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.pgp-logout:hover { color: #ef4444; }

/* ============================================================
   MAIN
   ============================================================ */
.pgp-main h2 {
  color: var(--text);
  font-weight: 600;
}
/* ============================================================
   TAB PAGE – occupa tutto lo spazio disponibile
   ============================================================ */
.pgp-tab-page {
  display: flex;
  flex-direction: column;
  padding: 0;          /* ← era 0.75rem 1rem 1rem, azzera tutto */
  min-height: calc(100vh - 200px);
}

/* ============================================================
   TAB NAVIGATION
   ============================================================ */
.pgp-tabs {
  flex-shrink: 0;
}

.pgp-tabs .nav-link {
  color: var(--muted);
  background: var(--white);
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 0.6rem 0.6rem 0 0;
  margin-right: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  transition: all 0.15s;
  position: relative;
  z-index: 1;
}

.pgp-tabs .nav-link:hover {
  color: var(--tab-border, var(--blue));
  background: var(--blue-soft);
}

.pgp-tabs .nav-link.active {
  color: var(--white) !important;
  background: var(--tab-border, var(--blue)) !important;
  border-color: var(--tab-border, var(--blue)) !important;
  border-bottom: 2px solid var(--white) !important;
  margin-bottom: -2px;
  z-index: 2;
}

/* ============================================================
   TAB CONTENT – bordo + sfondo con immagine trasparente
   ============================================================ */
.pgp-tab-content {
  flex: 1;                      /* occupa tutto lo spazio restante */
  border: 2px solid var(--tab-border, var(--blue));
  border-radius: 0 0.75rem 0.75rem 0.75rem;
  background-color: rgba(255,255,255,0.82);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

/* Sfondo immagine dentro il tab content */
.pgp-tab-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/Dbtumori/images/sfondo.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.04;                /* stessa trasparenza del body */
  z-index: -1;
  pointer-events: none;
}

.pgp-tab-inner {
  min-height: 400px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.pgp-tab-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  opacity: 0.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .pgp-tab-page { padding: 0.5rem; }
  .pgp-tabs .nav-link { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
}

/* ============================================================
   CARD
   ============================================================ */
.pgp-card {
  background: var(--white);
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  overflow: hidden;
}
.pgp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}
.pgp-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.pgp-card-body { padding: 1.25rem; }

.pgp-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--blue-soft);
  color: var(--blue);
}

/* ============================================================
   TABELLE
   ============================================================ */
.pgp-table thead th {
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.pgp-table tbody tr:hover { background: #f9fafb; }

/* ============================================================
   FORM
   ============================================================ */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.form-control,
.form-select {
  font-size: 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.18rem rgba(37,99,235,0.15);
  outline: none;
}
.form-control:disabled {
  background: #f3f4f6;
  color: var(--muted);
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ============================================================
   BOTTONI
   ============================================================ */
.btn-primary,
.pgp-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 500;
  border-radius: 0.6rem;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover,
.pgp-btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}
.btn-outline-secondary { border-radius: 0.6rem; font-weight: 500; }
.btn-outline-primary {
  border-radius: 0.6rem;
  font-weight: 500;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* ============================================================
   FOOTER – sfondo grigio
   ============================================================ */
.pgp-footer {
  background-color: hwb(213 93% 4%);
  border-top: 1px solid #e5e7eb;
}
.pgp-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
}
.pgp-footer-text {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE GENERALE
   ============================================================ */
@media (max-width: 768px) {
  .pgp-header-inner { padding: 0.5rem 1rem; min-height: 70px; }
  .pgp-card-body    { padding: 0.9rem; }
  .pgp-footer-inner { flex-direction: column; align-items: flex-start; }
  .pgp-uinfo        { display: none; }
  .pgp-tabs .nav-link { font-size: 0.85rem; padding: 0.45rem 0.75rem; }
}
/* ============================================================
   SFONDO SEMITRASPARENTE SU TUTTA LA PAGINA
   ============================================================ */

body.pgp-body {
  position: relative;
}

body.pgp-body::before {
  content: '';
  position: fixed;        /* copre tutta la finestra anche in scroll */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/Dbtumori/images/sfondo.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.04;          /* 0.0 = invisibile, 1.0 = piena opacità
                             prova valori tra 0.05 e 0.15 */
 /*  z-index: 0;  FB - Ethel  */
  pointer-events: none;   /* non interferisce con i click */
}

/* Tutto il contenuto deve stare sopra lo sfondo */
body.pgp-body > * {
  position: relative;
   /*  z-index: 0;  FB - Ethel  */
}
/* ============================================================
   LOGO OSPEDALE IN HEADER
   ============================================================ */
.pgp-osp-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.pgp-osp-logo img {
  /* FB 
  max-width: 300px;
  max-height: 250px;  
  width: auto;
  height: auto;
  */
  object-fit: contain;
}
.pgp-osp-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

@media (max-width: 768px) {
  .pgp-osp-logo   { display: none; }
  .pgp-osp-divider{ display: none; }
}
/* ============================================================
   LOGIN PAGE
   ============================================================ */
.pgp-login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.pgp-login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pgp-login-logo img {
  max-width: 220px;
  height: auto;
}

.pgp-login-card {
  width: 100%;
}

/* Campo password con occhio */
.pgp-pw-wrap {
  position: relative;
}
.pgp-pw-wrap .form-control {
  padding-right: 2.8rem;
}
.pgp-pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  outline: none;
}
.pgp-pw-toggle:hover { color: var(--blue); }

.pgp-login-footer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}