/* ==========================================================================
   PVIP Citizen Module — Frontend Styles
   Design: Google Material-inspired — allineato al resto del plugin PVIP
   ========================================================================== */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --pvip-c-blue:        #1a73e8;
  --pvip-c-blue-hover:  #1557b0;
  --pvip-c-teal:        #0d9488;
  --pvip-c-teal-hover:  #0f766e;
  --pvip-c-text:        #202124;
  --pvip-c-text-light:  #5f6368;
  --pvip-c-border:      #e8eaed;
  --pvip-c-bg:          #f8f9fa;
  --pvip-c-white:       #ffffff;
  --pvip-c-danger:      #d93025;
  --pvip-c-success:     #137333;
  --pvip-c-warn:        #e37400;
  --pvip-c-info:        #1a73e8;
  --pvip-c-r:           8px;
  --pvip-c-shadow:      0 1px 3px rgba(60,64,67,.12), 0 2px 6px rgba(60,64,67,.08);
  --pvip-c-shadow-lg:   0 2px 10px rgba(60,64,67,.15), 0 6px 20px rgba(60,64,67,.1);
  --pvip-c-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

/* ── Reset scoped ────────────────────────────────────────────────────── */
.pvip-citizen-wrap *,
.pvip-citizen-wrap *::before,
.pvip-citizen-wrap *::after {
  box-sizing: border-box;
}
.pvip-citizen-wrap {
  font-family: var(--pvip-c-font);
  color: var(--pvip-c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH CARDS — login / registrazione / verifica email
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--pvip-c-bg);
  /* Sfonda il contenitore del tema per occupare tutta la larghezza della viewport */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  box-sizing: border-box;
}

.pvip-auth-card {
  background: var(--pvip-c-white);
  border-radius: 16px;
  box-shadow: var(--pvip-c-shadow-lg);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  border: 1px solid var(--pvip-c-border);
}

/* Header card — logo + titolo */
.pvip-auth-header {
  padding: 32px 40px 24px;
  text-align: center;
  border-bottom: 1px solid var(--pvip-c-border);
}

.pvip-auth-header h1 {
  font-size: 1.4rem !important;
  font-weight: 600 !important;
  color: var(--pvip-c-text) !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

.pvip-auth-header p {
  color: var(--pvip-c-text-light);
  font-size: .9rem;
  margin: 8px 0 0;
}

.pvip-auth-body {
  padding: 32px 40px 36px;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-form-group {
  margin-bottom: 20px;
}

.pvip-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pvip-form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--pvip-c-text);
  margin-bottom: 6px;
}

.pvip-form-group input:not([type="checkbox"]):not([type="radio"]),
.pvip-form-group select,
.pvip-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--pvip-c-border);
  border-radius: var(--pvip-c-r);
  font-family: var(--pvip-c-font);
  font-size: .9375rem;
  color: var(--pvip-c-text);
  background: var(--pvip-c-white);
  transition: border-color .18s, box-shadow .18s;
  outline: none;
  -webkit-appearance: none;
}

