/* ═══════════════════════════════════════════════════════════
   AURA PARTNER PORTAL
   ═══════════════════════════════════════════════════════════ */

body.partner-mode #portal { background: #f5f6fa !important; }

.view-partner { min-height: 100vh; background: #f5f6fa; }

.pp-container {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.pp-sidebar {
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.pp-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pp-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.pp-logo-text strong { font-size: 16px; letter-spacing: 2px; color: #fff; }
.pp-logo-text span { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }

.pp-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.pp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  position: relative;
}
.pp-nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.pp-nav-item.active { background: rgba(0,184,148,0.1); color: #00b894; border-left-color: #00b894; }

.pp-nav-icon { font-size: 18px; width: 24px; text-align: center; }
.pp-nav-label { flex: 1; }

.pp-nav-badge {
  background: #00b894;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.pp-nav-tag {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pp-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.pp-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}
.pp-user-info { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.pp-user-info strong { font-size: 13px; color: #fff; }
.pp-user-info span { font-size: 10px; color: rgba(255,255,255,0.5); }
.pp-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.pp-logout:hover { background: rgba(231,76,60,0.15); color: #e74c3c; border-color: #e74c3c; }

/* ─── Main ─── */
.pp-main {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  max-height: 100vh;
}

.pp-section { max-width: 1400px; }
.pp-header { margin-bottom: 24px; }
.pp-header h1 { font-size: 24px; font-weight: 700; color: #2d3436; margin: 0 0 4px; }
.pp-header p { font-size: 13px; color: #636e72; margin: 0; }

.pp-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.pp-card h3 { font-size: 15px; font-weight: 700; color: #2d3436; margin: 0 0 16px; }

.pp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .pp-grid-2 { grid-template-columns: 1fr; } }

/* ─── KPI Cards ─── */
.pp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.pp-kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid #636e72;
}
.pp-kpi-card.positive { border-left-color: #00b894; }
.pp-kpi-icon { font-size: 20px; margin-bottom: 8px; }
.pp-kpi-value { font-size: 26px; font-weight: 800; color: #2d3436; line-height: 1; }
.pp-kpi-label { font-size: 11px; color: #636e72; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.pp-kpi-trend { font-size: 11px; color: #00b894; font-weight: 600; margin-top: 6px; }

@media (max-width: 1200px) { .pp-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Notifications ─── */
.pp-notif-list { display: flex; flex-direction: column; gap: 10px; }
.pp-notif {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #f8f9fc;
  border-radius: 8px;
  transition: background 0.15s;
}
.pp-notif:hover { background: #f0f3ff; }
.pp-notif-icon { font-size: 20px; }
.pp-notif-body { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.pp-notif-body span { font-size: 13px; color: #2d3436; }
.pp-notif-body small { font-size: 11px; color: #636e72; margin-top: 2px; }

/* ─── Appointments ─── */
.pp-appt-list { display: flex; flex-direction: column; gap: 10px; }
.pp-appt {
  display: flex;
  gap: 14px;
  padding: 10px;
  background: #f8f9fc;
  border-radius: 8px;
  border-left: 3px solid #0f3460;
}
.pp-appt-date { text-align: center; min-width: 40px; }
.pp-appt-date strong { display: block; font-size: 20px; color: #2d3436; line-height: 1; font-weight: 800; }
.pp-appt-date span { font-size: 10px; text-transform: uppercase; color: #636e72; letter-spacing: 0.5px; }
.pp-appt-info { flex: 1; display: flex; flex-direction: column; }
.pp-appt-info strong { font-size: 13px; color: #2d3436; }
.pp-appt-info span { font-size: 11px; color: #636e72; }

/* ─── Leaderboard ─── */
.pp-leaderboard { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-leaderboard th { background: #1a1a2e; color: #fff; padding: 10px 14px; font-size: 11px; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: 0.5px; }
.pp-leaderboard th:first-child { border-radius: 6px 0 0 0; }
.pp-leaderboard th:last-child { border-radius: 0 6px 0 0; }
.pp-leaderboard td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; }
.pp-leaderboard tbody tr:hover td { background: #f8f9fc; }
.pp-lb-me td { background: #f0f3ff !important; font-weight: 600; }
.pp-me-tag { display: inline-block; background: #0f3460; color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; letter-spacing: 0.5px; }

/* ─── Generic table ─── */
.pp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-table th { background: #1a1a2e; color: #fff; padding: 10px 14px; font-size: 11px; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: 0.5px; }
.pp-table th:first-child { border-radius: 6px 0 0 0; }
.pp-table th:last-child { border-radius: 0 6px 0 0; }
.pp-table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; }
.pp-table tbody tr:hover td { background: #f8f9fc; }

/* ─── Badges & Buttons ─── */
.pp-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 10px; }
.pp-badge-green { background: rgba(0,184,148,0.12); color: #00b894; }
.pp-badge-yellow { background: rgba(243,156,18,0.12); color: #f39c12; }
.pp-badge-red { background: rgba(231,76,60,0.12); color: #e74c3c; }
.pp-badge-cat { background: rgba(15,52,96,0.1); color: #0f3460; }

.pp-btn-sm {
  background: #0f3460;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pp-btn-sm:hover { background: #1a4a8a; }

.pp-btn-primary {
  background: #0f3460;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.pp-btn-primary:hover { background: #1a4a8a; transform: translateY(-1px); }

/* ─── Forum Partner ─── */
.pp-forum-topic {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.pp-forum-head { display: flex; gap: 14px; margin-bottom: 16px; }
.pp-forum-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f3460, #00b894);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.pp-forum-meta { flex: 1; }
.pp-forum-meta h4 { font-size: 16px; font-weight: 700; color: #2d3436; margin: 0 0 6px; }
.pp-forum-info { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #636e72; align-items: center; }

.pp-aura-answer {
  background: linear-gradient(135deg, #f0f3ff 0%, #fafbfd 100%);
  border: 1px solid #dce3ed;
  border-radius: 10px;
  padding: 16px;
}
.pp-aura-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #0f3460; font-size: 13px; }
.pp-aura-icon { font-size: 18px; }
.pp-aura-answer p { font-size: 13px; color: #2d3436; line-height: 1.6; margin: 0 0 12px; }
.pp-aura-sources { font-size: 11px; color: #636e72; margin-bottom: 12px; }
.pp-source-tag { display: inline-block; background: #fff; border: 1px solid #dce3ed; padding: 3px 8px; border-radius: 4px; margin-right: 4px; font-size: 10px; color: #0f3460; }
.pp-aura-feedback { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-fb-btn {
  background: #fff;
  border: 1px solid #dce3ed;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.pp-fb-good { color: #00b894; }
.pp-fb-good:hover { background: #00b894; color: #fff; border-color: #00b894; }
.pp-fb-bad { color: #f39c12; }
.pp-fb-bad:hover { background: #f39c12; color: #fff; border-color: #f39c12; }
.pp-fb-btn:hover { background: #0f3460; color: #fff; border-color: #0f3460; }

/* ─── Network ─── */
.pp-network-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pp-network-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pp-network-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.pp-network-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f3460, #00b894);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  margin: 0 auto 12px;
  position: relative;
}
.pp-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #00b894;
  border: 2px solid #fff;
  border-radius: 50%;
}
.pp-network-card h4 { font-size: 14px; font-weight: 700; color: #2d3436; margin: 0 0 4px; }
.pp-network-region { font-size: 11px; color: #636e72; margin: 0 0 10px; }
.pp-network-specs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.pp-spec-tag { background: rgba(15,52,96,0.08); color: #0f3460; font-size: 9px; font-weight: 600; padding: 3px 6px; border-radius: 4px; }
.pp-network-clients { font-size: 11px; color: #636e72; margin: 0 0 12px; }

@media (max-width: 1200px) { .pp-network-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .pp-network-grid { grid-template-columns: 1fr; } }

/* ─── Chat ─── */
.pp-section-chat { display: flex; flex-direction: column; height: calc(100vh - 100px); }
.pp-chat-layout {
  display: flex;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  flex: 1;
  min-height: 500px;
}

.pp-chat-list {
  width: 280px;
  border-right: 1px solid #f0f0f0;
  overflow-y: auto;
  flex-shrink: 0;
}

.pp-chat-item {
  display: flex;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.pp-chat-item:hover { background: #f8f9fc; }
.pp-chat-active { background: #f0f3ff !important; border-left: 3px solid #0f3460; }

.pp-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f3460, #00b894);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.pp-chat-preview { flex: 1; min-width: 0; }
.pp-chat-row { display: flex; justify-content: space-between; align-items: center; }
.pp-chat-row strong { font-size: 13px; color: #2d3436; }
.pp-chat-row small { font-size: 10px; color: #b2bec3; }
.pp-chat-last { font-size: 11px; color: #636e72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.pp-chat-unread { background: #e74c3c; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }

.pp-chat-window { flex: 1; display: flex; flex-direction: column; }
.pp-chat-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.pp-chat-header strong { display: block; font-size: 14px; }
.pp-chat-header span { font-size: 11px; color: #00b894; }

.pp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pp-msg { display: flex; flex-direction: column; max-width: 75%; }
.pp-msg small { font-size: 10px; color: #b2bec3; margin-top: 3px; }
.pp-msg-me { align-self: flex-end; align-items: flex-end; }
.pp-msg-me .pp-msg-bubble { background: #0f3460; color: #fff; border-radius: 14px 14px 4px 14px; }
.pp-msg-them { align-self: flex-start; align-items: flex-start; }
.pp-msg-them .pp-msg-bubble { background: #fff; color: #2d3436; border-radius: 14px 14px 14px 4px; border: 1px solid #f0f0f0; }
.pp-msg-bubble { padding: 10px 14px; font-size: 13px; line-height: 1.5; }

.pp-chat-input {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
}
.pp-chat-input input {
  flex: 1;
  border: 1px solid #e0e0e0;
  padding: 10px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.pp-chat-input input:focus { border-color: #0f3460; }
.pp-chat-input button {
  background: #0f3460;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* ─── Academy ─── */
.pp-academy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.pp-course-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}
.pp-course-card:hover { transform: translateY(-2px); }
.pp-course-icon { font-size: 32px; margin-bottom: 8px; }
.pp-course-cat { display: inline-block; background: rgba(15,52,96,0.08); color: #0f3460; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; margin-bottom: 8px; }
.pp-course-card h4 { font-size: 15px; font-weight: 700; color: #2d3436; margin: 0 0 8px; }
.pp-course-card p { font-size: 12px; color: #636e72; line-height: 1.5; margin: 0 0 12px; }
.pp-course-meta { font-size: 11px; color: #636e72; margin-bottom: 12px; }
.pp-course-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pp-course-bar { flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.pp-course-fill { height: 100%; background: linear-gradient(90deg, #00b894, #0f3460); border-radius: 3px; transition: width 0.3s; }
.pp-course-progress span { font-size: 11px; font-weight: 700; color: #0f3460; min-width: 36px; text-align: right; }

@media (max-width: 1200px) { .pp-academy-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .pp-academy-grid { grid-template-columns: 1fr; } }

/* ─── Agent Forum ─── */
.pp-readonly-banner {
  background: linear-gradient(135deg, #fff3cd 0%, #fef5e7 100%);
  border: 1px solid #f39c12;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #8a6d3b;
}
.pp-readonly-banner strong { color: #f39c12; }

.pp-agent-thread {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.pp-agent-thread-head { margin-bottom: 20px; }
.pp-agent-thread-head h3 { font-size: 17px; font-weight: 700; color: #2d3436; margin: 0 0 8px; }
.pp-agent-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 11px; color: #636e72; }

.pp-sev { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; letter-spacing: 0.5px; }
.pp-sev-critical { background: rgba(231,76,60,0.12); color: #e74c3c; }
.pp-sev-high { background: rgba(243,156,18,0.12); color: #f39c12; }
.pp-sev-med { background: rgba(108,92,231,0.12); color: #6c5ce7; }

.pp-agent-flow { display: flex; flex-direction: column; }

.pp-agent-msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.pp-agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 2px solid #e0e0e0;
}

.pp-agent-bubble {
  flex: 1;
  background: #fafbfd;
  border-left: 3px solid #636e72;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}
.pp-agent-name { font-size: 12px; font-weight: 700; color: #2d3436; margin-bottom: 4px; }
.pp-agent-name small { font-weight: 400; color: #b2bec3; margin-left: 8px; }
.pp-agent-bubble p { font-size: 13px; color: #2d3436; line-height: 1.6; margin: 0; }

.pp-agent-cliente .pp-agent-avatar { background: rgba(0,184,148,0.15); border-color: #00b894; }
.pp-agent-cliente .pp-agent-bubble { border-left-color: #00b894; background: rgba(0,184,148,0.04); }

.pp-agent-funzione .pp-agent-avatar { background: rgba(108,92,231,0.15); border-color: #6c5ce7; }
.pp-agent-funzione .pp-agent-bubble { border-left-color: #6c5ce7; background: rgba(108,92,231,0.04); }

.pp-agent-verticale .pp-agent-avatar { background: rgba(243,156,18,0.15); border-color: #f39c12; }
.pp-agent-verticale .pp-agent-bubble { border-left-color: #f39c12; background: rgba(243,156,18,0.04); }

.pp-agent-partner .pp-agent-avatar { background: rgba(15,52,96,0.15); border-color: #0f3460; }
.pp-agent-partner .pp-agent-bubble { border-left-color: #0f3460; background: rgba(15,52,96,0.05); }

.pp-agent-sistema .pp-agent-avatar { background: rgba(231,76,60,0.15); border-color: #e74c3c; }
.pp-agent-sistema .pp-agent-bubble { border-left-color: #e74c3c; background: rgba(231,76,60,0.04); }

.pp-agent-connector {
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, #e0e0e0 0%, transparent 100%);
  margin-left: 21px;
}

/* ─── Login hints ─── */
.login-hints {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.login-hint-row {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin: 2px 0;
}
.login-hint-row strong { color: rgba(255,255,255,0.75); }

/* ─── Mobile ─── */
@media (max-width: 900px) {
  .pp-sidebar { width: 60px; }
  .pp-logo-text, .pp-nav-label, .pp-nav-badge, .pp-nav-tag, .pp-user-info { display: none; }
  .pp-main { padding: 20px; }
}

/* ========================================================================
   Revenue passive widgets — Servizi non finanziari / Recupero / Presidio
   ======================================================================== */

/* Seconda riga home widgets */
.home-widgets-row-revenue {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.home-soon-badge {
  background: #F59E0B;
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.home-presidio-teaser {
  font-size: 12px;
  color: #354F39;
  padding: 10px 12px;
  font-style: italic;
  line-height: 1.5;
}

.home-empty {
  font-size: 12px;
  color: #6B8570;
  padding: 14px 12px;
  text-align: center;
  font-style: italic;
}

.home-snf-item {
  border-left: 3px solid #74C69D;
}

/* Servizi non finanziari — Tab */
.snf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.snf-card {
  background: #fff;
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(15,52,96,0.04);
}

.snf-card h3 {
  margin: 0 0 10px 0;
  color: #0f3460;
  font-size: 15px;
  line-height: 1.3;
}

.snf-desc {
  font-size: 13px;
  color: #354F39;
  line-height: 1.5;
  margin: 0 0 10px 0;
  flex: 1;
}

.snf-angolo {
  font-size: 12px;
  color: #2D6A4F;
  background: rgba(216,243,220,0.35);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.snf-angolo em {
  font-style: italic;
}

.snf-card .bandi-btn-partner {
  align-self: flex-start;
}

@media (max-width: 900px) {
  .home-widgets-row-revenue {
    grid-template-columns: 1fr;
  }
  .snf-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================
   Recupero Crediti — badge stato + modale Partner gate
   ======================================================================== */

.home-rc-item {
  border-left: 3px solid #991B1B;
}

.rc-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.badge-avviare { background: #FEF3C7; color: #92400E; }
.badge-strag   { background: #DBEAFE; color: #1E40AF; }
.badge-giud    { background: #FCE7F3; color: #9D174D; }
.badge-recup   { background: #D1FAE5; color: #065F46; }
.badge-ines    { background: #F3F4F6; color: #374151; }

.badge-ritardo {
  background: rgba(153,27,27,0.1);
  color: #991B1B;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

/* Modale Recupero / generica */
.rc-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,52,96,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.rc-modal {
  background: #fff;
  border-radius: 12px;
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.rc-modal h3 {
  margin: 0 0 14px 0;
  color: #0f3460;
  font-size: 17px;
}

.rc-modal p {
  margin: 6px 0;
  font-size: 13px;
  color: #354F39;
  line-height: 1.5;
}

.rc-modal-box {
  background: rgba(216,243,220,0.25);
  padding: 14px;
  border-radius: 8px;
  margin: 14px 0;
  font-size: 13px;
  color: #1B4332;
  line-height: 1.6;
}

.rc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.rc-modal-btn-cancel {
  background: transparent;
  border: 1px solid #6B8570;
  color: #354F39;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.rc-modal-btn-cancel:hover {
  background: rgba(27,67,50,0.05);
}

.rc-modal-btn-confirm {
  background: #0f3460;
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  display: inline-block;
  font-weight: 600;
}
.rc-modal-btn-confirm:hover {
  background: #1a4a7e;
}

/* ========================================================================
   Presidio Bancario — hero, coperture, form manifestazione
   ======================================================================== */

.pb-hero {
  background: linear-gradient(135deg, rgba(216,243,220,0.4), rgba(15,52,96,0.08));
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(27,67,50,0.08);
}

.pb-hero-desc {
  color: #354F39;
  font-size: 14px;
  line-height: 1.65;
  margin: 14px 0 0 0;
}

.pb-coperture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.pb-copertura-card {
  background: #fff;
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(15,52,96,0.04);
}

.pb-copertura-card strong {
  color: #0f3460;
  font-size: 13px;
  display: block;
  margin: 8px 0 6px 0;
  line-height: 1.3;
}

.pb-copertura-card p {
  color: #6B8570;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.pb-icon {
  font-size: 24px;
  line-height: 1;
}

.pb-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.pb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pb-field label {
  font-size: 12px;
  font-weight: 600;
  color: #354F39;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pb-field input,
.pb-field select,
.pb-field textarea {
  padding: 10px 12px;
  border: 1px solid rgba(27,67,50,0.15);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
  color: #354F39;
}

.pb-field input:focus,
.pb-field select:focus,
.pb-field textarea:focus {
  border-color: #0f3460;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}

.pb-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 4px;
}

.pb-form-confirm {
  background: #D1FAE5;
  color: #065F46;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 10px;
  border: 1px solid rgba(6,95,70,0.2);
}

/* ========================================================================
   Solleciti Crediti — blocco in tab Scadenziari + modale preparazione
   ======================================================================== */

.solleciti-block {
  background: #fff;
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: 12px;
  padding: 22px;
  margin: 16px 0 20px 0;
  box-shadow: 0 2px 8px rgba(15,52,96,0.04);
}

.solleciti-title {
  margin: 0 0 6px 0;
  color: #0f3460;
  font-size: 16px;
  font-weight: 700;
}

.solleciti-subtitle {
  margin: 0 0 16px 0;
  color: #6B8570;
  font-size: 12px;
  line-height: 1.5;
}

.solleciti-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.solleciti-kpi {
  background: rgba(216,243,220,0.22);
  padding: 14px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(27,67,50,0.05);
}

.skp-val {
  font-size: 20px;
  font-weight: 700;
  color: #0f3460;
  line-height: 1.2;
}

.skp-lbl {
  font-size: 11px;
  color: #6B8570;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.solleciti-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sl-card {
  background: #fff;
  border: 1px solid rgba(27,67,50,0.1);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: transform 0.15s ease;
}

.sl-card:hover {
  transform: translateY(-2px);
}

.sl-card.sl-l1 { border-left: 4px solid #10B981; }
.sl-card.sl-l2 { border-left: 4px solid #F59E0B; }
.sl-card.sl-l3 { border-left: 4px solid #F97316; }
.sl-card.sl-l4 { border-left: 4px solid #991B1B; }

.sl-head {
  font-size: 12px;
  font-weight: 600;
  color: #354F39;
  margin-bottom: 8px;
}

.sl-count {
  font-size: 26px;
  font-weight: 700;
  color: #0f3460;
  line-height: 1;
}

.sl-amount {
  font-size: 11px;
  color: #6B8570;
  margin: 4px 0 12px 0;
}

.sl-btn {
  background: #0f3460;
  color: #fff;
  border: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
}

.sl-btn:hover:not(:disabled) {
  background: #1a4a7e;
}

.sl-btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

/* Modale grande per preparazione solleciti */
.rc-modal-large {
  max-width: 960px;
  width: calc(100% - 32px);
  max-height: 88vh;
  overflow-y: auto;
}

.sl-modal-subtitle {
  font-size: 12px;
  color: #6B8570;
  margin: 6px 0 16px 0;
  line-height: 1.5;
}

.sl-modal-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.sl-modal-list {
  overflow-x: auto;
}

.sl-modal-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.sl-modal-table th {
  text-align: left;
  padding: 8px;
  border-bottom: 2px solid rgba(27,67,50,0.1);
  color: #354F39;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sl-modal-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(27,67,50,0.05);
  vertical-align: middle;
}

.sl-row-disabled {
  opacity: 0.4;
}

.sl-link-btn {
  background: transparent;
  border: 1px solid #0f3460;
  color: #0f3460;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.sl-link-btn:hover {
  background: #0f3460;
  color: #fff;
}

.sl-modal-preview {
  background: rgba(216,243,220,0.15);
  border-radius: 8px;
  padding: 16px;
}

.sl-modal-preview h4 {
  margin: 0 0 10px 0;
  color: #0f3460;
  font-size: 13px;
}

.sl-preview-box {
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid rgba(27,67,50,0.08);
}

.sl-preview-row {
  margin-bottom: 10px;
  color: #354F39;
}

.sl-preview-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 11px;
  color: #354F39;
  line-height: 1.55;
  margin: 0;
}

.sl-note {
  font-size: 11px;
  color: #6B8570;
  margin-top: 10px;
  line-height: 1.5;
  font-style: italic;
}

@media (max-width: 900px) {
  .sl-modal-body { grid-template-columns: 1fr; }
  .solleciti-kpi-row { grid-template-columns: 1fr; }
  .solleciti-levels { grid-template-columns: repeat(2, 1fr); }
}
