/* ══════════════════════════════════════════════════════════
   PANtheon — Dashboard CSS
   313° Gruppo PAN — Frecce Tricolori
   ══════════════════════════════════════════════════════════ */

:root {
  --green:    #1a7a3a;
  --white:    #ffffff;
  --red:      #c8102e;
  --bg:       #0d1117;
  --surface:  #161b22;
  --surface2: #1c2128;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #8b949e;
  --accent:   #2ea043;
  --hover:    #21262d;
  --blue:     #388bfd;
  --indigo:   #6e76e5;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;             /* esattamente viewport, no scroll */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── NAV ───────────────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.nav-brand  { display: flex; align-items: center; gap: 12px; }
.nav-logo-img { height: 34px; width: auto; flex-shrink: 0; }
.tricolor-bar {
  width: 4px; height: 28px;
  background: linear-gradient(to bottom, var(--green) 33%, var(--white) 33%, var(--white) 66%, var(--red) 66%);
  border-radius: 2px;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub  { font-size: 11px; color: var(--muted); }
.pan-highlight { color: var(--blue); font-weight: 900; }
.nav-right  { display: flex; align-items: center; gap: 10px; }
.fs-btn {
  background: var(--hover); border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px;
  width: 32px; height: 32px; font-size: 17px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.fs-btn:hover { background: var(--surface2); color: var(--text); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px 4px 4px;
  font-size: 13px; cursor: pointer;
  transition: background 0.12s;
}
.user-chip:hover { background: var(--surface2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}

/* ── MAIN LAYOUT ───────────────────────────────────────── */
.main {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

/* ── SIDEBAR ───────────────────────────────────────────── */
aside {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
aside::-webkit-scrollbar { display: none; }
.sidebar-section { padding: 0 12px 20px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted);
  padding: 0 8px; margin-bottom: 6px;
}
.sidebar-link {
  display: flex; align-items: center;
  width: 100%; padding: 7px 10px;
  background: none; border: none; border-radius: 8px;
  color: var(--muted); cursor: pointer; text-align: left;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover { background: var(--hover); color: var(--text); }
.sidebar-link.active { background: var(--hover); color: var(--text); }
.sidebar-link-inner {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.sidebar-icon { font-size: 15px; flex-shrink: 0; }
.sidebar-link-text {
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-link-name {
  font-size: 13px; font-weight: 500; color: inherit; line-height: 1.2;
}
.sidebar-link.active .sidebar-link-name { font-weight: 700; }
.sidebar-access {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; line-height: 1;
}
.sidebar-access.op  { color: var(--accent); }
.sidebar-access.rs  { color: #f87171; }
.sidebar-access.adm { color: #f59e0b; }

/* ── CONTENT ───────────────────────────────────────────── */
.content {
  padding: 14px 20px;
  overflow: hidden;          /* NO scroll di pagina */
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* ── DASHBOARD 3-CARD GRID ─────────────────────────────── */
.dash-grid {
  flex: 1;                   /* prende tutto lo spazio rimasto */
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  min-height: 0;             /* fondamentale per flex */
}
.dash-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56,139,253,.12);
}

.card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.card-icon  { font-size: 16px; }
.card-title {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text);
}
.card-subtitle {
  font-size: 10px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  margin-left: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}

.card-body {
  padding: 10px 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;          /* scroll INTERNO alla card, non di pagina */
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* scrollbar invisibile */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.card-body::-webkit-scrollbar { display: none; }

.card-footer {
  font-size: 10px; color: var(--muted);
  text-align: right;
  padding: 6px 14px 10px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── DAY NAV (nella card OGGI) ─────────────────────────── */
.day-nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.dnav-btn {
  background: var(--hover); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px;
  width: 24px; height: 24px; font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.dnav-btn:hover { background: var(--border); }
.dnav-date {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; white-space: nowrap; margin: 0 4px;
}
.dnav-today {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 5px;
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); cursor: pointer;
}
.dnav-today:hover { background: rgba(46,160,67,.12); }

/* ── EVENT ROWS (dentro card-body) ─────────────────────── */
.ev-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 3px solid var(--border);
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
  background: var(--hover);
}
.ev-badge {
  flex-shrink: 0;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid transparent;
  min-width: 48px; text-align: center;
  white-space: nowrap;
}
.ev-badge-sm { font-size: 9px; min-width: 68px; }
.ev-content { flex: 1; min-width: 0; }
.ev-title   { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-meta    { font-size: 10px; color: var(--muted); margin-top: 2px; }

.ev-divider {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--dc, #888);
  border-top: 1px solid var(--dc, #888);
  padding-top: 6px; margin-top: 2px; opacity: 0.85;
}
.ev-empty { font-size: 12px; color: var(--muted); padding: 12px 0; }
.ev-more  { font-size: 10px; color: var(--muted); text-align: right; margin-top: 4px; }

/* ── PVG MINI CARD ─────────────────────────────────────── */
.pvg-mini-card {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
}
.pvg-mini-hdr  { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pvg-mini-name { font-size: 13px; font-weight: 700; }
.pvg-mini-tot  {
  font-size: 10px; font-weight: 700;
  background: var(--blue); color: white;
  padding: 1px 7px; border-radius: 4px;
  margin-left: auto;
}
.pvg-mini-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.pvg-mini-pilot{ font-size: 11px; color: var(--text); font-weight: 500; }

/* ── MISSIONE CARD (nella scheda) ───────────────────────── */
.miss-po-meta { font-size: 12px; color: var(--muted); }
.miss-po-meta b { color: var(--accent); }

/* Itinerario giorno per giorno */
.miss-itin { display: flex; flex-direction: column; gap: 2px; }
.miss-itin-full { gap: 1px; }
.miss-itin-row {
  display: flex; align-items: center; gap: 0;
  background: var(--hover); border-radius: 4px; overflow: hidden;
  font-size: 12px;
}
.miss-itin-weekend .miss-itin-day { color: #f87171; }
.miss-itin-dim { opacity: .55; }
.miss-itin-day {
  font-size: 11px; font-weight: 700; font-family: monospace;
  color: var(--muted); white-space: nowrap;
  padding: 5px 10px; min-width: 68px;
  background: rgba(255,255,255,.03);
  border-right: 1px solid var(--border);
}
.miss-itin-title {
  padding: 5px 10px; font-weight: 600; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.miss-itin-empty { color: var(--muted); font-weight: 400; }
.miss-itin-more {
  font-size: 11px; color: var(--muted); text-align: right;
  padding: 4px 4px 0;
}

.miss-po-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 10px;
}
.miss-po-badge {
  font-size: 11px; font-weight: 800; color: white;
  padding: 4px 10px; border-radius: 6px;
  flex-shrink: 0; text-align: center;
}
.miss-po-title { font-size: 14px; font-weight: 600; }
.miss-detail-grid { display: flex; flex-direction: column; gap: 4px; }
.miss-detail-row  { display: flex; gap: 8px; font-size: 11px; }
.miss-detail-label{ color: var(--muted); min-width: 56px; flex-shrink: 0; }
.miss-detail-val  { color: var(--text); }
.miss-quando { color: var(--accent); font-weight: 600; }

/* ── SKELETON LOADER ───────────────────────────────────── */
.skel {
  background: var(--hover);
  border-radius: 6px;
  height: 56px;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%,100%{opacity:.4} 50%{opacity:.8} }

/* ── SECTION TITLE ─────────────────────────────────────── */
.section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ── APP GRID ──────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: border-color 0.15s, transform 0.12s;
}
.app-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.app-card:hover { border-color: #444d56; transform: translateY(-2px); }
.app-icon { font-size: 22px; margin-bottom: 2px; }
.app-name { font-size: 14px; font-weight: 700; }
.app-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.app-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(46,160,67,.18); color: var(--accent);
  border: 1px solid rgba(46,160,67,.3);
  align-self: flex-start; margin-top: 4px;
}
.badge-restricted { background: rgba(200,16,46,.12); color: #f87171; border-color: rgba(200,16,46,.3); }

.color-indigo::before { background: #6e76e5; }
.color-green::before  { background: #2ea043; }
.color-blue::before   { background: #388bfd; }
.color-teal::before   { background: #1cb0a8; }
.color-red::before    { background: #c8102e; }
.color-yellow::before { background: #d29922; }
.color-purple::before { background: #8957e5; }

/* ── LOGIN WALL ───────────────────────────────────────── */
#login-wall {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 360px; width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo-img { display: block; height: 150px; width: auto; margin: 0 auto 20px; }
.login-box .pan-highlight { color: #20396d; }
.login-tricolor {
  width: 5px; height: 40px;
  background: linear-gradient(to bottom, var(--green) 33%, var(--white) 33%, var(--white) 66%, var(--red) 66%);
  border-radius: 3px; margin: 0 auto 16px;
}
.login-logo {
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  color: var(--muted); margin-bottom: 6px;
}
.login-box h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.login-box p  { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 20px;
  background: white; color: #1f1f1f;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.google-btn:hover { background: #f0f0f0; }
.google-logo { width: 18px; height: 18px; }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 20px;
  height: 28px;
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.footer-sig {
  flex-shrink: 0;
  font-size: 10px; color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
  padding-left: 16px;
}

/* ── TICKER ANSA ──────────────────────────────────────── */
.ticker-wrap {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0; overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  font-size: 9px; font-weight: 900; letter-spacing: 1.5px;
  background: #e00; color: #fff;
  padding: 2px 6px; border-radius: 3px;
}
.ticker-track-outer {
  flex: 1; min-width: 0; overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}
.ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  color: var(--muted);
  font-size: 11px;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── MODALI ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(13,17,23,.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 28px 16px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 640px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: slideUp .2s ease;
}
.modal-wide { max-width: 900px; }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }

.modal-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-hdr-right { display: flex; align-items: center; gap: 10px; }
.modal-ext-link {
  font-size: 11px; font-weight: 600; color: var(--indigo);
  text-decoration: none; padding: 5px 10px;
  border: 1px solid rgba(110,118,229,.4); border-radius: 6px;
  transition: background 0.12s; white-space: nowrap;
}
.modal-ext-link:hover { background: rgba(110,118,229,.1); }
.modal-close {
  background: var(--hover); border: 1px solid var(--border);
  color: var(--text); border-radius: 7px;
  width: 32px; height: 32px; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--border); }

.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }

/* Barra navigazione dentro i modal */
.modal-nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--hover); border-radius: 8px;
  padding: 6px 10px; margin-bottom: 4px;
}
.modal-nav-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
  padding: 4px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.modal-nav-btn:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); color: white; }
.modal-nav-btn:disabled { opacity: .3; cursor: default; }
.modal-nav-pos { font-size: 11px; color: var(--muted); font-weight: 600; }

.modal-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); margin-top: 6px;
}
.modal-cal-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--dc, #888);
  margin: 10px 0 4px;
}
.modal-cal-divider::before, .modal-cal-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--dc, #888); opacity: .4;
}

.modal-ev-card {
  background: var(--hover); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.modal-ev-hdr  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-ev-badge{
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; white-space: nowrap;
}
.modal-ev-title{ font-size: 14px; font-weight: 700; }
.modal-ev-row  { font-size: 12px; color: var(--muted); display: flex; gap: 6px; }
.modal-ev-row span { color: var(--text); }
.badge-annullato {
  font-size: 10px; font-weight: 700;
  background: rgba(200,16,46,.15); color: #f87171;
  border: 1px solid rgba(200,16,46,.3);
  padding: 2px 8px; border-radius: 4px;
}

/* ── MISSIONE MODAL ─────────────────────────────────── */
.miss-modal-po {
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.miss-modal-badge {
  font-size: 13px; font-weight: 800; color: white;
  padding: 6px 14px; border-radius: 8px; flex-shrink: 0;
}
.miss-modal-title { font-size: 15px; font-weight: 700; }
.miss-modal-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.miss-modal-sub b { color: var(--accent); }
.miss-row { display: flex; gap: 12px; font-size: 13px; }
.miss-lbl { color: var(--muted); min-width: 80px; flex-shrink: 0; }

/* ── PVG MODAL ──────────────────────────────────────── */
.pvg-modal-header {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
  margin-bottom: 4px;
}
.pvg-mission-block { display: flex; flex-direction: column; gap: 14px; }
.pvg-mission-sep   { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 6px; }

.pvg-m-hdr  { display: flex; align-items: center; gap: 10px; }
.pvg-m-name { font-size: 16px; font-weight: 800; }
.pvg-m-badge{
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 5px;
}
.pvg-m-badge.blue { background: var(--blue); color: white; }
.pvg-m-badge.gray { background: var(--hover); color: var(--muted); border: 1px solid var(--border); }

/* ── PVG MISSION BODY — griglia + info + piloti ── */
.pvg-m-body {
  display: flex; gap: 20px; align-items: flex-start;
}

/* Griglia 5×6 (30 slot) */
.pvg-slot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 260px; flex-shrink: 0;
}
.pvg-slot {
  height: 36px; border-radius: 5px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 3px;
}
.pvg-slot-occ {
  background: #2563eb; color: white;
  border: none;
}
.pvg-slot-empty {
  background: transparent;
  border: none;
  pointer-events: none;
}
.pvg-slot-a, .pvg-slot-b { display: block; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.pvg-slot-b { opacity: .8; }

/* Colonna destra: dati + extras */
.pvg-m-right {
  flex: 1; display: flex; flex-direction: column; gap: 14px;
}

/* Dati volo 2 colonne */
.pvg-m-details { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.pvg-dr { display: flex; flex-direction: column; font-size: 12px; }
.pvg-dl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pvg-dr b { color: var(--text); font-weight: 600; }
.pvg-dr-full { grid-column: 1 / -1; }
.pvg-rotta { font-family: monospace; font-size: 11px; word-break: break-all; }

/* BIGA/FOTOGRAFO + piloti, affiancati */
.pvg-m-extras {
  display: flex; gap: 20px; border-top: 1px solid var(--border); padding-top: 10px;
}
.pvg-m-side {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.pvg-sp-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.pvg-sp-val { font-size: 13px; font-weight: 600; color: var(--text); }

/* Lista piloti */
.pvg-m-pilots { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pvg-pilot-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--hover); border-radius: 5px;
  padding: 4px 8px; font-size: 12px;
}
.pvg-pilot-names { font-weight: 600; }
.pvg-pilot-mat   { font-family: monospace; font-size: 11px; color: var(--muted); }

/* ── CARD SECONDARIE (più piccole) ───────────────────── */
.dash-grid-sm {
  flex: 0 0 clamp(130px, 24vh, 190px);  /* altezza fissa compatta, adattiva al viewport */
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dash-card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: default;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dash-card-sm .card-hdr   { padding: 6px 14px; flex-shrink: 0; flex-wrap: nowrap; }
.dash-card-sm .card-title { font-size: 11px; flex-shrink: 0; }
.dash-card-sm .card-icon  { font-size: 14px; flex-shrink: 0; }
.dash-card-sm .card-body  { padding: 6px 14px 8px; gap: 3px; overflow: hidden; }

/* Meteo — riepilogo compatto nella testata card */
.meteo-hdr-summary {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--muted);
  overflow: hidden; white-space: nowrap;
}
.meteo-hdr-summary .mhs-temp { font-weight: 800; color: var(--text); font-size: 11px; }
.meteo-hdr-summary .mhs-desc { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.meteo-hdr-summary .mhs-detail { flex-shrink: 0; }

/* METAR block */
.metar-block { background: var(--hover); border-radius: 6px; padding: 5px 8px; display: flex; flex-direction: column; gap: 2px; }
.metar-hdr   { display: flex; align-items: center; justify-content: space-between; }
.metar-label { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.metar-cat   { font-size: 9px; font-weight: 800; color: white; padding: 1px 6px; border-radius: 4px; }
.metar-row   { font-size: 10px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* TAF block */
.taf-block   { display: flex; flex-direction: column; gap: 1px; }
.taf-row     { display: flex; align-items: baseline; gap: 5px; font-size: 10px; padding: 1px 0; }
.taf-row-lbl { font-size: 9px; font-weight: 700; font-family: monospace; color: var(--muted); min-width: 60px; flex-shrink: 0; }
.taf-row-cat { font-weight: 700; font-size: 9px; min-width: 30px; flex-shrink: 0; }
.taf-row-data{ font-size: 9px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── ADMIN PANEL ────────────────────────────────────────── */
.admin-groups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.admin-group-box {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-group-box-full {
  grid-column: 1 / -1;
}
.admin-group-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-group-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #fff;
  padding: 3px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.admin-group-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.admin-group-ta {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 8px 10px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
}
.admin-group-ta:focus {
  outline: none;
  border-color: var(--blue);
}
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.admin-actions span {
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 768px) {
  .admin-groups-grid { grid-template-columns: 1fr; }
  .admin-group-box-full { grid-column: 1; }
}

/* Card secondarie cliccabili */
.dash-card-sm-click {
  cursor: pointer;
  transition: border-color .2s, transform .12s;
}
.dash-card-sm-click:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

/* News items (preview nella card) */
.news-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.news-item:last-child { border-bottom: none; }
.news-date  { font-size: 10px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.news-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* News modal */
.news-modal-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.news-modal-item:last-child { border-bottom: none; }
.news-modal-hdr {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.news-modal-title  { font-size: 15px; font-weight: 700; flex: 1; }
.news-modal-date   { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.news-modal-author { font-size: 11px; color: var(--muted); }
.news-modal-body   { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }

/* ── FORM SCRIVI NOTIZIA ─────────────────────────────── */
.wnews-field  { display: flex; flex-direction: column; gap: 5px; }
.wnews-label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.wnews-input, .wnews-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  resize: vertical;
}
.wnews-input:focus, .wnews-textarea:focus { border-color: var(--blue); }
.wnews-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 4px;
}
.wnews-btn-cancel {
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px;
  padding: 8px 18px; font-size: 13px; cursor: pointer;
}
.wnews-btn-cancel:hover { background: var(--hover); color: var(--text); }
.wnews-btn-submit {
  background: var(--blue); border: none; color: white;
  border-radius: 8px; padding: 8px 22px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.wnews-btn-submit:hover   { opacity: .85; }
.wnews-btn-submit:disabled{ opacity: .4; cursor: default; }
.write-news-err { font-size: 12px; color: #f87171; flex: 1; }
.write-news-ok  { font-size: 12px; color: var(--accent); flex: 1; }

/* ── HAMBURGER (visibile solo mobile) ────────────────── */
.hamburger-btn {
  display: none;
  background: var(--hover); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  width: 36px; height: 36px; font-size: 20px; line-height: 1;
  cursor: pointer; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Overlay scuro dietro sidebar aperta */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 150;
}
body.sidebar-open .sidebar-overlay { display: block; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Abilita scroll verticale */
  body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Nav: mostra hamburger */
  nav { padding: 0 12px; }
  .hamburger-btn { display: flex; }
  .nav-logo-img { height: 26px; }

  /* Layout: colonna singola, altezza automatica */
  .main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
  }

  /* Sidebar: nascosta di default, slide-in come overlay */
  aside {
    display: none;
    position: fixed;
    top: 48px; left: 0; bottom: 0;
    width: 260px;
    z-index: 200;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
  }
  body.sidebar-open aside { display: block; }

  /* Content: scrollabile, padding ridotto */
  .content {
    overflow: visible;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
  }

  /* Griglia principale: 1 colonna */
  .dash-grid {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Griglia secondaria: 1 colonna */
  .dash-grid-sm {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Card: altezza automatica, si espande con il contenuto */
  .dash-card {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  .dash-card-sm {
    overflow: visible;
    height: auto;
    max-height: none;
  }

  .card-body {
    overflow-y: visible;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  /* Footer ticker: testo più piccolo */
  footer { padding: 0 10px; }
  .ticker-label { display: none; }
  .footer-sig { font-size: 9px; }

  /* Modal: full screen su mobile */
  .modal-box {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 10px auto;
    max-height: 90vh;
  }

  /* PVG grid */
  .pvg-m-body    { flex-direction: column; }
  .pvg-slot-grid { width: 100%; }
  .pvg-m-extras  { flex-direction: column; }
  .pvg-m-details { grid-template-columns: 1fr; }
  .pvg-slot { height: 28px; font-size: 8px; }
}