/* Placeholder più chiaro per non sembrare già compilato */
.pvip-citizen-wrap input::placeholder,
.pvip-citizen-wrap textarea::placeholder {
  color: #c0c4cc;
  font-weight: 400;
  opacity: 1;
}
.pvip-citizen-wrap input::-webkit-input-placeholder,
.pvip-citizen-wrap textarea::-webkit-input-placeholder { color: #c0c4cc; }
.pvip-citizen-wrap input::-moz-placeholder,
.pvip-citizen-wrap textarea::-moz-placeholder { color: #c0c4cc; opacity: 1; }

.pvip-form-group input:not([type="checkbox"]):not([type="radio"]):hover,
.pvip-form-group select:hover,
.pvip-form-group textarea:hover {
  border-color: #bdc1c6;
}

.pvip-form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.pvip-form-group select:focus,
.pvip-form-group textarea:focus {
  border-color: var(--pvip-c-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.pvip-form-group input.pvip-error,
.pvip-form-group select.pvip-error,
.pvip-form-group textarea.pvip-error {
  border-color: var(--pvip-c-danger);
  box-shadow: 0 0 0 3px rgba(217,48,37,.1);
}

/* ── Password con occhio ─────────────────────────────────────────────── */
.pvip-input-eye {
  position: relative;
}
.pvip-input-eye input {
  padding-right: 44px;
}
.pvip-eye-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pvip-c-text-light);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.pvip-eye-toggle:hover { color: var(--pvip-c-text); }

.pvip-field-error {
  font-size: .8rem;
  color: var(--pvip-c-danger);
  margin-top: 5px;
  display: none;
}
.pvip-field-hint {
  display: block;
  font-size: .75rem;
  color: var(--pvip-c-text-light);
  margin-top: 4px;
}
/* Campo Dove? evidenziato quando si tenta di cercare senza selezione */
#pvip-imm-comune.pvip-field-error {
  display: block !important;
  border-color: var(--pvip-c-danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
  transition: border-color .2s, box-shadow .2s;
}

.pvip-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.pvip-hint {
  font-size: .8rem;
  color: var(--pvip-c-text-light);
  margin-top: 4px;
}

/* ── OTP ─────────────────────────────────────────────────────────────── */
.pvip-otp-input {
  text-align: center !important;
  font-size: 2.2rem !important;
  letter-spacing: .5em !important;
  font-family: 'Roboto Mono', 'Courier New', monospace !important;
  font-weight: 700 !important;
  padding: 16px !important;
  border-color: var(--pvip-c-blue) !important;
}

.pvip-otp-box {
  background: #e8f0fe;
  border: 1.5px solid #c5d8fb;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  margin: 24px 0;
}

.pvip-otp-box .pvip-otp-desc {
  font-size: .875rem;
  color: var(--pvip-c-text-light);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--pvip-c-r);
  font-family: var(--pvip-c-font);
  font-size: .9375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s, box-shadow .18s;
  white-space: nowrap;
  letter-spacing: .01em;
}

.pvip-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Primary — teal come le action card del plugin */
.pvip-btn-primary {
  background: var(--pvip-c-teal);
  color: var(--pvip-c-white);
  width: 100%;
  padding: 12px 24px;
}
.pvip-btn-primary:hover:not(:disabled) {
  background: var(--pvip-c-teal-hover);
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
}

/* Secondary */
.pvip-btn-secondary {
  background: var(--pvip-c-white);
  color: var(--pvip-c-text);
  border: 1.5px solid var(--pvip-c-border);
}
.pvip-btn-secondary:hover:not(:disabled) {
  background: var(--pvip-c-bg);
  border-color: #bdc1c6;
}

/* Blue — per azioni link */
.pvip-btn-blue {
  background: var(--pvip-c-blue);
  color: var(--pvip-c-white);
}
.pvip-btn-blue:hover:not(:disabled) {
  background: var(--pvip-c-blue-hover);
  box-shadow: 0 2px 8px rgba(26,115,232,.3);
}

.pvip-btn-danger {
  background: var(--pvip-c-danger);
  color: var(--pvip-c-white);
}
.pvip-btn-danger:hover:not(:disabled) {
  background: #c5221f;
}

.pvip-btn-sm {
  padding: 6px 16px;
  font-size: .8125rem;
}

.pvip-btn-icon {
  padding: 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--pvip-c-text-light);
  transition: color .15s, background .15s;
}
.pvip-btn-icon:hover {
  color: var(--pvip-c-text);
  background: var(--pvip-c-bg);
}

/* Loading spinner */
.pvip-btn .pvip-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pvip-spin .6s linear infinite;
}
.pvip-btn.pvip-loading .pvip-spinner { display: block; }
.pvip-btn.pvip-loading .pvip-btn-text { opacity: .5; }
@keyframes pvip-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-alert {
  padding: 14px 16px;
  border-radius: var(--pvip-c-r);
  font-size: .9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.pvip-alert-error             { background: #fce8e6; color: #c5221f; border-color: #f5c6c3; }
.pvip-alert-success           { background: #e6f4ea; color: #137333; border-color: #b7dfbf; }
.pvip-alert-info              { background: #e8f0fe; color: #1a73e8; border-color: #c5d8fb; }
.pvip-alert-warn,
.pvip-alert-warning           { background: #fef7e0; color: #b45309; border-color: #fcd34d; }

.pvip-form-messages { min-height: 20px; }

/* ── Search hint (immobili tab) ─────────────────────────────────────────── */
.pvip-imm-warn {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.pvip-search-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdfa;
  border: 1px solid #5eead4;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: .875rem;
  color: var(--pvip-c-text-light);
  font-family: var(--pvip-c-font);
  line-height: 1.5;
}
.pvip-search-hint strong {
  color: var(--pvip-c-text);
  font-weight: 600;
}

/* ── Auth footer links ───────────────────────────────────────────────── */
.pvip-auth-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--pvip-c-border);
  margin-top: 24px;
  font-size: .875rem;
  color: var(--pvip-c-text-light);
}
.pvip-auth-footer a {
  color: var(--pvip-c-blue);
  font-weight: 500;
  text-decoration: none;
}
.pvip-auth-footer a:hover { text-decoration: underline; }

.pvip-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .875rem;
  color: var(--pvip-c-text-light);
}
.pvip-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--pvip-c-teal);
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-dashboard {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header dashboard — bianco con bordo, non navy */
.pvip-dash-header {
  background: var(--pvip-c-white);
  border-bottom: 1px solid var(--pvip-c-border);
  padding: 18px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--pvip-c-shadow);
  border-radius: 0 0 14px 14px;
}
.pvip-dash-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* Avatar con iniziali */
.pvip-dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pvip-c-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.pvip-dash-identity { display: flex; flex-direction: column; gap: 1px; }
.pvip-dash-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pvip-c-text-light);
  line-height: 1;
}
.pvip-dash-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pvip-c-text);
  line-height: 1.3;
}
.pvip-dash-email {
  font-size: .78rem;
  color: var(--pvip-c-text-light);
  line-height: 1;
}
/* Badge notifiche nuove risposte */
.pvip-dash-unread-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid #fde68a;
}

