/* ===========================================================
   WellFit Studio — Design System
   Base: AdminLTE 3 (Bootstrap 4)
   =========================================================== */

/* ---- Design Tokens ---- */
:root {
  --wf-primary: #1a1a2e;
  --wf-primary-light: #2d2d4e;
  --wf-secondary: #0f3460;
  --wf-accent: #e94560;
  --wf-accent-light: #ff6b81;
  --wf-success: #28a745;
  --wf-warning: #ffc107;
  --wf-danger: #dc3545;
  --wf-info: #17a2b8;

  --wf-bg: #f0f2f5;
  --wf-bg-card: #ffffff;
  --wf-bg-sidebar: #1a1a2e;

  --wf-text: #2d3748;
  --wf-text-muted: #718096;
  --wf-text-light: #a0aec0;

  --wf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wf-border-radius: 10px;
  --wf-border-radius-sm: 6px;
  --wf-border-radius-lg: 14px;
  --wf-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --wf-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  --wf-shadow-xl: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --wf-transition: all 0.2s ease;
}

/* ---- Typography ---- */
body,
.main-header .navbar,
.sidebar,
.content-wrapper,
.card,
.modal-content,
.form-control,
.btn,
.dropdown-menu,
.breadcrumb,
.small-box,
.table,
.page-title,
h1, h2, h3, h4, h5, h6,
p, span, a, li, label, th, td {
  font-family: var(--wf-font);
}

body {
  background: var(--wf-bg);
  color: var(--wf-text);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--wf-primary);
  letter-spacing: -0.02em;
}

h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }

/* ---- Sidebar ---- */
.main-sidebar {
  background: var(--wf-bg-sidebar) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background-color: var(--wf-secondary);
}

