:root {
  --primary: #00875A;
  --primary-dark: #006747;
  --danger: #DC3545;
  --warning: #FFC107;
  --info: #17A2B8;
  --success: #28A745;
  --light: #F8F9FA;
  --dark: #343A40;
  --gray: #6C757D;
  --light-gray: #E9ECEF;
  --white: #FFFFFF;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 12px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --animation: 0.25s ease;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--light-gray);
  color: var(--dark);
  overflow-x: hidden;
  touch-action: pan-y;
}

/* ---- App shell ---- */
.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  padding-bottom: 88px; /* spazio per bottom-nav */
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.page-title {
  font-size: 18px;
  font-weight: 750;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform var(--animation), box-shadow var(--animation);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.user-name { font-weight: 800; }
.user-sub { font-size: 13px; color: var(--gray); }

/* ---- Buttons ---- */
.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: var(--white);
  color: var(--dark);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--animation), box-shadow var(--animation), background var(--animation), border-color var(--animation);
  font-size: 16px;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn.primary,
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: transparent;
}

.btn.primary:hover,
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 14px rgba(0,135,90,0.25);
}

.btn.secondary,
.btn-secondary {
  background: var(--light);
}

.btn-danger { background: var(--danger); color: var(--white); border-color: transparent; }
.btn-warning { background: var(--warning); color: var(--dark); border-color: transparent; }

/* ---- Forms ---- */
.row {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label { font-weight: 650; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--light-gray);
  font-size: 16px;
  background: var(--white);
  transition: border-color var(--animation), box-shadow var(--animation);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,135,90,0.12);
}

.idbox {
  background: rgba(0,0,0,0.04);
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
}

/* ---- Bottom status (compat) ---- */
.msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.06);
  color: var(--dark);
  border-left: 4px solid rgba(0,0,0,0.18);
  transition: opacity var(--animation);
}

.msg.ok { border-left-color: var(--success); }
.msg.error { border-left-color: var(--danger); }
.msg.info { border-left-color: var(--info); }

/* ---- Bottom navigation (Buono.html style, but hash-based) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 10px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.10);
  z-index: 1000;
  border-top: 1px solid var(--light-gray);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  color: var(--gray);
  text-decoration: none;
  flex: 1;
  max-width: 110px;
  transition: background var(--animation), transform var(--animation), color var(--animation);
}

.bottom-nav-item .icon { font-size: 20px; line-height: 1; }
.bottom-nav-item .label { font-size: 12px; font-weight: 700; }

.bottom-nav-item.active {
  color: var(--primary);
  background: rgba(0,135,90,0.10);
}

.bottom-nav-item:active { transform: scale(0.96); }

/* ---- Toggle switch (compat: existing users page) ---- */
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.user-meta { min-width: 0; }

.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  width: 64px;
  height: 32px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: #c94b4b; /* OFF */
  transition: 0.2s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.slider:before {
  content: "✕";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #c94b4b;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.switch input:checked + .slider { background: #76b947; }
.switch input:checked + .slider:before {
  transform: translateX(32px);
  content: "✓";
  color: #76b947;
}

.chev { font-size: 26px; color: #999; user-select: none; padding-left: 4px; }

@media (min-width: 768px) {
  .container { padding: 18px; }
}