/* ── Stats Cards ─────────────────────────────────────────────────────── */
.pvip-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.pvip-stat-card {
  background: var(--pvip-c-white);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--pvip-c-shadow);
  border: 1px solid var(--pvip-c-border);
  border-top: 3px solid var(--pvip-c-border);
  transition: box-shadow .15s;
}
.pvip-stat-card:hover { box-shadow: var(--pvip-c-shadow-lg); }
.pvip-stat-card.pvip-stat-primary { border-top-color: var(--pvip-c-blue); }
.pvip-stat-card.pvip-stat-success { border-top-color: var(--pvip-c-success); }
.pvip-stat-card.pvip-stat-warn    { border-top-color: var(--pvip-c-warn); }
.pvip-stat-card.pvip-stat-neutral { border-top-color: var(--pvip-c-text-light); }

.pvip-stat-card .pvip-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--pvip-c-text);
  line-height: 1;
  margin-bottom: 4px;
}
.pvip-stat-card .pvip-stat-label {
  font-size: .78rem;
  color: var(--pvip-c-text-light);
  font-weight: 500;
}

/* ── Navigation Tabs ─────────────────────────────────────────────────── */
.pvip-nav {
  display: flex;
  gap: 2px;
  background: var(--pvip-c-white);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--pvip-c-shadow);
  border: 1px solid var(--pvip-c-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.pvip-nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--pvip-c-text-light);
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.pvip-nav-item:hover {
  color: var(--pvip-c-text);
  background: var(--pvip-c-bg);
}
.pvip-nav-item.pvip-active {
  background: #e8f0fe;
  color: var(--pvip-c-blue);
  font-weight: 600;
}
.pvip-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Logout button — header ──────────────────────────────────────────── */
.pvip-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--pvip-c-text-light);
  text-decoration: none;
  border: 1.5px solid var(--pvip-c-border);
  background: var(--pvip-c-white);
  transition: all .15s;
  white-space: nowrap;
}
.pvip-btn-logout:hover {
  color: var(--pvip-c-danger);
  border-color: var(--pvip-c-danger);
  background: #fce8e6;
}

/* ── Logout button — profilo ─────────────────────────────────────────── */
.pvip-btn-logout-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--pvip-c-text-light);
  text-decoration: none;
  border: 1.5px solid var(--pvip-c-border);
  background: var(--pvip-c-white);
  transition: all .15s;
  width: 100%;
  justify-content: center;
}
.pvip-btn-logout-profile:hover {
  color: var(--pvip-c-danger);
  border-color: var(--pvip-c-danger);
  background: #fce8e6;
}

.pvip-nav-badge {
  background: var(--pvip-c-danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

/* ── Immobili Grid ───────────────────────────────────────────────────── */
.pvip-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.pvip-section-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pvip-c-text);
  margin: 0;
}

