.input-error {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 1px #b91c1c;
}

.multi-check.input-error,
.tag-list.input-error {
  border: 1px solid #b91c1c;
  border-radius: 8px;
  padding: 6px;
}

.required-note {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 13px;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: app-reveal 0s 0.4s both;
}
@keyframes app-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--primary);
  color: #ffffff;
  height: var(--header-height);
  gap: 16px;
  border-bottom: none;
  box-shadow: var(--shadow-sm);
}

header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

header img.logo {
  height: 36px;
  width: auto;
}

header .brand-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}

header .brand-subtitle {
  font-size: 12px;
  opacity: 0.85;
}

header .header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
}

header .header-center label {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

header .project-select {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  min-width: 200px;
}

header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.legend-menu-button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.legend-menu-button:hover {
  background: rgba(255,255,255,0.25);
}

.legend-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: none;
  z-index: 20;
}

.legend-menu.open .legend-menu-panel {
  display: block;
}

.ispra-legend {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.ispra-legend-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 150px;
}

.ispra-legend-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.ispra-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

.ispra-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend-frane-p4 {
  background: #5a0000;
}

.legend-frane-p3 {
  background: #e00000;
}

.legend-frane-p2 {
  background: #e86f00;
}

.legend-frane-p1 {
  background: #f4c430;
}

.legend-frane-aa {
  background: #f9f77a;
}

.legend-frane-p4p3 {
  background: #5f6163;
}

.legend-alluvioni-p3 {
  background: #002e7a;
}

.legend-alluvioni-p2 {
  background: #0070ff;
}

.legend-alluvioni-p1 {
  background: #bfe6ff;
}

.impersonation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.user-menu {
  position: relative;
}

.user-menu-button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu-button:hover {
  background: rgba(255,255,255,0.25);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  display: none;
  z-index: 20;
}

.user-menu.open .user-menu-panel {
  display: block;
}

.user-menu-panel .user-email {
  font-weight: 600;
  font-size: 14px;
}

.user-menu-panel .user-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.user-menu-panel .user-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-menu-panel .user-actions button {
  text-align: left;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu-panel .user-actions button:hover {
  background: var(--border);
}
