:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #778196;
  --primary: #4f46e5;
  --primary2: #7c3aed;
  --border: #e7eaf0;
  --danger: #dc2626;
  --radius: 20px;
  --shadow: 0 10px 35px rgba(25,35,58,.08);
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: #111827;
  color: white;
  padding: 25px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  margin: 5px 10px 30px;
}

.logo small {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
  margin-top: 4px;
}

.nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 5px 0;
  color: #d1d5db;
}

.nav a:hover {
  background: #1f2937;
  color: white;
}

.nav .admin {
  color: #c4b5fd;
}

.content {
  padding: 30px;
  max-width: 1450px;
  width: 100%;
}

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

.userbox {
  text-align: right;
}

.userbox strong {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: 30px;
}

h2 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(231,234,240,.7);
}

.card-wide {
  grid-column: span 2;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 18px;
  margin-bottom: 18px;
}

.icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #eef2ff;
  font-size: 21px;
}

.big-number {
  font-size: 30px;
  font-weight: 800;
}

.notice {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.notice:last-child {
  border-bottom: 0;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.btn {
  border: 0;
  background: var(--primary);
  color: white;
  padding: 11px 17px;
  border-radius: 11px;
  font-weight: 650;
  cursor: pointer;
  display: inline-block;
}

.btn:hover {
  opacity: .92;
}

.btn-light {
  background: #eef2ff;
  color: var(--primary);
}

input, textarea, select {
  width: 100%;
  border: 1px solid #dce1ea;
  border-radius: 11px;
  padding: 12px 13px;
  font: inherit;
  margin-top: 6px;
  background: white;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 13px;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}

.login-hero {
  padding: 70px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, #818cf8 0, transparent 35%),
    radial-gradient(circle at 80% 70%, #7c3aed 0, transparent 38%),
    #111827;
}

.login-hero h1 {
  font-size: clamp(45px, 7vw, 80px);
  margin-bottom: 10px;
}

.login-hero p {
  font-size: 20px;
  color: #d1d5db;
  max-width: 550px;
}

.login-side {
  display: grid;
  place-items: center;
  padding: 35px;
}

.login-box {
  width: 100%;
  max-width: 430px;
}

.login-box h2 {
  font-size: 30px;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.tag {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.mobile-title {
  display: none;
}

@media(max-width: 800px) {
  .shell { grid-template-columns: 1fr; }

  .sidebar {
    height: auto;
    position: relative;
    padding: 15px;
  }

  .logo { margin-bottom: 12px; }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }

  .nav a {
    white-space: nowrap;
    margin: 0;
  }

  .content { padding: 18px; }

  .grid { grid-template-columns: 1fr; }

  .card-wide { grid-column: span 1; }

  .form-grid { grid-template-columns: 1fr; }

  .login-page { grid-template-columns: 1fr; }

  .login-hero {
    min-height: 260px;
    padding: 35px;
  }

  .login-hero h1 { font-size: 45px; }

  .login-side { padding: 25px; }

  .topbar h1 { font-size: 23px; }
}


/* =========================================================
   MR4 V2
   ========================================================= */

.nav-separator {
  height: 1px;
  background: #273244;
  margin: 14px 6px;
}

.nav-admin-title {
  color: #6b7280;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  padding: 10px 14px 5px;
}

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

.page-header h2 {
  margin-bottom: 4px;
}

.alert-success,
.alert-error {
  border-radius: 13px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-weight: 600;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.warning-box {
  background: #fef3c7;
  color: #92400e;
  padding: 13px;
  border-radius: 12px;
  margin: 15px 0;
}


/* DASHBOARD */

.dashboard-hero {
  background:
    radial-gradient(circle at 90% 15%, rgba(129,140,248,.7), transparent 30%),
    linear-gradient(135deg,#111827,#312e81 60%,#5b21b6);
  color: white;
  border-radius: 26px;
  padding: 32px;
  margin-bottom: 30px;
  box-shadow: 0 18px 50px rgba(49,46,129,.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}

.dashboard-hero h2 {
  font-size: 32px;
  margin: 5px 0 8px;
}

.dashboard-hero p {
  color: #dbeafe;
  margin: 0;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
  color: #c7d2fe;
}

.hero-apartment {
  min-width: 120px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
  border-radius: 17px;
  padding: 14px 20px;
  text-align: center;
}

.hero-apartment span {
  display: block;
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #c7d2fe;
}

.hero-apartment strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.dashboard-section {
  margin-bottom: 26px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 15px;
  gap: 15px;
}

.section-heading h2 {
  margin: 2px 0 0;
}

.section-kicker {
  color: #4f46e5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.dashboard-notices {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 15px;
}

.dashboard-notice {
  min-height: 195px;
  padding: 20px;
  border-radius: 21px;
  border: 1px solid rgba(255,255,255,.7);
  transition: transform .18s ease,box-shadow .18s ease;
}

.dashboard-notice:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 35px rgba(31,41,55,.12);
}

.dashboard-notice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-notice-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.6);
  border-radius: 12px;
}

.dashboard-notice-date {
  font-size: 11px;
  font-weight: 800;
  opacity: .6;
}

.dashboard-notice h3 {
  font-size: 19px;
  margin: 18px 0 8px;
}

.dashboard-notice p {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.dashboard-notice-author {
  font-size: 11px;
  font-weight: 700;
  opacity: .65;
  margin-top: 18px;
}

.notice-color-0 {
  background: linear-gradient(135deg,#e0e7ff,#f5f3ff);
  color: #312e81;
}

.notice-color-1 {
  background: linear-gradient(135deg,#dcfce7,#ecfdf5);
  color: #166534;
}

.notice-color-2 {
  background: linear-gradient(135deg,#fef3c7,#fffbeb);
  color: #92400e;
}

.notice-color-3 {
  background: linear-gradient(135deg,#fce7f3,#fdf2f8);
  color: #9d174d;
}

.notice-color-4 {
  background: linear-gradient(135deg,#cffafe,#ecfeff);
  color: #155e75;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: white;
  border-radius: 22px;
  border: 1px solid #e9edf4;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.dashboard-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 22px;
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  background: #eef2ff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.card-label {
  display: block;
  color: #778196;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.dashboard-main-value {
  font-size: 31px;
  line-height: 1.1;
  font-weight: 850;
  margin-bottom: 15px;
}

.dashboard-detail {
  margin: 6px 0;
  font-size: 14px;
}

.receipt-badge {
  display: inline-block;
  align-self: flex-start;
  background: #ecfdf5;
  color: #047857;
  padding: 7px 9px;
  border-radius: 9px;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 800;
}

.card-link {
  color: #4f46e5;
  font-weight: 750;
  font-size: 13px;
  margin-top: auto;
  padding-top: 20px;
}

.softener-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.softener-info strong,
.softener-info small {
  display: block;
}

.softener-info small {
  margin-top: 4px;
  color: #778196;
}

.days-counter {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.days-value {
  font-size: 32px;
  font-weight: 900;
  color: #4f46e5;
}

.days-value.warning {
  color: #d97706;
}

.days-value.danger {
  color: #dc2626;
}

.progress-wrap {
  margin-top: 15px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: #e5e7eb;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg,#4f46e5,#7c3aed);
}

.progress-caption {
  color: #778196;
  font-size: 11px;
  margin-top: 6px;
}

.dashboard-list-row {
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
}

.dashboard-list-row strong,
.dashboard-list-row small {
  display: block;
}

.dashboard-list-row small {
  color: #778196;
  margin-top: 3px;
}

.waste-value {
  font-size: 25px;
}

.empty-card-text {
  color: #778196;
  padding: 20px 0;
}

.empty-state {
  background: white;
  border: 1px dashed #d1d5db;
  border-radius: 20px;
  padding: 25px;
}

.empty-state span {
  font-size: 30px;
}

.empty-state strong {
  display: block;
  margin-top: 8px;
}

.calendar-dashboard-card {
  margin-top: 18px;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 12px;
}

.event-mini-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: #f8fafc;
  padding: 13px;
  border-radius: 14px;
}

.event-date-box {
  min-width: 56px;
  text-align: center;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 11px;
  padding: 7px;
}

.event-date-box strong {
  display: block;
  font-size: 20px;
}

.event-date-box span {
  font-size: 10px;
}


/* AVVISI */

.notice-list {
  display: grid;
  gap: 15px;
}

.notice-panel {
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  padding: 18px;
  background: linear-gradient(135deg,#fafafa,#fff);
}

.notice-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.notice-panel h3 {
  margin: 0 0 5px;
}

.notice-meta {
  color: #778196;
  font-size: 11px;
}

.notice-panel-body {
  margin: 15px 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notice-badge {
  height: fit-content;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
}

.admin-notice-tools {
  border-top: 1px solid #e5e7eb;
  padding-top: 13px;
}

.admin-notice-tools summary {
  cursor: pointer;
  color: #4f46e5;
  font-weight: 700;
}

.admin-edit-form {
  margin-top: 15px;
}

.btn-danger {
  background: #dc2626;
}


/* ACCOUNT / USERS */

.account-layout {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 20px;
}

.account-summary h3 {
  margin-top: 0;
}

.info-row {
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.info-row span,
.info-row strong {
  display: block;
}

.info-row span {
  color: #778196;
  font-size: 12px;
  margin-bottom: 4px;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 16px;
}

.user-card {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.user-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg,#4f46e5,#7c3aed);
  color: white;
  font-size: 20px;
  font-weight: 850;
}

.user-card-data {
  flex: 1;
  min-width: 150px;
}

.user-card-data h3,
.user-card-data p {
  margin: 0;
}

.user-card-data p {
  color: #778196;
  font-size: 13px;
  margin-top: 3px;
}

.user-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.tag-admin {
  background: #ede9fe;
  color: #6d28d9;
}

.tag-active {
  background: #dcfce7;
  color: #166534;
}

.tag-disabled {
  background: #fee2e2;
  color: #991b1b;
}

.form-card {
  max-width: 720px;
}

.back-link {
  display: inline-block;
  margin-bottom: 15px;
  color: #4f46e5;
  font-weight: 700;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.check-row input {
  width: auto;
  margin: 0;
}

.admin-protection {
  background: #eef2ff;
  color: #3730a3;
  border-radius: 12px;
  padding: 13px;
  margin: 15px 0;
}


/* SMTP / DATI */

.settings-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 20px;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.settings-title h3,
.settings-title p {
  margin: 0;
}

.settings-title p {
  color: #778196;
  margin-top: 3px;
}

.settings-icon,
.large-action-icon {
  font-size: 30px;
}

.smtp-test-card {
  height: fit-content;
}

.data-action-card {
  min-height: 260px;
}

.backup-list {
  display: grid;
  gap: 10px;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
}

.responsive-table {
  overflow-x: auto;
}

.audit-detail {
  min-width: 300px;
  max-width: 600px;
}


/* DOCUMENTI / RICEVUTE */

.document-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #edf0f5;
}

.attachment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* MOBILE */

@media(max-width: 800px) {

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 23px;
    border-radius: 20px;
  }

  .dashboard-hero h2 {
    font-size: 26px;
  }

  .hero-apartment {
    min-width: 110px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-notices {
    grid-template-columns: 1fr;
  }

  .dashboard-notice {
    min-height: 0;
  }

  .account-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .document-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .attachment-actions {
    width: 100%;
  }

  .attachment-actions .btn {
    flex: 1;
    text-align: center;
  }

  .softener-info {
    grid-template-columns: 1fr;
  }

  .notice-panel-header {
    flex-direction: column;
  }

  .notice-badge {
    width: fit-content;
  }

  .backup-row {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media(max-width: 500px) {

  .content {
    padding: 14px;
  }

  .dashboard-hero {
    padding: 20px;
  }

  .dashboard-card,
  .card {
    padding: 17px;
    border-radius: 18px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .dashboard-main-value {
    font-size: 27px;
  }

}

/* =========================================================
   MR4 V2.1 - DASHBOARD PIU COLORATA
   ========================================================= */

body {
  background:
    linear-gradient(180deg,#eef2f7 0%,#f6f8fb 45%,#eef2f7 100%);
}

.content {
  background: transparent;
}

/* HERO PIU MARCATA */

.dashboard-hero {
  background:
    radial-gradient(circle at 90% 0%, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(135deg,#111827 0%,#312e81 52%,#6d28d9 100%);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 20px 55px rgba(49,46,129,.24);
}

/* SEZIONE AVVISI */

.dashboard-section {
  background: #ffffffaa;
  border: 1px solid #dde3ec;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 35px rgba(31,41,55,.06);
}

.section-heading {
  border-bottom: 1px solid #e3e7ee;
  padding-bottom: 13px;
}

/* AVVISI PIU SATURI */

.notice-color-0 {
  background:
    linear-gradient(135deg,#c7d2fe 0%,#e0e7ff 100%);
  color: #312e81;
  border-left: 5px solid #6366f1;
}

.notice-color-1 {
  background:
    linear-gradient(135deg,#bbf7d0 0%,#dcfce7 100%);
  color: #166534;
  border-left: 5px solid #22c55e;
}

.notice-color-2 {
  background:
    linear-gradient(135deg,#fde68a 0%,#fef3c7 100%);
  color: #92400e;
  border-left: 5px solid #f59e0b;
}

.notice-color-3 {
  background:
    linear-gradient(135deg,#fbcfe8 0%,#fce7f3 100%);
  color: #9d174d;
  border-left: 5px solid #ec4899;
}

.notice-color-4 {
  background:
    linear-gradient(135deg,#a5f3fc 0%,#cffafe 100%);
  color: #155e75;
  border-left: 5px solid #06b6d4;
}

/* CARD GENERALI PIU DISTINTE */

.dashboard-card {
  border: none;
  box-shadow: 0 15px 40px rgba(31,41,55,.09);
  position: relative;
  overflow: hidden;
}

/* AUTOBOTTE */

.water-card {
  background:
    linear-gradient(145deg,#dbeafe 0%,#eff6ff 65%,#ffffff 100%);
  border-left: 6px solid #3b82f6;
}

.water-card .dashboard-card-icon {
  background: #bfdbfe;
  color: #1d4ed8;
}

/* ADDOLCITORE */

.softener-card {
  background:
    linear-gradient(145deg,#fef3c7 0%,#fffbeb 68%,#ffffff 100%);
  border-left: 6px solid #f59e0b;
}

.softener-card .dashboard-card-icon {
  background: #fde68a;
  color: #92400e;
}

/* DOCUMENTI */

.dashboard-grid .dashboard-card:nth-child(3) {
  background:
    linear-gradient(145deg,#ede9fe 0%,#f5f3ff 70%,#ffffff 100%);
  border-left: 6px solid #8b5cf6;
}

.dashboard-grid .dashboard-card:nth-child(3) .dashboard-card-icon {
  background: #ddd6fe;
  color: #6d28d9;
}

/* RACCOLTA */

.dashboard-grid .dashboard-card:nth-child(4) {
  background:
    linear-gradient(145deg,#dcfce7 0%,#f0fdf4 68%,#ffffff 100%);
  border-left: 6px solid #22c55e;
}

.dashboard-grid .dashboard-card:nth-child(4) .dashboard-card-icon {
  background: #bbf7d0;
  color: #166534;
}

/* CALENDARIO */

.calendar-dashboard-card {
  background:
    linear-gradient(145deg,#fce7f3 0%,#fdf2f8 70%,#ffffff 100%);
  border-left: 6px solid #ec4899;
  box-shadow: 0 15px 40px rgba(31,41,55,.08);
}

/* VALORI PRINCIPALI PIU EVIDENTI */

.dashboard-main-value {
  color: #111827;
}

.dashboard-detail strong {
  color: #111827;
}

.softener-info strong {
  font-size: 16px;
}

/* PROGRESS BAR ADDOLCITORE */

.progress-track {
  background: #fdecc8;
}

.progress-bar {
  background:
    linear-gradient(90deg,#f59e0b,#d97706);
}

/* CARD LINK */

.card-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: rgba(255,255,255,.65);
  border-radius: 10px;
  padding: 8px 11px;
  margin-top: auto;
}

/* EVENTI */

.event-mini-card {
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.9);
}

/* MOBILE */

@media(max-width: 800px) {

  .dashboard-section {
    padding: 15px;
    border-radius: 19px;
  }

  .dashboard-card {
    border-radius: 19px;
  }

  .water-card,
  .softener-card,
  .dashboard-grid .dashboard-card:nth-child(3),
  .dashboard-grid .dashboard-card:nth-child(4),
  .calendar-dashboard-card {
    border-left-width: 5px;
  }

}

/* =========================================================
   MR4 MODERN UI
   ========================================================= */

:root {
  --bg-main: #f3f6fb;
  --surface: rgba(255,255,255,.82);
  --surface-strong: #ffffff;
  --text-main: #172033;
  --text-soft: #7b8497;
  --line: #e6eaf0;

  --blue: #4f6cf7;
  --blue-soft: #dfe7ff;

  --violet: #7557f5;
  --violet-soft: #ece7ff;

  --green: #20b26b;
  --green-soft: #ddf7e9;

  --orange: #f39c3d;
  --orange-soft: #fff0d7;

  --pink: #e64d8d;
  --pink-soft: #fde3ef;

  --cyan: #20b9c9;
  --cyan-soft: #daf6f8;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;

  --shadow-soft:
    0 10px 30px rgba(24,32,50,.06),
    0 2px 8px rgba(24,32,50,.04);

  --shadow-card:
    0 18px 55px rgba(25,36,63,.09);
}


/* BACKGROUND */

body {
  background:
    radial-gradient(circle at 10% 0%, #e9edff 0, transparent 32%),
    radial-gradient(circle at 100% 20%, #f1e9ff 0, transparent 30%),
    linear-gradient(180deg,#f4f7fb 0%,#eef2f7 100%);
  color: var(--text-main);
}


/* SIDEBAR */

.sidebar {
  background:
    linear-gradient(180deg,#111827 0%,#172033 100%);
  border-right: 1px solid rgba(255,255,255,.04);
}

.logo {
  font-size: 28px;
  letter-spacing: -.8px;
}

.logo small {
  color: #8d96a8;
}

.nav a {
  color: #c9d0dc;
  border-radius: 14px;
  transition: all .18s ease;
}

.nav a:hover {
  background: rgba(255,255,255,.07);
  color: white;
  transform: translateX(2px);
}

.nav .admin {
  color: #c7baff;
}


/* CONTENT */

.content {
  padding: 34px;
}

.topbar {
  margin-bottom: 28px;
}

.topbar h1 {
  font-size: 31px;
  letter-spacing: -.5px;
}


/* HERO */

.dashboard-hero {
  position: relative;
  overflow: hidden;

  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle at 20% 120%, rgba(117,87,245,.35), transparent 38%),
    linear-gradient(135deg,#111827 0%,#27346d 47%,#5b46d9 100%);

  color: white;

  border-radius: 30px;
  padding: 34px;

  box-shadow:
    0 24px 60px rgba(50,54,130,.22);

  margin-bottom: 30px;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -50px;
  bottom: -60px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}

.dashboard-hero h2 {
  font-size: 34px;
  margin: 5px 0 8px;
  letter-spacing: -.6px;
}

.dashboard-hero p {
  color: #dbe2ff;
  font-size: 15px;
}

.eyebrow {
  color: #bfc9ff;
}

.hero-apartment {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px 22px;
}

.hero-apartment strong {
  font-size: 26px;
}


/* SECTION HEADINGS */

.dashboard-section {
  background: rgba(255,255,255,.48);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.section-heading {
  border: 0;
  margin-bottom: 17px;
}

.section-heading h2 {
  font-size: 23px;
  letter-spacing: -.4px;
}

.section-kicker {
  color: var(--blue);
}


/* NOTICE CARDS */

.dashboard-notices {
  gap: 16px;
}

.dashboard-notice {
  position: relative;
  overflow: hidden;
  border: 0;
  min-height: 200px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  transition:
    transform .22s ease,
    box-shadow .22s ease;
}

.dashboard-notice:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.dashboard-notice::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -25px;
  bottom: -25px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}

.notice-color-0 {
  background:
    linear-gradient(145deg,#d7dfff,#eef1ff);
  color: #2f3d83;
}

.notice-color-1 {
  background:
    linear-gradient(145deg,#d9f6e6,#effbf5);
  color: #176340;
}

.notice-color-2 {
  background:
    linear-gradient(145deg,#ffe9be,#fff6e4);
  color: #8a5617;
}

.notice-color-3 {
  background:
    linear-gradient(145deg,#f8d8e8,#fff0f6);
  color: #8d2857;
}

.notice-color-4 {
  background:
    linear-gradient(145deg,#d8f4f7,#edfafa);
  color: #176772;
}

.dashboard-notice-icon {
  background: rgba(255,255,255,.7);
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.dashboard-notice h3 {
  font-size: 20px;
  letter-spacing: -.25px;
}


/* MAIN DASHBOARD CARDS */

.dashboard-grid {
  gap: 20px;
}

.dashboard-card {
  position: relative;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 285px;

  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 24px 60px rgba(25,36,63,.13);
}

.dashboard-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  right: -45px;
  top: -45px;
  opacity: .3;
}

.dashboard-card-head {
  font-size: 19px;
  letter-spacing: -.25px;
}

.dashboard-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 23px;
}


/* AUTOBOTTE */

.water-card {
  background:
    linear-gradient(150deg,#e1ebff 0%,#f7faff 72%);
  border-left: 0;
}

.water-card::after {
  background: #8db1ff;
}

.water-card .dashboard-card-icon {
  background: #cbdcff;
  color: #3159b7;
}


/* ADDOLCITORE */

.softener-card {
  background:
    linear-gradient(150deg,#fff0cf 0%,#fffbf2 72%);
  border-left: 0;
}

.softener-card::after {
  background: #ffd88a;
}

.softener-card .dashboard-card-icon {
  background: #ffe1a6;
  color: #9b6419;
}


/* DOCUMENTI */

.dashboard-grid .dashboard-card:nth-child(3) {
  background:
    linear-gradient(150deg,#eee8ff 0%,#faf8ff 72%);
  border-left: 0;
}

.dashboard-grid .dashboard-card:nth-child(3)::after {
  background: #b9a8ff;
}

.dashboard-grid .dashboard-card:nth-child(3) .dashboard-card-icon {
  background: #dfd8ff;
  color: #5b42c5;
}


/* RACCOLTA */

.dashboard-grid .dashboard-card:nth-child(4) {
  background:
    linear-gradient(150deg,#dff7e9 0%,#f5fcf8 72%);
  border-left: 0;
}

.dashboard-grid .dashboard-card:nth-child(4)::after {
  background: #8ee0b2;
}

.dashboard-grid .dashboard-card:nth-child(4) .dashboard-card-icon {
  background: #c9efd9;
  color: #22734a;
}


/* CALENDARIO */

.calendar-dashboard-card {
  background:
    linear-gradient(150deg,#f8e5ee 0%,#fff8fb 72%);
  border: 1px solid rgba(255,255,255,.75);
  border-left: 0;
  border-radius: 24px;
  box-shadow: var(--shadow-card);
}


/* VALUE TYPOGRAPHY */

.dashboard-main-value {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.7px;
}

.card-label {
  color: #748096;
  letter-spacing: .2px;
}

.dashboard-detail {
  color: #47536a;
}

.dashboard-detail strong {
  color: #172033;
}


/* ADDOLCITORE */

.softener-info {
  gap: 18px;
}

.softener-info > div {
  background: rgba(255,255,255,.52);
  border-radius: 14px;
  padding: 12px;
}

.days-counter {
  background: rgba(255,255,255,.55);
  border-radius: 16px;
  padding: 13px;
}

.days-value {
  font-size: 36px;
}

.progress-track {
  height: 10px;
  background: rgba(255,255,255,.7);
}

.progress-bar {
  background:
    linear-gradient(90deg,#f3a43f,#f0c45e);
}


/* BUTTON / LINKS */

.btn {
  border-radius: 13px;
  padding: 11px 17px;
  box-shadow:
    0 5px 14px rgba(79,70,229,.18);
}

.btn-light {
  background: rgba(255,255,255,.8);
  color: #4f46e5;
  border: 1px solid rgba(79,70,229,.12);
  box-shadow: none;
}

.card-link {
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.9);
  padding: 9px 12px;
  border-radius: 12px;
  color: #3f51c7;
}


/* EVENTS */

.event-mini-card {
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 16px;
  box-shadow: 0 7px 22px rgba(31,41,55,.05);
}

.event-date-box {
  background:
    linear-gradient(135deg,#e4e7ff,#f1efff);
  border-radius: 13px;
}


/* GENERIC CARDS */

.card {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}


/* FORM */

input,
textarea,
select {
  border: 1px solid #dbe1ea;
  background: rgba(255,255,255,.86);
  border-radius: 13px;
  padding: 13px 14px;
  transition:
    border-color .18s ease,
    box-shadow .18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #7182f6;
  box-shadow:
    0 0 0 4px rgba(79,108,247,.11);
}


/* DOCUMENT ITEMS */

.document-item {
  background: rgba(248,250,252,.7);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 10px;
  border-bottom: 0;
}


/* ADMIN */

.user-card {
  background:
    linear-gradient(145deg,#ffffff,#f8f9fc);
}

.user-avatar {
  box-shadow:
    0 9px 20px rgba(79,70,229,.22);
}


/* MOBILE */

@media(max-width: 800px) {

  .content {
    padding: 18px;
  }

  .dashboard-hero {
    padding: 24px;
    border-radius: 23px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .dashboard-section {
    border-radius: 21px;
    padding: 15px;
  }

  .dashboard-card {
    border-radius: 21px;
    padding: 19px;
    min-height: 0;
  }

  .dashboard-notice {
    border-radius: 19px;
  }

  .dashboard-main-value {
    font-size: 29px;
  }

}


/* VERY SMALL PHONES */

@media(max-width: 480px) {

  .content {
    padding: 12px;
  }

  .topbar {
    margin-bottom: 18px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .dashboard-hero {
    padding: 20px;
    margin-bottom: 20px;
  }

  .dashboard-hero h2 {
    font-size: 24px;
  }

  .hero-apartment {
    padding: 11px 16px;
  }

  .hero-apartment strong {
    font-size: 21px;
  }

  .dashboard-notice {
    padding: 17px;
  }

}

/* =========================================================
   MR4 V2.2 - COLORI DASHBOARD PIU MARCATI
   ========================================================= */

/* Sfondo generale piu deciso */

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(94, 92, 230, .16), transparent 30%),
    radial-gradient(circle at 100% 18%, rgba(164, 93, 230, .13), transparent 28%),
    linear-gradient(180deg, #e9eef6 0%, #e3e9f2 100%);
}


/* AUTOBOTTE - BLU */

.water-card {
  background:
    linear-gradient(
      145deg,
      #c8d9ff 0%,
      #dce7ff 45%,
      #edf3ff 100%
    ) !important;

  border: 1px solid #afc6f8 !important;
  box-shadow:
    0 16px 42px rgba(45, 92, 190, .16) !important;
}

.water-card::after {
  background: #7098ef !important;
  opacity: .28 !important;
}

.water-card .dashboard-card-icon {
  background: #aac4ff !important;
  color: #214da5 !important;
}

.water-card .card-link {
  background: #eef4ff !important;
  color: #2e55b7 !important;
  border: 1px solid #adc2ef !important;
}


/* ADDOLCITORE - AMBRA */

.softener-card {
  background:
    linear-gradient(
      145deg,
      #ffe0a3 0%,
      #ffebbe 46%,
      #fff4da 100%
    ) !important;

  border: 1px solid #eccb86 !important;
  box-shadow:
    0 16px 42px rgba(180, 118, 24, .15) !important;
}

.softener-card::after {
  background: #f0b94f !important;
  opacity: .30 !important;
}

.softener-card .dashboard-card-icon {
  background: #ffd67c !important;
  color: #82500d !important;
}

.softener-card .softener-info > div {
  background: rgba(255,255,255,.66) !important;
  border: 1px solid rgba(205,157,69,.22);
}

.softener-card .days-counter {
  background: rgba(255,255,255,.65) !important;
  border: 1px solid rgba(205,157,69,.18);
}

.softener-card .card-link {
  background: #fff7e6 !important;
  color: #9b6419 !important;
  border: 1px solid #eccb86 !important;
}


/* DOCUMENTI - VIOLA */

.dashboard-grid .dashboard-card:nth-child(3) {
  background:
    linear-gradient(
      145deg,
      #d9ccff 0%,
      #e8e0ff 48%,
      #f2edff 100%
    ) !important;

  border: 1px solid #c8b6f3 !important;
  box-shadow:
    0 16px 42px rgba(104, 71, 190, .15) !important;
}

.dashboard-grid .dashboard-card:nth-child(3)::after {
  background: #9b7ae8 !important;
  opacity: .26 !important;
}

.dashboard-grid .dashboard-card:nth-child(3) .dashboard-card-icon {
  background: #cdbdff !important;
  color: #573cb3 !important;
}

.dashboard-grid .dashboard-card:nth-child(3) .card-link {
  background: #f1edff !important;
  color: #6547c5 !important;
  border: 1px solid #c4b3ec !important;
}


/* RACCOLTA - VERDE */

.dashboard-grid .dashboard-card:nth-child(4) {
  background:
    linear-gradient(
      145deg,
      #bfe9cf 0%,
      #d3f1de 48%,
      #e5f7ec 100%
    ) !important;

  border: 1px solid #a7dab9 !important;
  box-shadow:
    0 16px 42px rgba(34, 131, 76, .14) !important;
}

.dashboard-grid .dashboard-card:nth-child(4)::after {
  background: #68c58f !important;
  opacity: .28 !important;
}

.dashboard-grid .dashboard-card:nth-child(4) .dashboard-card-icon {
  background: #aee1c1 !important;
  color: #176b40 !important;
}

.dashboard-grid .dashboard-card:nth-child(4) .card-link {
  background: #eefaf2 !important;
  color: #23794b !important;
  border: 1px solid #acd9bd !important;
}


/* CALENDARIO - ROSA */

.calendar-dashboard-card {
  background:
    linear-gradient(
      145deg,
      #f2c6da 0%,
      #f8dbe8 48%,
      #fdebf3 100%
    ) !important;

  border: 1px solid #e8b4cc !important;

  box-shadow:
    0 16px 42px rgba(168, 63, 110, .14) !important;
}

.calendar-dashboard-card .icon {
  background: #edbdd2 !important;
}

.calendar-dashboard-card .btn-light {
  background: #fff2f7 !important;
  color: #b43c74 !important;
  border: 1px solid #e7b4ca !important;
}


/* AVVISI ANCORA PIU DISTINTI */

.notice-color-0 {
  background:
    linear-gradient(145deg,#b9c8ff,#d5ddff) !important;
  color: #263671 !important;
}

.notice-color-1 {
  background:
    linear-gradient(145deg,#aee5c5,#cff1dc) !important;
  color: #155d38 !important;
}

.notice-color-2 {
  background:
    linear-gradient(145deg,#ffd684,#ffe8b4) !important;
  color: #7a4b0e !important;
}

.notice-color-3 {
  background:
    linear-gradient(145deg,#efb6d2,#f8d3e4) !important;
  color: #81264f !important;
}

.notice-color-4 {
  background:
    linear-gradient(145deg,#a8e4eb,#caeff2) !important;
  color: #145e69 !important;
}


/* TESTO PIU CONTRASTATO */

.dashboard-card {
  color: #172033;
}

.dashboard-card .muted,
.dashboard-card small,
.dashboard-card .card-label {
  color: #667085;
}

.dashboard-card-head {
  color: #141c2d;
}

.dashboard-main-value {
  color: #111827;
}


/* MAGGIORE SEPARAZIONE FRA CARD */

.dashboard-grid {
  gap: 22px;
}

.dashboard-card {
  box-shadow:
    0 14px 34px rgba(25, 36, 63, .11),
    0 2px 7px rgba(25, 36, 63, .05);
}


/* MOBILE */

@media(max-width:800px) {

  body {
    background:
      linear-gradient(
        180deg,
        #e7edf5,
        #e1e8f1
      );
  }

  .dashboard-card {
    box-shadow:
      0 10px 24px rgba(25,36,63,.11);
  }

}


/* =========================================================
   MR4 NEON MODE
   ========================================================= */

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(72,61,255,.20), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255,0,153,.13), transparent 24%),
    radial-gradient(circle at 60% 85%, rgba(0,224,255,.10), transparent 28%),
    linear-gradient(180deg,#0b1020 0%,#111827 55%,#0f172a 100%) !important;

  color: #eef2ff !important;
}

.content {
  background: transparent !important;
}

.topbar h1,
.userbox strong {
  color: #f8fafc !important;
}

.userbox .muted,
.muted {
  color: #aeb8cc !important;
}


/* HERO */

.dashboard-hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.10), transparent 24%),
    linear-gradient(135deg,#151a35 0%,#281f5e 50%,#4d1d7f 100%) !important;

  border: 1px solid rgba(142,110,255,.45) !important;

  box-shadow:
    0 0 0 1px rgba(142,110,255,.12),
    0 0 35px rgba(110,76,255,.22),
    0 20px 60px rgba(0,0,0,.30) !important;
}

.dashboard-hero h2,
.dashboard-hero p,
.eyebrow {
  color: #f7f7ff !important;
}

.hero-apartment {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(179,158,255,.35) !important;
  box-shadow:
    inset 0 0 20px rgba(139,92,246,.08);
}


/* SEZIONE AVVISI */

.dashboard-section {
  background: rgba(15,23,42,.74) !important;
  border: 1px solid rgba(104,120,180,.22) !important;
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 50px rgba(0,0,0,.22) !important;
}

.section-heading h2 {
  color: #f8fafc !important;
}

.section-kicker {
  color: #9f8cff !important;
}


/* AVVISI NEON */

.notice-color-0 {
  background:
    linear-gradient(145deg,rgba(54,72,180,.92),rgba(39,51,120,.88)) !important;
  color: #eef2ff !important;
  border: 1px solid rgba(111,129,255,.68) !important;
  box-shadow: 0 0 22px rgba(78,99,255,.20) !important;
}

.notice-color-1 {
  background:
    linear-gradient(145deg,rgba(15,112,84,.92),rgba(12,75,61,.88)) !important;
  color: #ecfff8 !important;
  border: 1px solid rgba(34,211,153,.55) !important;
  box-shadow: 0 0 22px rgba(16,185,129,.18) !important;
}

.notice-color-2 {
  background:
    linear-gradient(145deg,rgba(154,98,17,.94),rgba(102,63,11,.90)) !important;
  color: #fff7e8 !important;
  border: 1px solid rgba(255,184,77,.65) !important;
  box-shadow: 0 0 22px rgba(245,158,11,.18) !important;
}

.notice-color-3 {
  background:
    linear-gradient(145deg,rgba(135,37,87,.93),rgba(87,26,61,.90)) !important;
  color: #fff0f7 !important;
  border: 1px solid rgba(244,114,182,.60) !important;
  box-shadow: 0 0 22px rgba(236,72,153,.18) !important;
}

.notice-color-4 {
  background:
    linear-gradient(145deg,rgba(17,111,125,.93),rgba(14,75,85,.90)) !important;
  color: #edfeff !important;
  border: 1px solid rgba(34,211,238,.60) !important;
  box-shadow: 0 0 22px rgba(6,182,212,.18) !important;
}

.dashboard-notice-date,
.dashboard-notice-author {
  color: rgba(255,255,255,.72) !important;
}


/* CARD GENERALI */

.dashboard-card,
.calendar-dashboard-card {
  background: rgba(17,24,39,.82) !important;
  color: #f8fafc !important;
  backdrop-filter: blur(18px);

  border: 1px solid rgba(120,135,180,.20) !important;

  box-shadow:
    0 18px 50px rgba(0,0,0,.24) !important;
}

.dashboard-card-head {
  color: #f8fafc !important;
}

.dashboard-card .card-label,
.dashboard-card small,
.dashboard-card .muted {
  color: #aab4c9 !important;
}

.dashboard-main-value,
.dashboard-detail strong,
.softener-info strong {
  color: #ffffff !important;
}


/* AUTOBOTTE - NEON BLUE */

.water-card {
  background:
    linear-gradient(145deg,rgba(18,35,70,.95),rgba(12,27,54,.92)) !important;

  border: 1px solid rgba(59,130,246,.55) !important;

  box-shadow:
    0 0 24px rgba(59,130,246,.16),
    0 18px 50px rgba(0,0,0,.24) !important;
}

.water-card .dashboard-card-icon {
  background: rgba(59,130,246,.18) !important;
  color: #7db2ff !important;
  border: 1px solid rgba(96,165,250,.45);
}

.water-card .card-link {
  color: #9cc5ff !important;
  background: rgba(59,130,246,.10) !important;
  border: 1px solid rgba(96,165,250,.32) !important;
}


/* ADDOLCITORE - NEON AMBER */

.softener-card {
  background:
    linear-gradient(145deg,rgba(67,43,13,.95),rgba(44,30,12,.92)) !important;

  border: 1px solid rgba(245,158,11,.55) !important;

  box-shadow:
    0 0 24px rgba(245,158,11,.14),
    0 18px 50px rgba(0,0,0,.24) !important;
}

.softener-card .dashboard-card-icon {
  background: rgba(245,158,11,.16) !important;
  color: #ffbf55 !important;
  border: 1px solid rgba(251,191,36,.40);
}

.softener-card .softener-info > div,
.softener-card .days-counter {
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(245,158,11,.17) !important;
}

.softener-card .card-link {
  color: #ffd27c !important;
  background: rgba(245,158,11,.08) !important;
  border: 1px solid rgba(245,158,11,.28) !important;
}

.days-value {
  color: #8b7cff !important;
}

.days-value.warning {
  color: #ffb53f !important;
}

.days-value.danger {
  color: #ff5e7a !important;
}

.progress-track {
  background: rgba(255,255,255,.09) !important;
}

.progress-bar {
  background:
    linear-gradient(90deg,#ff9f1c,#ffd166) !important;
  box-shadow:
    0 0 14px rgba(255,179,49,.35);
}


/* DOCUMENTI - NEON VIOLET */

.dashboard-grid .dashboard-card:nth-child(3) {
  background:
    linear-gradient(145deg,rgba(47,31,86,.95),rgba(32,24,62,.92)) !important;

  border: 1px solid rgba(139,92,246,.55) !important;

  box-shadow:
    0 0 24px rgba(139,92,246,.16),
    0 18px 50px rgba(0,0,0,.24) !important;
}

.dashboard-grid .dashboard-card:nth-child(3) .dashboard-card-icon {
  background: rgba(139,92,246,.17) !important;
  color: #b69aff !important;
  border: 1px solid rgba(167,139,250,.38);
}

.dashboard-grid .dashboard-card:nth-child(3) .card-link {
  color: #c5b2ff !important;
  background: rgba(139,92,246,.08) !important;
  border: 1px solid rgba(139,92,246,.28) !important;
}


/* RACCOLTA - NEON GREEN */

.dashboard-grid .dashboard-card:nth-child(4) {
  background:
    linear-gradient(145deg,rgba(18,70,53,.95),rgba(12,47,37,.92)) !important;

  border: 1px solid rgba(34,197,94,.50) !important;

  box-shadow:
    0 0 24px rgba(34,197,94,.14),
    0 18px 50px rgba(0,0,0,.24) !important;
}

.dashboard-grid .dashboard-card:nth-child(4) .dashboard-card-icon {
  background: rgba(34,197,94,.16) !important;
  color: #79e5a4 !important;
  border: 1px solid rgba(74,222,128,.36);
}

.dashboard-grid .dashboard-card:nth-child(4) .card-link {
  color: #92efb4 !important;
  background: rgba(34,197,94,.08) !important;
  border: 1px solid rgba(34,197,94,.26) !important;
}


/* CALENDARIO - NEON PINK */

.calendar-dashboard-card {
  background:
    linear-gradient(145deg,rgba(74,28,55,.95),rgba(48,20,38,.92)) !important;

  border: 1px solid rgba(236,72,153,.45) !important;

  box-shadow:
    0 0 24px rgba(236,72,153,.13),
    0 18px 50px rgba(0,0,0,.24) !important;
}

.calendar-dashboard-card .icon {
  background: rgba(236,72,153,.14) !important;
  color: #ff92c8 !important;
}

.calendar-dashboard-card .btn-light {
  color: #ffb1d5 !important;
  background: rgba(236,72,153,.08) !important;
  border: 1px solid rgba(236,72,153,.25) !important;
}


/* EVENTI */

.event-mini-card {
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  color: #f3f4f6 !important;
}

.event-date-box {
  background: rgba(139,92,246,.15) !important;
  color: #c4b5fd !important;
}


/* FORM E PAGINE INTERNE */

.card {
  background: rgba(17,24,39,.86) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(120,135,180,.18) !important;
  backdrop-filter: blur(16px);
}

.card h2,
.card h3,
.card strong {
  color: #ffffff;
}

input,
textarea,
select {
  background: rgba(15,23,42,.90) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(120,135,180,.30) !important;
}

input::placeholder,
textarea::placeholder {
  color: #7d8799 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #8b7cff !important;
  box-shadow:
    0 0 0 4px rgba(139,124,255,.12),
    0 0 16px rgba(139,124,255,.12) !important;
}


/* DOCUMENT ITEMS */

.document-item {
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.06);
}


/* SIDEBAR */

.sidebar {
  background:
    linear-gradient(180deg,#080d1a 0%,#0d1323 100%) !important;
  box-shadow:
    10px 0 35px rgba(0,0,0,.20);
}

.nav a:hover {
  background: rgba(139,92,246,.10) !important;
  box-shadow:
    inset 0 0 0 1px rgba(139,92,246,.18);
}


/* BUTTONS */

.btn {
  background:
    linear-gradient(135deg,#6d5dfc,#8b5cf6) !important;

  box-shadow:
    0 0 18px rgba(109,93,252,.24) !important;
}

.btn-light {
  background: rgba(255,255,255,.06) !important;
  color: #c4b5fd !important;
  border: 1px solid rgba(167,139,250,.20) !important;
}


/* MOBILE */

@media(max-width:800px) {

  body {
    background:
      linear-gradient(180deg,#0c1220,#111827) !important;
  }

  .dashboard-card,
  .calendar-dashboard-card {
    box-shadow:
      0 12px 30px rgba(0,0,0,.28) !important;
  }

}



/* =========================================================
   NOTIFICHE EMAIL - NEON UI
   ========================================================= */

.notification-master-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(59,42,120,.90),
      rgba(30,35,75,.94)
    );

  border:
    1px solid rgba(139,92,246,.45);

  box-shadow:
    0 0 25px rgba(139,92,246,.14),
    0 18px 45px rgba(0,0,0,.22);

  border-radius: 24px;

  padding: 22px 25px;

  margin-bottom: 20px;
}

.notification-master-card > div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-master-card h3 {
  margin: 0 0 4px;
}

.notification-master-card p {
  margin: 0;
  color: #afb9cf;
}

.notification-icon-big {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  background:
    rgba(139,92,246,.17);

  border:
    1px solid rgba(167,139,250,.30);

  font-size: 23px;
}


.notification-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(330px,1fr)
    );

  gap: 14px;
}


.notification-setting {
  min-height: 105px;

  display: flex;

  align-items: center;

  gap: 14px;

  padding: 17px;

  border-radius: 19px;

  background:
    rgba(17,24,39,.88);

  border:
    1px solid rgba(120,135,180,.18);

  box-shadow:
    0 12px 30px rgba(0,0,0,.18);
}


.notification-setting-icon {
  width: 44px;
  height: 44px;

  flex: 0 0 44px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  font-size: 20px;
}


.notification-setting-icon.blue {
  background: rgba(59,130,246,.15);
  color: #7db2ff;
}

.notification-setting-icon.violet {
  background: rgba(139,92,246,.15);
  color: #b69aff;
}

.notification-setting-icon.amber {
  background: rgba(245,158,11,.15);
  color: #ffc863;
}

.notification-setting-icon.purple {
  background: rgba(168,85,247,.15);
  color: #d09cff;
}

.notification-setting-icon.green {
  background: rgba(34,197,94,.15);
  color: #79e5a4;
}

.notification-setting-icon.cyan {
  background: rgba(6,182,212,.15);
  color: #78e8f6;
}

.notification-setting-icon.pink {
  background: rgba(236,72,153,.15);
  color: #ff92c8;
}


.notification-setting-info {
  flex: 1;
}

.notification-setting-info strong {
  display: block;

  color: #f8fafc;

  margin-bottom: 5px;
}

.notification-setting-info span {
  color: #98a4ba;

  font-size: 12px;

  line-height: 1.4;
}


/* SWITCH */

.neon-switch {
  position: relative;

  width: 54px;
  height: 29px;

  flex: 0 0 54px;

  margin: 0;

  cursor: pointer;
}

.neon-switch input {
  position: absolute;

  opacity: 0;

  width: 0;
  height: 0;
}

.neon-slider {
  position: absolute;

  inset: 0;

  border-radius: 40px;

  background: #293144;

  border:
    1px solid #475066;

  transition: .22s ease;

  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.35);
}

.neon-slider::before {
  content: "";

  position: absolute;

  width: 21px;
  height: 21px;

  left: 3px;
  top: 3px;

  border-radius: 50%;

  background: #8c96a8;

  transition: .22s ease;

  box-shadow:
    0 2px 8px rgba(0,0,0,.35);
}


.neon-switch input:checked
+ .neon-slider {

  background:
    linear-gradient(
      90deg,
      #614cf6,
      #9b5cff
    );

  border-color:
    #a488ff;

  box-shadow:
    0 0 14px rgba(139,92,246,.55),
    inset 0 0 8px rgba(255,255,255,.12);
}


.neon-switch input:checked
+ .neon-slider::before {

  transform:
    translateX(25px);

  background: #ffffff;

  box-shadow:
    0 0 12px rgba(255,255,255,.75);
}


.notification-save {
  margin-top: 22px;

  display: flex;

  justify-content: flex-end;
}


@media(max-width:700px) {

  .notification-grid {
    grid-template-columns: 1fr;
  }

  .notification-master-card {
    padding: 18px;
  }

  .notification-master-card p {
    font-size: 12px;
  }

  .notification-setting {
    min-height: 95px;
  }

}


/* MASTER NOTIFICHE DISABILITATO */

.notification-disabled {
  opacity: .42;
  filter: grayscale(.55);
  transition:
    opacity .2s ease,
    filter .2s ease;
}

.notification-disabled .neon-switch {
  cursor: not-allowed;
}

.notification-disabled .neon-slider {
  box-shadow: none !important;
}

.notification-disabled
.neon-switch input:checked
+ .neon-slider {
  background: #353c4b !important;
  border-color: #4b5563 !important;
  box-shadow: none !important;
}

.notification-disabled
.neon-switch input:checked
+ .neon-slider::before {
  background: #8b95a7 !important;
  box-shadow: none !important;
}



/* =========================================================
   MR4 NEON - AVVISI E GESTIONE RECORD ADMIN
   ========================================================= */

/* AVVISI */

.notice-panel {
  background:
    linear-gradient(
      145deg,
      rgba(25,31,53,.96),
      rgba(17,23,41,.96)
    ) !important;

  color: #eef2ff !important;

  border:
    1px solid rgba(116,99,255,.30) !important;

  border-radius: 20px !important;

  padding: 20px !important;

  box-shadow:
    0 0 22px rgba(111,76,255,.08),
    0 14px 35px rgba(0,0,0,.20) !important;
}

.notice-panel h3 {
  color: #ffffff !important;
}

.notice-meta {
  color: #9caac5 !important;
}

.notice-panel-body {
  color: #dbe3f5 !important;

  background:
    rgba(255,255,255,.025) !important;

  border:
    1px solid rgba(255,255,255,.055);

  border-radius: 14px;

  padding: 15px;

  margin-top: 15px;
}

.notice-badge {
  background:
    rgba(109,93,252,.15) !important;

  color: #b9adff !important;

  border:
    1px solid rgba(139,124,255,.28) !important;
}


/* GESTIONE AVVISO */

.admin-notice-tools {
  margin-top: 18px;

  padding-top: 15px;

  border-top:
    1px solid rgba(139,124,255,.15) !important;
}

.admin-notice-tools summary {
  color: #a99aff !important;

  cursor: pointer;

  font-weight: 700;

  list-style: none;
}

.admin-notice-tools summary:hover {
  color: #d2caff !important;
}

.admin-notice-tools form {
  margin-top: 16px;
}

.admin-notice-tools input,
.admin-notice-tools textarea {
  background:
    rgba(10,15,29,.88) !important;

  color: #f8fafc !important;

  border:
    1px solid rgba(126,139,180,.27) !important;
}


/* RECORD AUTOBOTTE / ADDOLCITORE */

.admin-record-item {
  display: block !important;

  background:
    linear-gradient(
      145deg,
      rgba(22,29,48,.92),
      rgba(15,21,37,.94)
    ) !important;

  border:
    1px solid rgba(116,130,170,.17) !important;

  border-radius: 18px !important;

  padding: 18px !important;

  margin-bottom: 13px;

  color: #eef2ff;
}

.record-main {
  width: 100%;
}

.record-value {
  color: #ffffff !important;

  font-size: 18px;
}

.record-admin-tools {
  margin-top: 16px;

  padding-top: 14px;

  border-top:
    1px solid rgba(139,92,246,.17);
}

.record-admin-tools summary {
  cursor: pointer;

  color: #a995ff;

  font-weight: 700;
}

.record-admin-tools summary:hover {
  color: #d1c7ff;
}

.record-edit-form {
  margin-top: 17px;
}

.admin-action-row {
  display: flex;
  gap: 10px;
}


/* DELETE */

.btn-danger {
  background:
    linear-gradient(
      135deg,
      #a62f52,
      #d83c68
    ) !important;

  color: #fff !important;

  border:
    1px solid rgba(255,100,140,.30) !important;

  box-shadow:
    0 0 15px rgba(220,50,95,.18) !important;
}


/* SETTING GIORNI */

.softener-admin-setting {
  border:
    1px solid rgba(245,158,11,.25) !important;

  box-shadow:
    0 0 25px rgba(245,158,11,.07) !important;
}

.days-setting-row {
  display: flex;

  align-items: center;

  gap: 12px;

  max-width: 260px;
}

.days-setting-row input {
  width: 130px;
}

.days-setting-row span {
  color: #aeb8cc;

  font-weight: 600;
}


@media(max-width:700px) {

  .notice-panel {
    padding: 15px !important;
  }

  .admin-record-item {
    padding: 15px !important;
  }

}


/* =========================================================
   ADDOLCITORE - IMPOSTAZIONE ADMIN INLINE
   ========================================================= */

.softener-inline-admin {
  margin-top: 22px;

  padding: 17px;

  border-radius: 17px;

  background:
    linear-gradient(
      135deg,
      rgba(245,158,11,.09),
      rgba(139,92,246,.08)
    );

  border:
    1px solid rgba(245,158,11,.22);

  box-shadow:
    0 0 20px rgba(245,158,11,.06);
}

.softener-inline-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 14px;
}

.softener-inline-admin-head strong {
  display: block;

  color: #ffd078 !important;

  margin-bottom: 4px;
}

.softener-inline-admin-head span {
  display: block;

  color: #9caac3;

  font-size: 12px;
}

.softener-inline-form {
  display: flex;

  align-items: center;

  gap: 12px;

  flex-wrap: wrap;
}

.softener-days-input {
  display: flex;

  align-items: center;

  gap: 9px;
}

.softener-days-input input {
  width: 110px !important;

  margin: 0 !important;

  text-align: center;

  font-size: 18px;

  font-weight: 800;
}

.softener-days-input span {
  color: #b4bdd0;

  font-weight: 700;
}

@media(max-width:600px) {

  .softener-inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .softener-days-input input {
    width: 120px !important;
  }

}


/* LOGO MR4 CLICCABILE */

.logo-home-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: 15px;
}

.logo-home-link .logo {
  transition:
    transform .18s ease,
    filter .18s ease;
}

.logo-home-link:hover .logo {
  transform: translateX(2px);
  filter: brightness(1.15);
}


/* LOGO MR4 CLICCABILE */

.logo-home-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: 15px;
}

.logo-home-link .logo {
  transition:
    transform .18s ease,
    filter .18s ease;
}

.logo-home-link:hover .logo {
  transform: translateX(2px);
  filter: brightness(1.15);
}


/* =========================================================
   FOOTER MR4
   ========================================================= */

.mr4-footer {
  width: 100%;
  margin-top: 40px;
  padding: 22px 10px 12px;

  text-align: center;

  color: #aeb7cb !important;

  font-size: 12px;
  font-weight: 500;
  letter-spacing: .25px;

  border-top:
    1px solid rgba(139,92,246,.22);

  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(139,92,246,.025)
    );
}

.mr4-footer::before {
  content: "";

  display: block;

  width: 46px;
  height: 2px;

  margin: 0 auto 14px;

  border-radius: 10px;

  background:
    linear-gradient(
      90deg,
      #6d5dfc,
      #a855f7,
      #ec4899
    );

  box-shadow:
    0 0 12px rgba(139,92,246,.65);
}

@media(max-width:600px) {

  .mr4-footer {
    margin-top: 28px;
    padding: 18px 8px 10px;

    font-size: 10px;
    line-height: 1.6;
  }

}


/* =========================================================
   MR4 MOBILE RESPONSIVE
   ========================================================= */

.mobile-menu-button {
  display: none;
}

/* Tablet e smartphone */
@media (max-width: 850px) {

  html,
  body {
    overflow-x: hidden;
  }

  body {
    min-width: 0 !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;

    width: 280px !important;
    max-width: 86vw;

    height: 100vh;

    z-index: 2000;

    transform: translateX(-105%);
    transition: transform .25s ease;

    overflow-y: auto;

    box-shadow:
      20px 0 45px rgba(0,0,0,.35);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;

    z-index: 1900;

    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
  }

  .main,
  main,
  .content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  .content {
    padding: 14px !important;
  }

  .topbar {
    display: flex !important;
    align-items: center;
    gap: 10px;

    margin-bottom: 18px !important;
  }

  .mobile-menu-button {
    display: grid;

    place-items: center;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    border: 1px solid rgba(139,92,246,.28);
    border-radius: 13px;

    background:
      linear-gradient(
        135deg,
        rgba(109,93,252,.18),
        rgba(139,92,246,.14)
      );

    color: #d6d0ff;

    font-size: 23px;
    line-height: 1;

    cursor: pointer;

    box-shadow:
      0 0 16px rgba(109,93,252,.16);
  }

  .topbar h1 {
    font-size: 22px !important;
    line-height: 1.2;
    margin: 0;
  }

  .userbox {
    margin-left: auto;
    min-width: 0;
  }

  .userbox strong,
  .userbox span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-hero {
    flex-direction: column !important;
    align-items: flex-start !important;

    padding: 20px !important;
    border-radius: 20px !important;
  }

  .dashboard-hero h2 {
    font-size: 24px !important;
  }

  .hero-apartment {
    width: 100%;
    text-align: left;
  }

  .dashboard-grid,
  .settings-grid,
  .account-layout,
  .grid,
  .form-grid,
  .users-grid,
  .notification-grid,
  .event-grid,
  .dashboard-notices {
    grid-template-columns: 1fr !important;
  }

  .dashboard-card,
  .card,
  .dashboard-section,
  .calendar-dashboard-card,
  .notice-panel,
  .notification-setting,
  .notification-master-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .dashboard-card,
  .card {
    padding: 16px !important;
  }

  .dashboard-main-value {
    font-size: 27px !important;
  }

  .document-item,
  .user-card,
  .backup-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .attachment-actions,
  .registration-actions,
  .admin-action-row,
  .notification-save {
    width: 100%;
  }

  .attachment-actions .btn,
  .registration-actions .btn,
  .admin-action-row .btn,
  .notification-save .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  form {
    width: 100%;
  }

  input,
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  textarea {
    min-height: 110px;
  }

  .btn {
    min-height: 44px;
  }

  .responsive-table,
  table {
    max-width: 100%;
  }

  .responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 700px;
  }

  .notice-panel-header {
    flex-direction: column !important;
  }

  .notification-master-card {
    align-items: flex-start !important;
  }

  .notification-master-card > div {
    min-width: 0;
  }

  .notification-setting {
    align-items: center;
  }

  .notification-setting-info {
    min-width: 0;
  }

  .notification-setting-info span {
    display: block;
  }

  .softener-inline-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .softener-days-input {
    width: 100%;
  }

  .softener-days-input input {
    width: 120px !important;
  }

  .record-edit-form .form-grid {
    grid-template-columns: 1fr !important;
  }

  .mr4-footer {
    font-size: 10px !important;
    line-height: 1.5;
    padding-left: 6px;
    padding-right: 6px;
  }

}

/* Telefoni piccoli */
@media (max-width: 520px) {

  .content {
    padding: 10px !important;
  }

  .topbar h1 {
    font-size: 19px !important;
  }

  .dashboard-hero {
    padding: 16px !important;
  }

  .dashboard-hero h2 {
    font-size: 21px !important;
  }

  .dashboard-card,
  .card {
    border-radius: 17px !important;
  }

  .dashboard-section {
    padding: 12px !important;
    border-radius: 17px !important;
  }

  .dashboard-notice {
    padding: 15px !important;
  }

  .notification-setting {
    padding: 14px !important;
  }

  .notification-setting-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .neon-switch {
    width: 50px;
    flex-basis: 50px;
  }

  .userbox {
    font-size: 11px;
  }

}

/* =========================================================
   FIX MENU MOBILE - LINK IN VERTICALE
   ========================================================= */

@media (max-width: 850px) {

  .sidebar .nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .sidebar .nav a {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;

    align-items: center !important;
    justify-content: flex-start !important;

    padding: 12px 14px !important;
    margin: 0 !important;

    white-space: normal !important;
  }

  .sidebar .nav-separator {
    width: 100% !important;
    margin: 10px 0 !important;
  }

}

/* =========================================================
   CALENDARIO ICS
   ========================================================= */

.calendar-mail-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;

  gap: 12px;

  padding: 15px;

  border:
    1px solid rgba(139,92,246,.20);

  border-radius: 14px;

  background:
    rgba(109,93,252,.06);
}

.calendar-mail-option input {
  width: auto !important;
  margin-top: 4px;
}

.calendar-mail-option strong {
  display: block;
  margin-bottom: 4px;
}

.calendar-mail-option span {
  display: block;
  font-size: 12px;
}

.calendar-event-card {
  margin-bottom: 14px;
}

.calendar-event-title {
  font-size: 18px;
}

.calendar-event-date {
  font-weight: 700;
}

.calendar-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 15px;
}

.calendar-event-actions form {
  margin: 0;
}

@media(max-width:850px) {

  .calendar-event-actions {
    flex-direction: column;
  }

  .calendar-event-actions .btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .calendar-event-actions form,
  .calendar-event-actions form button {
    width: 100%;
  }

}