/* ── Dashboard search bar (stile identico alla barra principale) ── */
.pvip-dash-search-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 24px;
  background: var(--pvip-c-white);
  border: 1px solid var(--pvip-c-border);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  /* NON overflow:hidden — taglierebbe il dropdown assoluto del campo Dove? */
  flex-wrap: wrap;
  position: relative;
}
/* Raggio angoli sui filtri estremi per compensare la rimozione di overflow:hidden */
.pvip-dash-filter-group:first-child { border-radius: 14px 0 0 14px; }
.pvip-dash-filter-group:last-child  { border-radius: 0 14px 14px 0; }
@media (max-width: 640px) {
  .pvip-dash-filter-group:first-child { border-radius: 14px 14px 0 0; }
  .pvip-dash-filter-group:last-child  { border-radius: 0 0 14px 14px; }
}
.pvip-dash-filter-group {
  flex: 1;
  min-width: 160px;
  padding: 12px 18px 14px;
  border-right: 1px solid var(--pvip-c-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.pvip-dash-filter-group:last-child { border-right: none; }
.pvip-dash-filter-group--submit {
  flex: 0 0 auto;
  min-width: auto;
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.pvip-dash-filter-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pvip-c-text-light);
  margin: 0;
  padding: 0;
}
.pvip-dash-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pvip-dash-filter-icon {
  width: 16px;
  height: 16px;
  color: var(--pvip-c-text-light);
  flex-shrink: 0;
}
.pvip-dash-filter-wrap input,
.pvip-dash-select-wrap select {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--pvip-c-font);
  font-size: .92rem;
  color: var(--pvip-c-text);
  width: 100%;
  padding: 0;
}
.pvip-dash-select-wrap { flex: 1; }
.pvip-dash-select-wrap select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.pvip-dash-filter-wrap input::placeholder { color: var(--pvip-c-text-light); }
.pvip-dash-cerca-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  font-size: .9rem;
}

/* ── Dove? autocomplete dropdown ─────────────────────────────────── */
.pvip-dash-dove-wrap { position: relative; }
.pvip-dash-dove-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: -18px;
  right: -18px;
  background: var(--pvip-c-white);
  border: 1px solid var(--pvip-c-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 5000;
  max-height: 280px;
  overflow-y: auto;
}
.pvip-dash-dove-dropdown--up {
  top: auto;
  bottom: calc(100% + 6px);
}
.pvip-dash-dove-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--pvip-c-text);
  transition: background .1s;
}
.pvip-dash-dove-item:hover,
.pvip-dash-dove-item--active { background: #f0f4fa; }
.pvip-dash-dove-icon { color: var(--pvip-c-teal); flex-shrink: 0; }
.pvip-dash-dove-name { flex: 1; }
.pvip-dash-dove-name strong { color: var(--pvip-c-blue); font-weight: 700; }
.pvip-dash-dove-badge {
  font-size: .7rem;
  color: var(--pvip-c-text-light);
  background: #f0f4fa;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .pvip-dash-filter-group { border-right: none; border-bottom: 1px solid var(--pvip-c-border); min-width: 100%; }
  .pvip-dash-filter-group--submit { border-bottom: none; min-width: 100%; }
  .pvip-dash-cerca-btn { width: 100%; justify-content: center; }
}

.pvip-immobili-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.pvip-imm-card {
  background: var(--pvip-c-white);
  border-radius: 12px;
  border: 1px solid var(--pvip-c-border);
  overflow: hidden;
  box-shadow: var(--pvip-c-shadow);
  transition: box-shadow .18s, transform .18s;
  display: flex;
  flex-direction: column;
}
.pvip-imm-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

.pvip-imm-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 160px;
  background: #eef2f7;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.pvip-imm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pvip-imm-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pvip-c-text-light);
  opacity: .22;
}

.pvip-imm-natura-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--pvip-c-teal);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