.brand-text {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.nav-sidebar .nav-item > .nav-link {
  border-radius: 8px;
  margin: 2px 8px;
  transition: var(--wf-transition);
}

.nav-sidebar .nav-item > .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-treeview .nav-item > .nav-link {
  padding-left: 2rem !important;
  font-size: 0.88rem;
}

/* ---- Cards ---- */
.card {
  border: none;
  border-radius: var(--wf-border-radius);
  box-shadow: var(--wf-shadow);
  transition: var(--wf-transition);
}

.card:hover {
  box-shadow: var(--wf-shadow-lg);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  background: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---- Small Box / KPI Cards ---- */
.small-box {
  border-radius: var(--wf-border-radius);
  box-shadow: var(--wf-shadow);
  transition: var(--wf-transition);
  overflow: hidden;
  border: none;
}

.small-box:hover {
  box-shadow: var(--wf-shadow-lg);
  transform: translateY(-2px);
}

.small-box > .inner {
  padding: 1.25rem;
}

.small-box h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.small-box p {
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-bottom: 4px;
}

.small-box > .small-box-footer {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.6rem 0;
  font-size: 0.82rem;
  font-weight: 500;
}

.small-box > .small-box-footer-black {
  background-color: rgba(0,0,0,.1);
  color: rgba(0,0,0,.8);
  display: block;
  /* padding: 3px 0; */
  position: relative;
  text-align: center;
  text-decoration: none;
  z-index: 10;
  padding: 0.6rem 0;
  font-size: 0.82rem;
  font-weight: 500;
}

.bg-blue {
  background-color: #007bff !important;

  h3 {
    color: #ffffff !important;
  }
}

/* KPI color refinements */
.small-box.bg-info { background: linear-gradient(135deg, #0f3460, #16213e) !important; }
.small-box.bg-success { background: linear-gradient(135deg, #28a745, #20c997) !important; }
.small-box.bg-warning { background: linear-gradient(135deg, #e67e22, #f39c12) !important; }
.small-box.bg-danger { background: linear-gradient(135deg, #e94560, #dc3545) !important; }
.small-box.bg-primary { background: #007bff !important; }

/* ---- Buttons ---- */
.btn {
  border-radius: var(--wf-border-radius-sm);
  font-weight: 500;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  transition: var(--wf-transition);
  border-width: 2px;
}

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

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 5px;
}

.btn-lg {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
}

.btn-primary {
  background: var(--wf-secondary);
  border-color: var(--wf-secondary);
}
.btn-primary:hover {
  background: #0a2540;
  border-color: #0a2540;
}

.btn-outline-primary {
  border-color: var(--wf-secondary);
  color: var(--wf-secondary);
}
.btn-outline-primary:hover {
  background: var(--wf-secondary);
  border-color: var(--wf-secondary);
  color: #fff;
}

.btn-accent {
  background: var(--wf-accent);
  border-color: var(--wf-accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--wf-accent-light);
  border-color: var(--wf-accent-light);
  color: #fff;
}

.btn-outline-accent {
  border-color: var(--wf-accent);
  color: var(--wf-accent);
}
.btn-outline-accent:hover {
  background: var(--wf-accent);
  border-color: var(--wf-accent);
  color: #fff;
}

/* ---- Forms ---- */
.form-control {
  border-radius: var(--wf-border-radius-sm);
  border: 1.5px solid #e2e8f0;
  /* padding: 0.5rem 0.75rem; */
  font-size: 0.9rem;
  transition: var(--wf-transition);
}

.form-control:focus {
  border-color: var(--wf-secondary);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}

.form-group label,
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--wf-text);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
  background: transparent;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  font-size: 1.1rem;
  color: var(--wf-text-light);
}

.breadcrumb-item a {
  color: var(--wf-secondary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--wf-text-muted);
}

/* ---- Page Titles ---- */
.page-title {
  margin-bottom: 1.25rem;
}

.page-title h3 {
  margin-bottom: 0.15rem;
}

.page-title .text-subtitle {
  font-size: 0.88rem;
  color: var(--wf-text-muted);
  margin-bottom: 0;
}

/* ---- Tables ---- */
.table {
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid #e9ecef;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--wf-text-muted);
  padding: 0.75rem;
}

.table td {
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
  border-top: 1px solid #f0f2f5;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: #fafbfc;
}

.table-striped tbody tr:hover,
.table-hover tbody tr:hover {
  background: #f0f4ff;
}

.table-bordered {
  border: 1px solid #e9ecef;
  border-radius: var(--wf-border-radius);
  overflow: hidden;
}

/* ---- DataTables refinements ---- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 0.75rem;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: var(--wf-border-radius-sm) !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 0.35rem 0.5rem !important;
  margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--wf-border-radius-sm) !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--wf-text-muted);
  font-size: 0.82rem;
  padding-top: 0.85rem !important;
}

/* ---- Modals ---- */
.modal-content {
  border: none;
  border-radius: var(--wf-border-radius-lg);
  box-shadow: var(--wf-shadow-xl);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 700;
  color: var(--wf-primary);
}

.modal-xl { max-width: 900px; }
.modal-lg { max-width: 700px; }

/* ---- Navbar/Topbar ---- */
.main-header.navbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ---- Alerts ---- */
.alert {
  border: none;
  border-radius: var(--wf-border-radius);
  font-weight: 500;
}

/* ---- Empty States ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state .empty-state-icon {
  font-size: 3rem;
  color: var(--wf-text-light);
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: var(--wf-text-muted);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--wf-text-light);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1.25rem;
}

/* ---- Utility Classes ---- */
.wf-text-accent { color: var(--wf-accent); }
.wf-text-primary { color: var(--wf-primary); }
.wf-bg-soft-primary { background: #eef2f7; }
.wf-bg-soft-accent { background: #fef0f2; }

.wf-gap-xs { gap: 0.25rem; }
.wf-gap-sm { gap: 0.5rem; }
.wf-gap-md { gap: 1rem; }

/* ---- Transitions ---- */
.fade-in {
  animation: wfFadeIn 0.3s ease;
}

@keyframes wfFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Planner refinements ---- */
#calendar {
  background: var(--wf-bg-card);
  border-radius: var(--wf-border-radius);
  padding: 1rem;
  box-shadow: var(--wf-shadow);
}

.fc-toolbar-title {
  font-weight: 700 !important;
  color: var(--wf-primary) !important;
}

/* ---- Scrollbar refinements ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c4c9d0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a8b3;
}

/* ---- Toggle Switch (Bootstrap 4 custom-switch) ---- */

.wf-card {
  border: none;
  border-radius: var(--wf-border-radius);
  box-shadow: var(--wf-shadow);
  transition: var(--wf-transition);
}

.wf-card:hover {
  box-shadow: var(--wf-shadow-lg);
}

.wf-card .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.wf-card .card-body {
  padding: 1.25rem;
}
.content-wrapper {
  background: var(--wf-bg) !important;
}

/* ---- Select2 refinements ---- */
.select2-container--bootstrap-4 .select2-selection {
  border-radius: var(--wf-border-radius-sm) !important;
  border: 1.5px solid #e2e8f0 !important;
  min-height: 38px;
  align-content: center;
}

/* ---- Login page refinements ---- */
.login-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%) !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 420px;
}

.login-box .card {
  border-radius: var(--wf-border-radius-lg);
  box-shadow: var(--wf-shadow-xl);
  overflow: hidden;
}

.login-box .card-header {
  background: var(--wf-primary);
  color: #fff;
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  border: none;
}

.login-box .card-header a {
  color: #fff;
  text-decoration: none;
}

.login-box .card-header .h1 {
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.login-box .card-body {
  padding: 2rem;
}

.bg-utenti-attivi {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

.bg-utenti-inattivi {
    background-color: #ff0000 !important;
    color: #000000 !important;
}

.bg-membership {
    background-color: #FF7E00 !important;
    color: #000000 !important;
}

.bg-carnet-scaduti {
    background-color: #DC92FF;
    color: #000000 !important;
}
