/* ============================================================
   HRGF — Tema Geofirias
   Override variabili Tabler + componenti custom
   Niente !important salvo dove strettamente necessario
   ============================================================ */

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

/* ── Override variabili Tabler ── */
:root {
  /* Colore primario → verde Geofirias */
  --tblr-primary:           #2d7040;
  --tblr-primary-rgb:       45, 112, 64;
  --tblr-primary-lt:        rgba(45, 112, 64, 0.1);
  --tblr-primary-lt-rgb:    45, 112, 64;
  --tblr-link-color:        #2d7040;
  --tblr-link-color-rgb:    45, 112, 64;

  /* Font */
  --tblr-font-sans-serif:   'Inter', system-ui, -apple-system, sans-serif;
  --tblr-body-font-size:    0.875rem;

  /* Sfondo pagina */
  --tblr-body-bg:           #f5f7f5;
  --tblr-bg-surface:        #ffffff;

  /* Border radius — tondeggiante */
  --tblr-border-radius:     0.5rem;
  --tblr-border-radius-sm:  0.375rem;
  --tblr-border-radius-lg:  0.75rem;
  --tblr-border-radius-xl:  1rem;
  --tblr-border-radius-pill: 100px;

  /* Bordi */
  --tblr-border-color:      #e2e8e3;

  /* Ombre card */
  --tblr-card-box-shadow:   0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);

  /* Bottoni — più alti e con più padding */
  --tblr-btn-padding-y:     0.5rem;
  --tblr-btn-padding-x:     1rem;
  --tblr-btn-font-size:     0.855rem;
  --tblr-btn-font-weight:   500;

  /* Variabili custom HRGF (per template esistenti) */
  --hrgf-ink:               #1a3a24;
  --hrgf-terra:             #2d7040;
  --hrgf-terra-dark:        #1f5530;
  --hrgf-terra-pale:        #e8f3eb;
  --hrgf-paper:             #f5f7f5;
  --hrgf-white:             #ffffff;
  --hrgf-border:            #e2e8e3;
  --hrgf-border-mid:        #d0d9d2;
  --hrgf-text:              #111827;
  --hrgf-muted:             #6b7280;
  --hrgf-success:           #2d7040;
  --hrgf-danger:            #c0392b;
  --hrgf-sidebar-w:         248px;
}

/* ── Sidebar scura verde ── */
.navbar-vertical {
  background-color: #1a3a24 !important;
  border-right: none !important;
}

.navbar-vertical .navbar-brand {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}

.navbar-vertical .nav-link {
  color: rgba(255,255,255,0.6) !important;
  border-radius: 6px;
  margin: 1px 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.navbar-vertical .nav-link:hover {
  color: rgba(255,255,255,0.92) !important;
  background: rgba(255,255,255,0.08) !important;
}

.navbar-vertical .nav-link.active {
  color: #fff !important;
  background: #2d7040 !important;
  font-weight: 500 !important;
}

.navbar-vertical .nav-link-icon {
  color: rgba(255,255,255,0.5) !important;
}

.navbar-vertical .nav-link.active .nav-link-icon {
  color: rgba(255,255,255,0.85) !important;
}

/* Separatore sezioni sidebar */
.nav-item .nav-link-subtitle {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28) !important;
  padding: 0.6rem 0.75rem 0.2rem;
}

/* ── Logo ── */
.hrgf-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
}