.pvip-imm-body {
  padding: 14px 18px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pvip-imm-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--pvip-c-text);
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pvip-imm-meta {
  font-size: .8rem;
  color: var(--pvip-c-text-light);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

/* Area pulsanti — separata con bordo come le card classiche dell'archivio.
   margin-top: auto spinge sempre i pulsanti al fondo della card indipendentemente
   dall'altezza del contenuto, mantenendo l'allineamento su tutta la riga. */
.pvip-imm-actions {
  display: flex;
  gap: 8px;
  margin: auto -18px 0;
  padding: 12px 18px;
  border-top: 1px solid var(--pvip-c-border);
  background: #f8fafc;
}
.pvip-imm-actions .pvip-btn {
  flex: 1;
  width: auto;
  min-width: 0;
  justify-content: center;
  padding: 8px 12px;
  font-size: .8125rem;
}

/* Avviso validazione dove (sopra griglia quando ci sono già risultati) */
/* ═══════════════════════════════════════════════════════════════════════
   RICHIESTE
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-requests-list {
  display: block;
  padding: 4px 2px;
}
.pvip-req-pager {
  margin-top: 20px;
  margin-bottom: 4px;
}
.pvip-pager-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pvip-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--pvip-c-border);
  border-radius: 8px;
  background: var(--pvip-c-white);
  color: var(--pvip-c-text);
  font-size: .85rem;
  font-weight: 500;
  font-family: var(--pvip-c-font);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  line-height: 1;
}
.pvip-pager-btn:hover:not(:disabled) {
  background: var(--pvip-c-bg);
  border-color: var(--pvip-c-teal);
  color: var(--pvip-c-teal);
}
.pvip-pager-btn:disabled {
  opacity: .35;
  cursor: default;
}
.pvip-pager-btn.pvip-pager-active {
  background: var(--pvip-c-teal);
  border-color: var(--pvip-c-teal);
  color: #fff;
  box-shadow: 0 2px 6px rgba(13,148,136,.3);
  cursor: default;
}
.pvip-pager-nav {
  min-width: 36px;
  padding: 0;
  color: var(--pvip-c-text-light);
}
.pvip-pager-nav:hover:not(:disabled) {
  color: var(--pvip-c-teal);
}

.pvip-req-card {
  background: var(--pvip-c-white);
  border-radius: 12px;
  border: 1px solid var(--pvip-c-border);
  box-shadow: 0 2px 8px rgba(60,64,67,.10), 0 1px 3px rgba(60,64,67,.08);
  overflow: hidden;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: box-shadow .2s, transform .15s;
  margin-bottom: 20px;
}
.pvip-req-card:last-child {
  margin-bottom: 0;
}
.pvip-req-card:hover {
  box-shadow: var(--pvip-c-shadow-lg);
  transform: translateY(-1px);
}
.pvip-req-card[data-status="pending"]     { border-left-color: var(--pvip-c-warn); }
.pvip-req-card[data-status="in_progress"] { border-left-color: var(--pvip-c-blue); }
.pvip-req-card[data-status="answered"]    { border-left-color: var(--pvip-c-success); }
.pvip-req-card[data-status="closed"]      { border-left-color: var(--pvip-c-text-light); }

.pvip-req-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pvip-req-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--pvip-c-text);
  margin: 0 0 4px;
}
.pvip-req-meta {
  font-size: .8rem;
  color: var(--pvip-c-text-light);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pvip-req-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pvip-req-meta-item svg {
  flex-shrink: 0;
}
.pvip-req-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
/* Codice identificativo immobile nella card richiesta */
.pvip-req-codice-row {
  margin-top: 5px;
}
.pvip-req-codice {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  font-family: monospace;
  color: var(--pvip-c-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: .02em;
}
.pvip-req-codice--internal {
  color: var(--pvip-c-text-light);
  background: var(--pvip-c-bg);
  border-color: var(--pvip-c-border);
}
.pvip-req-footer {
  background: var(--pvip-c-bg);
  padding: 10px 20px;
  font-size: .8rem;
  color: var(--pvip-c-text-light);
  border-top: 1px solid var(--pvip-c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pvip-req-footer .pvip-req-meta-item svg { opacity: .7; }

/* Footer azioni card richiesta */
.pvip-req-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
/* Link "Vedi scheda" immobile */
.pvip-req-scheda {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--pvip-c-text-light);
  text-decoration: none;
  transition: color .15s;
}
.pvip-req-scheda:hover { color: var(--pvip-c-blue); text-decoration: underline; }
/* Link "Apri" nel footer card */
.pvip-req-apri {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--pvip-c-blue);
}
.pvip-req-card:hover .pvip-req-apri {
  text-decoration: underline;
}

/* Pallino rosso per messaggi non letti */
.pvip-req-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   BADGE
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.pvip-badge-warning { background: #fef7e0; color: #e37400; }
.pvip-badge-info    { background: #e8f0fe; color: var(--pvip-c-blue); }
.pvip-badge-success { background: #e6f4ea; color: var(--pvip-c-success); }
.pvip-badge-neutral { background: #f1f3f4; color: var(--pvip-c-text-light); }
.pvip-badge-danger  { background: #fce8e6; color: var(--pvip-c-danger); }

/* ═══════════════════════════════════════════════════════════════════════
   THREAD MESSAGGI
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  max-height: 460px;
  overflow-y: auto;
  background: var(--pvip-c-bg);
  border-radius: 10px;
  border: 1px solid var(--pvip-c-border);
}

.pvip-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.pvip-msg-citizen  { align-self: flex-end; align-items: flex-end; }
.pvip-msg-operator { align-self: flex-start; align-items: flex-start; }

.pvip-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.55;
  word-break: break-word;
}
.pvip-msg-citizen .pvip-msg-bubble {
  background: var(--pvip-c-teal);
  color: var(--pvip-c-white);
  border-bottom-right-radius: 4px;
}
.pvip-msg-operator .pvip-msg-bubble {
  background: var(--pvip-c-white);
  color: var(--pvip-c-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--pvip-c-border);
  box-shadow: var(--pvip-c-shadow);
}

.pvip-msg-time {
  font-size: .7rem;
  color: var(--pvip-c-text-light);
  margin-top: 4px;
  padding: 0 4px;
}
.pvip-msg-role {
  font-size: .7rem;
  font-weight: 600;
  color: var(--pvip-c-text-light);
  margin-bottom: 4px;
  padding: 0 4px;
}

/* ── Reply form ──────────────────────────────────────────────────────── */
.pvip-reply-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pvip-reply-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid var(--pvip-c-border);
  border-radius: 10px;
  font-family: var(--pvip-c-font);
  font-size: .9rem;
  resize: none;
  outline: none;
  min-height: 64px;
  max-height: 140px;
  transition: border-color .15s, box-shadow .15s;
  color: var(--pvip-c-text);
  background: var(--pvip-c-white);
}
.pvip-reply-form textarea:focus {
  border-color: var(--pvip-c-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
/* Riga bottoni: chiudi a sx, invia a dx */
.pvip-reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
/* Pulsante "Chiudi richiesta" — compatto, bordo rosso */
.pvip-action-close-req {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-size: .82rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  font-family: var(--pvip-c-font);
}
.pvip-action-close-req:hover {
  background: #fef2f2;
  border-color: #dc2626;
}
/* Pulsante "Invia messaggio" — prende tutto lo spazio restante */
.pvip-reply-send {
  flex: 1;
  justify-content: center;
}
/* Legacy - mantenuto per compatibilità */
.pvip-action-danger {
  background: none;
  border: none;
  color: #a0aec0;
  font-size: .8rem;
  padding: 4px 0;
  cursor: pointer;
  transition: color .15s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pvip-action-danger:hover { color: #e53e3e; }
/* Nota richiesta chiusa */
/* ── Modal conferma chiusura richiesta ─────────────────────────────────── */
#pvip-confirm-close-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px);
  z-index: 1000001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .22s ease;
}
#pvip-confirm-close-overlay.pvip-cc-visible {
  opacity: 1;
}
#pvip-confirm-close-overlay.pvip-cc-visible .pvip-cc-box {
  transform: translateY(0) scale(1);
}
.pvip-cc-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.1);
  max-width: 420px;
  width: 100%;
  padding: 32px 28px 24px;
  transform: translateY(12px) scale(.97);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  font-family: var(--pvip-c-font);
}
.pvip-cc-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #dc2626;
}
.pvip-cc-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pvip-c-text);
  text-align: center;
  margin: 0 0 12px;
  font-family: var(--pvip-c-font);
}
.pvip-cc-body {
  font-size: .9rem;
  color: var(--pvip-c-text-muted);
  text-align: center;
  line-height: 1.5;
  margin: 0 0 12px;
}
.pvip-cc-body strong {
  color: #dc2626;
  font-weight: 600;
}
.pvip-cc-list {
  background: #fef2f2;
  border-radius: 10px;
  padding: 12px 16px 12px 28px;
  margin: 0 0 14px;
  font-size: .85rem;
  color: #7f1d1d;
  line-height: 1.7;
}
.pvip-cc-hint {
  font-size: .8rem;
  color: #94a3b8;
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.45;
}
.pvip-cc-actions {
  display: flex;
  gap: 10px;
}
.pvip-cc-actions .pvip-cc-cancel {
  flex: 1;
  justify-content: center;
}
.pvip-cc-confirm {
  flex: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--pvip-c-font);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(220,38,38,.3);
}
.pvip-cc-confirm:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220,38,38,.35);
}
.pvip-cc-confirm:disabled {
  opacity: .6;
  cursor: default;
}

