:root { --gm-accent: #0d6efd; }
body { background: #f4f6f9; }
.topbar { z-index: 1045; }
.sidebar { background: #fff; min-height: calc(100vh - 56px); border-right: 1px solid #e5e7eb; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; } }
.sidebar .menu-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #8a94a6; padding: .6rem .75rem .2rem; font-weight: 600; }
.sidebar button.menu-toggle {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  display: flex !important; flex: 0 0 100% !important; align-items: center; justify-content: space-between;
  width: 100% !important; max-width: 100%; box-sizing: border-box;
  background: none !important; background-image: none !important; box-shadow: none !important;
  border: 0 !important; border-radius: 0; outline: none; text-align: left; white-space: normal;
  margin: 0; cursor: pointer;
}
.sidebar button.menu-toggle:hover, .sidebar button.menu-toggle:focus, .sidebar button.menu-toggle:active {
  background: none !important; box-shadow: none !important; border: 0 !important;
}
.sidebar .menu-chevron { font-size: .7rem; transition: transform .15s; }
.sidebar button.menu-toggle.collapsed .menu-chevron { transform: rotate(-90deg); }
.sidebar .offcanvas-body { display: block; }
.sidebar .collapse, .sidebar .collapsing { width: 100%; flex: 0 0 100%; }
.sidebar .nav-link { color: #334155; border-radius: .4rem; padding: .4rem .75rem; font-size: .92rem; }
.sidebar .nav-link i { width: 1.4rem; display: inline-block; }
.sidebar .nav-link:hover { background: #f1f5f9; }
.sidebar .nav-link.active { background: var(--gm-accent); color: #fff; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon { font-size: 2rem; opacity: .25; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table-sm td, .table-sm th { font-size: .9rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #dee2e6; display: inline-flex; align-items: center; justify-content: center; color: #6c757d; font-weight: 600; }
.avatar-lg { width: 120px; height: 120px; font-size: 2.5rem; }
.machine-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .5rem .5rem 0 0; background: #e9ecef; }
.machine-thumb.placeholder-img { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #adb5bd; }
.gallery img { width: 100%; border-radius: .5rem; cursor: zoom-in; object-fit: cover; aspect-ratio: 4/3; }
.tessera { max-width: 380px; margin: auto; border-radius: 1rem; background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; }
.tessera #qrbox { background: #fff; padding: 14px; border-radius: .75rem; display: inline-block; }
.tessera .countdown { font-size: .8rem; opacity: .8; }
.fc .evento-mio { border: 3px solid #ffc107 !important; }
.fc { background: #fff; padding: .5rem; border-radius: .5rem; }
.fc .fc-toolbar-title { font-size: 1.15rem; }
@media (max-width: 576px) { .fc .fc-toolbar { flex-direction: column; gap: .4rem; } }
.competenza { display: inline-block; background: #e7f1ff; color: #0a58ca; border-radius: 1rem; padding: .15rem .6rem; font-size: .8rem; margin: 0 .2rem .3rem 0; }
.scheda-giorno { border-left: 4px solid var(--gm-accent); }
.semaforo { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.semaforo.ok { background: #198754; } .semaforo.ko { background: #dc3545; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a, #1e3a8a); }
.login-card { width: 100%; max-width: 400px; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } main { width: 100% !important; } body { background: #fff; } }
.login-card-wide { max-width: 760px; }
.demo-role { background: #fff; }
.demo-role:hover .text-muted { color: rgba(255,255,255,.85) !important; }
.demo-bar { background: #facc15; color: #1f2937; font-size: .85rem; position: sticky; top: 0; z-index: 1050; }
.demo-bar .form-select { width: auto; min-width: 180px; }
body.demo .topbar { top: 38px; }
@media (min-width: 992px) { body.demo .sidebar { top: 94px; height: calc(100vh - 94px); } }
.cintura { display: inline-block; position: relative; width: 70px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.35); vertical-align: middle; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.cintura i { position: absolute; top: 0; bottom: 0; width: 3px; background: #f5c518; }
.cintura.lg { width: 140px; height: 26px; border-radius: 5px; }
.cintura.lg i { width: 5px; }
.percorso-step { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed #e5e7eb; }
.percorso-step.fatto { opacity: 1; } .percorso-step.futuro { opacity: .45; }
.presenza-radio .btn { min-width: 42px; }
@media print { .diploma { border: 12px double #7c3f12 !important; } }
.diploma { max-width: 900px; margin: auto; border: 12px double #7c3f12; padding: 3rem; background: #fffdf5; text-align: center; font-family: Georgia, serif; }
/* Campi sportivi */
.cp-grid { min-width: 640px; }
.cp-grid th, .cp-grid td { vertical-align: top; font-size: .82rem; }
.cp-grid th:first-child, .cp-grid td:first-child { width: 58px; white-space: nowrap; color: #6b7280; }
.cp-libero { background: #f0fdf4; } .cp-libero a { color: #15803d; opacity: .55; } .cp-libero:hover { background: #dcfce7; } .cp-libero:hover a { opacity: 1; }
.cp-occ { background: #e5e7eb; } .cp-mia { background: #dbeafe; border-left: 3px solid #2563eb !important; }
.cp-aperta { background: #fef3c7; border-left: 3px solid #d97706 !important; } .cp-manut { background: repeating-linear-gradient(45deg, #fee2e2, #fee2e2 6px, #fecaca 6px, #fecaca 12px); }
.cp-chiuso { background: #f3f4f6; }
.cp-leg { display: inline-block; width: 14px; height: 14px; border: 1px solid #d1d5db; border-radius: 3px; vertical-align: middle; }
/* Tornei */
.tn-box { border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font-size: .85rem; overflow: hidden; }
.tn-box a:hover { background: #f8fafc; display: block; }
.tn-bracket .tn-col { position: relative; }
/* Logo */
.brand-mark { height: 30px; width: 30px; border-radius: 8px; }
.brand-logo { max-height: 34px; max-width: 200px; object-fit: contain; }
.login-logo { max-height: 72px; max-width: 280px; object-fit: contain; }
.login-wrap { background: radial-gradient(circle at 15% 15%, rgba(163,230,53,.22), transparent 42%), radial-gradient(circle at 85% 85%, rgba(34,211,238,.22), transparent 45%), #0b0f1a; }
.logo-anteprima { display: flex; align-items: center; justify-content: center; height: 110px; border-radius: 10px; padding: 1rem; border: 1px solid #e5e7eb; }
.logo-anteprima.chiaro { background: #fff; } .logo-anteprima.scuro { background: #111827; }
.logo-anteprima img { max-height: 70px; max-width: 100%; object-fit: contain; }
.tn-pub-logo { position: absolute; right: 12px; top: 0; max-height: 44px; max-width: 180px; object-fit: contain; }
@media (max-width: 576px) { .tn-pub-logo { position: static; display: block; margin-bottom: .5rem; } }
