:root {
  --wl-bg: #f5f6f8;
  --wl-surface: #ffffff;
  --wl-border: #e2e5ea;
  --wl-text: #1f2937;
  --wl-text-muted: #6b7280;
  --wl-primary: #2f6b3a;
  --wl-primary-dark: #244f2b;
  --wl-danger: #b3261e;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--wl-bg);
  color: var(--wl-text);
}

.wl-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wl-login-card {
  background: var(--wl-surface);
  border: 1px solid var(--wl-border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.wl-login-card h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.wl-login-card p.wl-subtitle {
  color: var(--wl-text-muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

.wl-field {
  margin-bottom: 18px;
}

.wl-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--wl-text);
}

.wl-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wl-border);
  border-radius: 8px;
  font-size: 1rem;
}

.wl-field input:focus {
  outline: none;
  border-color: var(--wl-primary);
}

.wl-btn {
  display: inline-block;
  background: var(--wl-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.wl-btn:hover { background: var(--wl-primary-dark); }

.wl-error {
  background: #fdecea;
  color: var(--wl-danger);
  border: 1px solid #f5c6c3;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

/* Layout ruoli di gestione (desktop) */
.wl-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.wl-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--wl-surface);
  border-right: 1px solid var(--wl-border);
  padding: 24px 0;
}

.wl-sidebar .wl-brand {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 24px 20px;
  color: var(--wl-primary-dark);
}

.wl-sidebar nav a, .wl-sidebar nav span {
  display: block;
  padding: 10px 24px;
  color: var(--wl-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.wl-sidebar nav a.active, .wl-sidebar nav span.active {
  color: var(--wl-primary-dark);
  background: #eef4ef;
  font-weight: 600;
  border-right: 3px solid var(--wl-primary);
}

.wl-main {
  flex: 1;
  padding: 32px 40px;
  width: 100%;
}

.wl-main .wl-card {
  max-width: 1400px;
}

.wl-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.wl-topbar h1 {
  font-size: 1.3rem;
  margin: 0;
}

.wl-user-chip {
  font-size: 0.9rem;
  color: var(--wl-text-muted);
}

.wl-user-chip a {
  color: var(--wl-danger);
  margin-left: 12px;
  text-decoration: none;
}

.wl-card {
  background: var(--wl-surface);
  border: 1px solid var(--wl-border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.wl-empty {
  color: var(--wl-text-muted);
  font-size: 0.95rem;
}

/* Tab macroaree */
.wl-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--wl-border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wl-tabs a {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--wl-text-muted);
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
}

.wl-tabs a.active {
  color: var(--wl-primary-dark);
  border-bottom-color: var(--wl-primary);
  font-weight: 600;
}

/* Doppia colonna: elenco + dettaglio */
.wl-split {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.wl-split-list {
  flex: 1;
  min-width: 280px;
}

.wl-split-detail {
  flex: 1;
  min-width: 320px;
}

.wl-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--wl-border);
  border-radius: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--wl-text);
  background: var(--wl-surface);
}

.wl-list-item:hover { border-color: var(--wl-primary); }
.wl-list-item.active { border-color: var(--wl-primary); background: #eef4ef; }

.wl-list-item .wl-list-item-meta {
  font-size: 0.82rem;
  color: var(--wl-text-muted);
}

.wl-list-item-new {
  display: block;
  text-align: center;
  padding: 12px 14px;
  border: 1px dashed var(--wl-border);
  border-radius: 8px;
  color: var(--wl-primary-dark);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 8px;
}

.wl-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.wl-btn-secondary {
  background: var(--wl-surface);
  color: var(--wl-danger);
  border: 1px solid var(--wl-border);
}

.wl-btn-secondary:hover { background: #fdecea; }

select.wl-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wl-border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

/* Vista socio (responsive) */
.wl-socio-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.wl-breadcrumb {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--wl-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.wl-breadcrumb:hover { color: var(--wl-primary-dark); }

.wl-section-title {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.wl-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.wl-area-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--wl-surface);
  border: 1px solid var(--wl-border);
  border-radius: 10px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--wl-text);
  font-weight: 600;
}

.wl-area-card:hover { border-color: var(--wl-primary); }

.wl-area-card-empty {
  color: var(--wl-text-muted);
}

.wl-badge {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--wl-primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.wl-area-card-empty .wl-badge {
  background: var(--wl-bg);
  color: var(--wl-text-muted);
}

.wl-group-heading {
  font-size: 0.95rem;
  color: var(--wl-text-muted);
  margin: 20px 0 8px;
}

.wl-versioni-storico {
  margin: -4px 0 8px 14px;
  padding-left: 14px;
  border-left: 2px solid var(--wl-border);
}

.wl-list-item-storico {
  background: transparent;
  border-style: dashed;
  font-size: 0.9rem;
}

.wl-details {
  margin-bottom: 10px;
  border: 1px solid var(--wl-border);
  border-radius: 8px;
  padding: 4px 14px;
}

.wl-details summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.92rem;
  list-style: revert;
}

.wl-details .wl-list-item {
  margin-left: 0;
}

.wl-alert-card {
  border-color: #d9c26b;
  background: #fdf8e9;
  color: var(--wl-text);
}

.wl-alert-card:hover {
  border-color: #c2a63f;
}