/* ── Nota richiesta già chiusa ─────────────────────────────────────────── */
.pvip-closed-note {
  text-align: center;
  color: #a0aec0;
  font-size: .82rem;
  margin: 0;
  padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32,33,36,.6);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.pvip-modal-overlay.pvip-open {
  opacity: 1;
  pointer-events: all;
}
.pvip-modal {
  background: var(--pvip-c-white);
  border-radius: 16px;
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  transform: translateY(16px) scale(.98);
  transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .28s;
  opacity: 0;
}
.pvip-modal-overlay.pvip-open .pvip-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.pvip-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--pvip-c-border);
  flex-shrink: 0;
}
.pvip-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pvip-c-text);
  margin: 0;
  line-height: 1.3;
  padding-right: 12px;
}
.pvip-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Il <form> dentro la modal deve essere flex per permettere lo scroll del body */
#pvip-request-form-modal {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
/* L'info-bar immobile (tra header e form) non deve espandersi */
.pvip-req-imm-info {
  flex-shrink: 0;
}
.pvip-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--pvip-c-border);
  flex-shrink: 0;
  background: var(--pvip-c-bg);
}
/* Sottotitolo header modal */
.pvip-modal-subtitle {
  font-size: .78rem;
  color: var(--pvip-c-text-light);
  margin: 2px 0 0;
}

