.gscf {
  --green: #16a34a; --green-light: #bbf7d0; --green-bg: #f0fdf4;
  --yellow: #d97706; --yellow-light: #fef3c7;
  --red: #dc2626; --red-light: #fee2e2;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-400: #9ca3af;
  --gray-500: #6b7280; --gray-700: #374151; --gray-900: #111827;
  max-width: 900px; margin: 0 auto; padding: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; color: var(--gray-700); line-height: 1.4;
}
.gscf * { box-sizing: border-box; }
.gscf a { color: #15803d; }
.gscf h2 { margin: 0 0 6px; font-size: 20px; color: var(--gray-900); }
.gscf h3 { margin: 18px 0 8px; font-size: 14px; color: var(--gray-900); }
.gscf-muted { color: var(--gray-500); font-size: 13px; }
.gscf-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; background: var(--gray-900); color: #fff; border-radius: 12px; }
.gscf-top strong { display: block; font-size: 16px; }
.gscf-top .gscf-muted { color: var(--gray-400); }
.gscf-user { display: flex; align-items: center; gap: 10px; }

.gscf-btn { display: inline-block; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--green); color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.gscf-btn:hover { background: #15803d; }
.gscf-btn[disabled] { opacity: .5; cursor: default; }
.gscf-btn-light { background: rgba(255,255,255,.15); }
.gscf-btn-light:hover { background: rgba(255,255,255,.28); }
.gscf-login .gscf-btn-light, .gscf-box .gscf-btn-light { background: var(--gray-900); }

.gscf-box, .gscf-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.gscf-login .gscf-box { max-width: 380px; margin: 30px auto; }
.gscf-login input[type=text], .gscf-login input[type=password] { width: 100%; padding: 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 15px; }
.gscf-login input[type=submit] { width: 100%; padding: 11px; border: 0; border-radius: 8px; background: var(--green); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.gscf-login p { margin: 0 0 12px; }

.gscf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gscf-stat { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; text-align: center; }
.gscf-stat b { display: block; font-size: 22px; color: var(--gray-900); }
.gscf-stat span { font-size: 11px; color: var(--gray-500); }
.gscf-stat.gscf-red b { color: var(--red); } .gscf-stat.gscf-yellow b { color: var(--yellow); }
.gscf-stat.gscf-green b { color: var(--green); } .gscf-stat.gscf-gray b { color: var(--gray-500); }

.gscf-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.gscf-tab { flex: 1; padding: 10px; border: 1px solid var(--gray-200); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 600; color: var(--gray-500); cursor: pointer; }
.gscf-tab.active { background: var(--gray-900); color: #fff; border-color: var(--gray-900); }
.gscf-pane { display: none; } .gscf-pane.active { display: block; }

.gscf-tools input[type=search] { width: 100%; padding: 11px 12px; border: 1px solid var(--gray-200); border-radius: 10px; font-size: 15px; margin-bottom: 8px; }
.gscf-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.gscf-chip { padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: 20px; background: #fff; font-size: 12px; font-weight: 500; color: var(--gray-700); cursor: pointer; }
.gscf-chip.active { background: var(--gray-900); color: #fff; border-color: var(--gray-900); }

.gscf-list { display: flex; flex-direction: column; gap: 8px; }
.gscf-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; }
.gscf-main { flex: 1; min-width: 0; }
.gscf-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gscf-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gray-200); color: var(--gray-700); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.gscf-name { font-weight: 600; color: var(--gray-900); }
.gscf-sub { font-size: 12px; color: var(--gray-500); }
.gscf-empty { padding: 24px; text-align: center; color: var(--gray-400); }

.gscf .badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.gscf .badge.green { background: var(--green-light); color: #15803d; }
.gscf .badge.yellow { background: var(--yellow-light); color: #b45309; }
.gscf .badge.red { background: var(--red-light); color: var(--red); }
.gscf .badge.gray { background: var(--gray-100); color: var(--gray-700); }

.gscf-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.gscf-note { padding: 10px 12px; border-radius: 8px; background: var(--gray-100); font-size: 13px; margin: 8px 0 0; }
.gscf-note-valido { background: var(--green-bg); } .gscf-note-scadenza { background: var(--yellow-light); }
.gscf-note-scaduto { background: var(--red-light); }
.gscf-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gscf-sum div { background: var(--gray-50); border-radius: 8px; padding: 10px; text-align: center; }
.gscf-sum span { display: block; font-size: 11px; color: var(--gray-500); }
.gscf-sum b { font-size: 16px; color: var(--gray-900); }
.gscf-sum .gscf-due b { color: var(--red); } .gscf-sum .gscf-ok b { color: var(--green); }
.gscf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gscf-table th { text-align: left; padding: 6px 8px; font-size: 11px; text-transform: uppercase; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
.gscf-table td { padding: 9px 8px; border-bottom: 1px solid var(--gray-100); }
.gscf-bank { margin-top: 14px; padding: 12px; background: var(--gray-50); border-radius: 8px; font-size: 13px; }
.gscf-bank div { margin-top: 4px; word-break: break-word; }
.gscf-bank span { display: inline-block; min-width: 82px; color: var(--gray-500); }

#gscf-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--gray-900, #111827); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 99999; }

@media (max-width: 520px) {
  .gscf-item-pay { flex-direction: column; align-items: stretch; }
  .gscf-item-pay .gscf-side { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ───── Azioni, export, scheda/modal (1.2.0) ───── */
.gscf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; align-items: center; }
.gscf-btn-dark { background: var(--gray-900, #111827); color: #fff; }
.gscf-btn-small { padding: 4px 9px; font-size: 12px; }
.gscf-open { cursor: pointer; }
.gscf-open:hover .gscf-name { text-decoration: underline; }
.gscf-export { position: relative; }
.gscf-export summary { list-style: none; cursor: pointer; display: inline-block; }
.gscf-export summary::-webkit-details-marker { display: none; }
.gscf-export-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 160px; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.gscf-export-menu a { display: block; padding: 10px 14px; font-size: 14px; color: var(--gray-900, #111827); text-decoration: none; }
.gscf-export-menu a:hover { background: var(--gray-100); }

body.gscf-lock { overflow: hidden; }
.gscf-modal[hidden] { display: none; }
.gscf-modal { position: fixed; inset: 0; z-index: 99990; display: flex; align-items: flex-end; justify-content: center; }
.gscf-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.55); }
.gscf-sheet { position: relative; background: #fff; width: 100%; max-width: 640px; max-height: 94vh; display: flex; flex-direction: column; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25); }
@media (min-width: 700px) { .gscf-modal { align-items: center; } .gscf-sheet { border-radius: 16px; max-height: 90vh; } }
.gscf-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.gscf-x { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--gray-500); }
.gscf-sheet-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.gscf-sheet-foot { padding: 12px 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 8px; justify-content: flex-end; }
.gscf-sheet-foot:empty { display: none; }

.gscf-sec { margin-bottom: 16px; }
.gscf-sec h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); }
.gscf-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.gscf-kv span { color: var(--gray-500); flex-shrink: 0; }
.gscf-kv b { font-weight: 600; text-align: right; word-break: break-word; }

#gscf-form fieldset { border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 12px 12px; margin: 0 0 14px; min-width: 0; }
#gscf-form legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.gscf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gscf-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gray-700); min-width: 0; }
.gscf-grid .gscf-span { grid-column: 1 / -1; }
.gscf-grid input, .gscf-grid select, .gscf-grid textarea { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 16px; font-family: inherit; background: #fff; }
.gscf-grid input[readonly] { background: var(--gray-100); color: var(--gray-500); }
.gscf-grid .gscf-check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
.gscf-grid .gscf-check input { width: auto; }
.gscf-muted { color: var(--gray-500); font-size: 12px; }
.gscf-sheet .gscf-btn-light { background: var(--gray-200); color: var(--gray-900) !important; }
.gscf-sheet .gscf-btn-light:hover { background: var(--gray-400); }
.gscf-btn-dark:hover { background: #000; }

/* ───── Calendario (1.3.0) ───── */
.gscf-cal { margin: 0 0 18px; }
.gscf-cal h3 { margin: 0 0 8px; font-size: 15px; color: var(--gray-900, #111827); }
.gscf-ev { display: flex; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--gray-200); border-left: 4px solid var(--green); border-radius: 10px; margin-bottom: 6px; }
.gscf-ev-date { min-width: 76px; font-weight: 700; font-size: 13px; color: var(--gray-900, #111827); text-transform: capitalize; }
.gscf-ev-body { flex: 1; min-width: 0; }
.gscf-ev-chiusura { border-left-color: var(--red); background: var(--red-light); }
.gscf-ev-torneo { border-left-color: #2563eb; }
.gscf-ev-extra, .gscf-ev-evento { border-left-color: #d97706; }
.gscf-ev.is-mine { box-shadow: 0 0 0 1px var(--green) inset; }
.gscf-turni { background: var(--yellow-light); border: 1px solid #fcd34d; border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.gscf-turni h3 { margin-bottom: 8px; }
.gscf-turno-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.08); font-size: 14px; }
.gscf-turno-row:first-of-type { border-top: 0; }
.gscf-turno-btns { display: inline-flex; gap: 6px; }
.gscf-turno.is-on { outline: 3px solid #15803d; }
.gscf-turno.is-off { outline: 3px solid var(--red); }
@media (max-width: 520px) { .gscf-ev { flex-direction: column; gap: 4px; } .gscf-ev-date { min-width: 0; } }
.gscf-resp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
