/* Icone desktop — griglia stile Windows */

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 88px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  user-select: none;
  pointer-events: auto;
  will-change: transform;
  transition: background 0.1s, border-color 0.1s;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.desktop-icon.selected {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.desktop-icon.is-dragging {
  opacity: 0.88;
  z-index: 5;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transition: none;
}

.desktop-icon.is-uninstalling {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.25);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

/* Badge conteggio non letti (es. Live Chat) sull'icona del desktop. */
.desktop-icon .desktop-badge {
  position: absolute;
  top: 2px;
  right: 15px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  text-shadow: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.desktop-icon-label {
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
  pointer-events: none;
}

.desktop-icon-rename {
  width: 100%;
  max-width: 84px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 0.75rem;
  font-family: inherit;
  text-align: center;
  line-height: 1.25;
  text-shadow: none;
  pointer-events: auto;
  outline: none;
}

.desktop-surface.is-refreshing .desktop-icons {
  animation: desktop-refresh-flash 0.45s ease;
}

@keyframes desktop-refresh-flash {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.35; }
}

/* Dialog Collega app / sito */
.desktop-link-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.desktop-link-overlay[hidden] {
  display: none !important;
}

.desktop-link-dialog {
  width: min(360px, 100%);
  background: rgba(32, 32, 32, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 18px 20px 16px;
}

.desktop-link-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}

.desktop-link-message {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.45;
}

.desktop-link-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.desktop-link-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.desktop-link-choice:hover {
  background: rgba(0, 120, 212, 0.15);
  border-color: rgba(0, 120, 212, 0.45);
}

.desktop-link-choice span {
  font-size: 0.875rem;
  font-weight: 600;
}

.desktop-link-choice small {
  font-size: 0.6875rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.3;
}

.desktop-link-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.desktop-link-field > span {
  font-size: 0.75rem;
  color: var(--text-2);
}

.desktop-link-input {
  padding: 8px 10px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-1);
  font-size: 0.8125rem;
  font-family: inherit;
}

.desktop-link-input:focus {
  outline: none;
  border-color: rgba(0, 120, 212, 0.6);
}

.desktop-link-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.desktop-link-actions .docs-btn {
  padding: 8px 14px;
  font-size: 0.8125rem;
}

/* Picker programmi installati */
.desktop-app-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px 14px 14px;
  box-sizing: border-box;
}

.desktop-app-picker-lead {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.4;
}

.desktop-app-picker-search {
  width: 100%;
}

.desktop-app-picker-body {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.desktop-app-picker-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.desktop-app-picker-list {
  overflow: auto;
  max-height: 320px;
}

.desktop-app-picker-empty {
  margin: 0;
  padding: 20px 12px;
  font-size: 0.8125rem;
  color: var(--text-2);
  text-align: center;
}

.desktop-app-picker-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.desktop-app-picker-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.desktop-app-picker-row.active {
  background: rgba(0, 120, 212, 0.22);
}

.desktop-app-picker-row-name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.desktop-app-picker-row-path {
  font-size: 0.6875rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.desktop-app-picker-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.desktop-app-picker-preview-name {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.3;
  word-break: break-word;
}

.desktop-app-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.desktop-app-picker-spacer {
  flex: 1;
}