/* Asterisco campo obbligatorio */
.pvip-required {
  color: var(--pvip-c-danger);
  margin-left: 2px;
}

/* Card immobile dentro la modal richiesta */
.pvip-req-imm-info {
  padding: 14px 24px;
  background: #f0f4fa;
  border-bottom: 1px solid var(--pvip-c-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pvip-req-imm-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--pvip-c-text);
}
.pvip-req-imm-comune {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--pvip-c-text-light);
}

/* Meta info nella modal — 2 righe */
.pvip-detail-meta {
  padding: 14px 24px;
  background: #f8f9fc;
  border-bottom: 1px solid var(--pvip-c-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pvip-dmeta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  color: var(--pvip-c-text);
}
.pvip-dmeta-imm { font-weight: 600; color: var(--pvip-c-text); }
.pvip-dmeta-info { color: var(--pvip-c-text-light); }
.pvip-dmeta-sep { color: var(--pvip-c-border); font-size: .75rem; }
.pvip-dmeta-date { font-size: .78rem; }
.pvip-thread-loading,
.pvip-thread-empty {
  text-align: center;
  padding: 32px 20px;
  color: #a0aec0;
  font-size: .85rem;
}
/* Pulsante chiudi X */
.pvip-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--pvip-c-bg);
  color: var(--pvip-c-text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.pvip-btn-icon:hover { background: #e2e8f0; color: var(--pvip-c-text); }

/* ═══════════════════════════════════════════════════════════════════════
   PROFILO
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-profile-card {
  background: var(--pvip-c-white);
  border-radius: 14px;
  border: 1px solid var(--pvip-c-border);
  box-shadow: var(--pvip-c-shadow-lg);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}
.pvip-profile-header {
  background: linear-gradient(135deg, #1a2e4a 0%, #2d5090 100%);
  padding: 32px 36px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.pvip-profile-header-info {
  min-width: 0;
}
.pvip-avatar {
  width: 68px;
  height: 68px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: .02em;
}
.pvip-profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px;
  line-height: 1.2;
}
.pvip-profile-cf {
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  font-family: 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: .04em;
}
.pvip-profile-email {
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
}
.pvip-profile-body {
  padding: 28px 36px 36px;
}

/* ═══════════════════════════════════════════════════════════════════════
   PANEL / EMPTY / PAGINATION
   ═══════════════════════════════════════════════════════════════════════ */
.pvip-panel {
  background: var(--pvip-c-white);
  border-radius: 12px;
  border: 1px solid var(--pvip-c-border);
  box-shadow: var(--pvip-c-shadow);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.pvip-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--pvip-c-text-light);
  font-size: .9rem;
}

/* Variante per lo stato iniziale (nessuna ricerca ancora effettuata) */
.pvip-empty--search {
  background: var(--pvip-c-white);
  border: 1px solid var(--pvip-c-border);
  border-radius: 16px;
  padding: 48px 32px 40px;
  max-width: 480px;
  margin: 8px auto 0;
}

.pvip-empty-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(13,148,136,.08);
  color: var(--pvip-c-teal);
  margin-bottom: 18px;
}

.pvip-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  opacity: .3;
  color: var(--pvip-c-text-light);
}