.hrgf-logo-sub {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ── Utente in fondo sidebar ── */
.sidebar-user {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0.875rem 1rem;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.sidebar-user-name:hover { color: #fff; }

.sidebar-user-role {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.1rem;
}

/* ── Page header pretitle ── */
.page-pretitle {
  color: var(--hrgf-terra) !important;
}

/* ── Card ── */
.card {
  border: 1px solid var(--hrgf-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.03);
}

/* ── Card header uppercase ── */
.card-header {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  color: var(--hrgf-muted) !important;
  border-bottom: 1px solid var(--hrgf-border) !important;
  background: transparent !important;
}

/* ── Input / select ── */
.form-control,
.form-select {
  border-color: var(--hrgf-border-mid);
  font-size: 0.875rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--tblr-border-radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hrgf-terra);
  box-shadow: 0 0 0 3px rgba(45,112,64,0.12);
}

.input-group-text {
  border-color: var(--hrgf-border-mid);
  background: #fff;
  color: var(--hrgf-muted);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

.input-group .form-control:focus {
  z-index: 3;
}

/* ── Form check (checkbox) ── */
.form-check-input:checked {
  background-color: var(--hrgf-terra);
  border-color: var(--hrgf-terra);
}

.form-check-label {
  font-size: 0.855rem;
  color: var(--hrgf-text);
  cursor: pointer;
}

/* ── Bottoni ── */
.btn {
  font-size: 0.855rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem;
  border-radius: var(--tblr-border-radius);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  gap: 0.3rem;
}

.btn-primary {
  background: var(--hrgf-terra);
  border-color: var(--hrgf-terra);
}

.btn-primary:hover {
  background: var(--hrgf-terra-dark);
  border-color: var(--hrgf-terra-dark);
  box-shadow: 0 4px 12px rgba(45,112,64,0.28);
}

.btn-outline-secondary {
  border-color: var(--hrgf-border-mid);
  color: var(--hrgf-text);
}

.btn-outline-secondary:hover {
  background: #f3f4f6;
  border-color: #c4cac6;
  color: var(--hrgf-text);
  box-shadow: none;
}

.btn-ghost-secondary {
  color: var(--hrgf-muted);
}

.btn-ghost-secondary:hover {
  background: rgba(0,0,0,0.04);
  color: var(--hrgf-text);
}

/* ── Page header ── */
.page-header {
  border-bottom: 1px solid var(--hrgf-border);
  background: #fff;
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Badge status con pallino ── */
.badge-attivo {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.65em;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(45,112,64,0.1);
  color: #2d7040;
  border: 1px solid rgba(45,112,64,0.2);
}

.badge-attivo::before {
  content: '';
  width: 5px; height: 5px;
  background: #2d7040;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-inattivo {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.65em;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(107,114,128,0.09);
  color: #6b7280;
  border: 1px solid rgba(107,114,128,0.18);
}

.badge-inattivo::before {
  content: '';
  width: 5px; height: 5px;
  background: #9ca3af;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-ruolo {
  display: inline-block;
  padding: 0.28em 0.65em;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(26,58,36,0.08);
  color: var(--hrgf-ink);
}

/* ── Link nelle tabelle ── */
.table-link {
  color: var(--hrgf-ink);
  font-weight: 500;
  text-decoration: none;
}

.table-link:hover {
  color: var(--hrgf-terra);
}

/* ── Definizioni (dl) nelle pagine dettaglio ── */
.hrgf-dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.8rem 1rem;
}

.hrgf-dl dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hrgf-muted);
  padding-top: 0.1rem;
}

.hrgf-dl dd {
  font-size: 0.875rem;
  color: var(--hrgf-text);
  margin: 0;
}

/* ── Search bar ── */
.hrgf-search {
  border: 1px solid var(--hrgf-border-mid);
  border-radius: var(--tblr-border-radius);
  padding: 0.45rem 0.875rem;
  font-size: 0.855rem;
  width: 280px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hrgf-search:focus {
  outline: none;
  border-color: var(--hrgf-terra);
  box-shadow: 0 0 0 3px rgba(45,112,64,0.1);
}

/* ── Cartellino codice socio ── */
.cartellino-code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hrgf-ink);
  background: rgba(26,58,36,0.07);
  padding: 0.18em 0.55em;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

/* ── Empty state ── */
.hrgf-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--hrgf-muted);
}

.hrgf-empty .ti {
  font-size: 2.5rem;
  opacity: 0.2;
  display: block;
  margin-bottom: 0.75rem;
}

/* ── Alert errori ── */
.hrgf-alert-error {
  background: rgba(192,57,43,0.07);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--tblr-border-radius);
  padding: 0.75rem 1rem;
  color: var(--hrgf-danger);
  font-size: 0.855rem;
  margin-bottom: 1.25rem;
}

/* ── Stat cards dashboard ── */
.stat-card {
  border: none;
  border-radius: 0.75rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-card .card-body {
  padding: 1.4rem 1.5rem 1.2rem;
}

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-card-number {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.35rem;
}

.stat-card-sub {
  font-size: 0.72rem;
  opacity: 0.7;
}

/* Verde — Hotel */
.stat-card-green {
  background: linear-gradient(135deg, #2d7040 0%, #1f5530 100%);
  color: #fff;
}
.stat-card-green .stat-card-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Blu — Soci */
.stat-card-blue {
  background: linear-gradient(135deg, #206bc4 0%, #1558a8 100%);
  color: #fff;
}
.stat-card-blue .stat-card-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Ambra — Fogli */
.stat-card-amber {
  background: linear-gradient(135deg, #f59f00 0%, #d08700 100%);
  color: #fff;
}
.stat-card-amber .stat-card-icon {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

/* Teal — Addetti */
.stat-card-teal {
  background: linear-gradient(135deg, #0ca678 0%, #087f5b 100%);
  color: #fff;
}
.stat-card-teal .stat-card-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* ── Stato sistema ── */
.stato-riga {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hrgf-border);
}
.stato-riga:last-child { border-bottom: none; }

.stato-riga-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stato-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.stato-icon-green {
  background: rgba(45,112,64,0.1);
  color: #2d7040;
}

.stato-icon-grey {
  background: rgba(107,114,128,0.1);
  color: #9ca3af;
}

.stato-nome {
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--hrgf-text);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hrgf-border-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #b0bdb3; }