.pvip-empty-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pvip-c-text);
  margin-bottom: 8px;
}

.pvip-empty-desc {
  font-size: .875rem;
  color: var(--pvip-c-text-light);
  line-height: 1.55;
  margin: 0 0 24px;
}

/* Steps numerati */
.pvip-empty-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.pvip-empty-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .85rem;
  color: var(--pvip-c-text);
}

.pvip-empty-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pvip-c-teal);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pvip-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}
.pvip-pagination button {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--pvip-c-border);
  background: var(--pvip-c-white);
  color: var(--pvip-c-text);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--pvip-c-font);
}
.pvip-pagination button:hover {
  background: #e8f0fe;
  border-color: var(--pvip-c-blue);
  color: var(--pvip-c-blue);
}
.pvip-pagination button.pvip-active {
  background: var(--pvip-c-blue);
  border-color: var(--pvip-c-blue);
  color: #fff;
}
.pvip-pagination button:disabled { opacity: .4; cursor: default; }
.pvip-pager-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: .875rem;
  color: var(--pvip-c-text-light);
  letter-spacing: 1px;
}
.pvip-pagination button[data-page] { min-width: 36px; width: auto; padding: 0 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Header actions (badge notifiche + logout) ── */
.pvip-dash-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  /* Auth */
  .pvip-auth-body    { padding: 24px 24px 28px; }
  .pvip-auth-header  { padding: 28px 24px 22px; }
  .pvip-form-row     { grid-template-columns: 1fr; }

  /* Layout generale */
  .pvip-dash-header  { padding: 16px 20px; border-radius: 0; }
  .pvip-dashboard    { padding: 0 12px 40px; }
  .pvip-panel        { padding: 18px; }
  .pvip-stats-row    { grid-template-columns: 1fr 1fr; }

  /* Header actions: va a capo se non c'è spazio */
  .pvip-dash-header-actions { flex-wrap: wrap; gap: 8px; }

  /* Modal come bottom sheet */
  .pvip-modal-overlay { align-items: flex-end; padding: 0; }
  .pvip-modal {
    max-width: 100%;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
    padding: 0;
  }
  .pvip-modal-header { padding: 16px 18px 14px; }
  .pvip-modal-body   { padding: 0 18px; max-height: calc(88vh - 140px); overflow-y: auto; }
  .pvip-modal-footer { padding: 14px 18px 24px; }

  /* Grid immobili */
  .pvip-immobili-grid { grid-template-columns: 1fr; }

  /* Azioni card immobili: su mobile restano affiancate (flex: 1) */
  .pvip-imm-actions .pvip-btn { font-size: .8rem; padding: 8px 10px; }

  /* Profilo */
  .pvip-profile-header { flex-direction: column; text-align: center; padding: 24px 20px; }
  .pvip-profile-body   { padding: 20px 20px 28px; }

  /* Thread messaggi */
  .pvip-thread { max-height: 320px; }
  .pvip-msg    { max-width: 92%; }

  /* Reply actions in colonna su mobile */
  .pvip-reply-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  .pvip-reply-actions .pvip-btn,
  .pvip-action-close-req { width: 100%; justify-content: center; text-align: center; }
  .pvip-reply-send { flex: none; }
}

@media (max-width: 480px) {
  /* Card richiesta: header collassa */
  .pvip-req-header { flex-direction: column; gap: 8px; }
  .pvip-req-right  { flex-direction: row; align-items: center; flex-wrap: wrap; }

  /* Meta row nella modal: va a capo */
  .pvip-dmeta-row  { flex-wrap: wrap; gap: 4px 8px; }

  /* Stats: griglia 2×2 compatta */
  .pvip-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .pvip-stat-card {
    padding: 12px 14px;
  }
  .pvip-stat-card .pvip-stat-value {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }
  .pvip-stat-card .pvip-stat-label {
    font-size: .72rem;
  }

  /* Nav tab: bottom bar fissa */
  .pvip-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--pvip-c-border);
    box-shadow: 0 -2px 12px rgba(60,64,67,.12);
    margin-bottom: 0;
    padding: 6px 8px;
    justify-content: space-around;
    gap: 0;
  }
  .pvip-nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: .68rem;
    border-radius: 6px;
  }
  .pvip-nav-icon { width: 20px; height: 20px; }

  /* Aggiungi padding in fondo al contenuto per non finire sotto la nav bar */
  .pvip-dashboard { padding-bottom: 80px; }
}
