/* ════════════════════════════════════════
   WIDGETS V2 — AIR-ELEC Dashboard
   Catalogue complet 6 widgets, variantes S/M/L
   Glassmorphism corrigé (fond plus léger pour
   que le flou soit perceptible)
   ════════════════════════════════════════ */

/* ── Container ── */
.widgets-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── Widget de base (glassmorphism corrigé) ── */
.widget {
  position: absolute;
  pointer-events: auto;
  /* Glassmorphism allégé : l'arrière-plan doit transparaître */
  background: rgba(246, 246, 246, 0.55);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-window);
  border: 0.5px solid var(--glass-border);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-ios);
  user-select: none;
}

.widget:hover {
  box-shadow: var(--shadow-window-focused);
}

.widget.dragging {
  cursor: grabbing;
  box-shadow: var(--shadow-window-focused);
}

/* ── Widget Header ── */
.widget-header {
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 0.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}

.widget-header:active {
  cursor: grabbing;
}

.widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.widget-title-icon {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
}

.widget-content {
  padding: var(--space-4);
}

/* ════════════════════════════════════════
   TAILLES DE WIDGETS (S / M / L)
   ════════════════════════════════════════ */

/* KPI widget sizes */
.widget-kpis.widget-size-s { width: 200px; min-height: 120px; }
.widget-kpis.widget-size-m { width: 400px; min-height: 210px; }
.widget-kpis.widget-size-l { width: 540px; min-height: 300px; }

/* Chantiers widget sizes */
.widget-chantiers.widget-size-s { width: 200px; min-height: 120px; }
.widget-chantiers.widget-size-m { width: 380px; min-height: 240px; }
.widget-chantiers.widget-size-l { width: 480px; min-height: 320px; }

/* Alertes widget sizes */
.widget-alertes.widget-size-s { width: 200px; min-height: 120px; }
.widget-alertes.widget-size-m { width: 380px; min-height: 200px; }
.widget-alertes.widget-size-l { width: 480px; min-height: 280px; }

/* Calendar widget sizes */
.widget-calendar.widget-size-s { width: 260px; min-height: 200px; }
.widget-calendar.widget-size-m { width: 340px; min-height: 320px; }
.widget-calendar.widget-size-l { width: 420px; min-height: 400px; }

/* Factures widget sizes */
.widget-factures.widget-size-s { width: 220px; min-height: 120px; }
.widget-factures.widget-size-m { width: 380px; min-height: 240px; }
.widget-factures.widget-size-l { width: 480px; min-height: 320px; }

/* Chart widget sizes (pas de S) */
.widget-chart.widget-size-m { width: 500px; min-height: 280px; }
.widget-chart.widget-size-l { width: 620px; min-height: 340px; }

/* ════════════════════════════════════════
   WIDGET KPI
   ════════════════════════════════════════ */

/* Size S : single KPI */
.kpi-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 80px;
  text-align: center;
}

.kpi-single-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

.kpi-single-trend {
  font-size: 12px;
  font-weight: 500;
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-single-trend.up { color: var(--green); }

.kpi-trend-icon {
  width: 14px;
  height: 14px;
}

.kpi-single-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* KPI Grid (M / L) — widget Dashboard (composant distinct des app KPI) */
.w-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.w-kpi-card {
  padding: var(--space-3);
  border-radius: var(--radius-small);
  border: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.4);
  transition: background var(--duration-fast) var(--ease-ios);
}

.w-kpi-card-highlight {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: var(--white);
  border: none;
}

.w-kpi-card-highlight .kpi-label,
.w-kpi-card-highlight .kpi-sub {
  color: rgba(255, 255, 255, 0.85);
}

.w-kpi-card-highlight .kpi-value {
  color: var(--white);
}

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kpi-icon {
  width: 16px;
  height: 16px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.kpi-trend {
  font-size: 11px;
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-trend.up { color: var(--green); }

.kpi-sub {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Mini trend chart (size L) */
.kpi-trend-chart-container {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 0.5px solid var(--glass-border);
}

.kpi-trend-chart-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.kpi-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.kpi-trend-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 100%);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s var(--ease-ios);
}

.kpi-trend-chart-months {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
}

.kpi-trend-chart-months span {
  font-size: 9px;
  color: var(--gray-400);
  flex: 1;
  text-align: center;
}

/* ════════════════════════════════════════
   WIDGET CHANTIERS
   ════════════════════════════════════════ */

.chantiers-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 80px;
  text-align: center;
}

.chantiers-single-count {
  font-size: 40px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.chantiers-single-label {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: var(--space-1);
  font-weight: 500;
}

.chantiers-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chantier-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.3);
  border: 0.5px solid var(--glass-border);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-ios);
}

.chantier-row:hover {
  background: rgba(255, 255, 255, 0.6);
}

.chantier-row-client {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
}

.chantier-row-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chantier-row-name {
  font-size: 11px;
  color: var(--gray-600);
}

.chantier-row-date {
  font-size: 10px;
  color: var(--gray-500);
}

.chantier-row-statut {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  align-self: flex-start;
  margin-top: var(--space-1);
}

.badge-critical { background: #fee2e2; color: #dc2626; }
.badge-warning  { background: #fef3c7; color: #d97706; }
.badge-success  { background: #dcfce7; color: #16a34a; }
.badge-info     { background: #dbeafe; color: #2563eb; }

.chantiers-footer {
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 0.5px solid var(--glass-border);
}

/* ════════════════════════════════════════
   WIDGET ALERTES
   ════════════════════════════════════════ */

.alertes-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 80px;
  text-align: center;
}

.alertes-badge {
  font-size: 40px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}

.alertes-badge.alertes-badge-critical {
  color: var(--red);
}

.alertes-single-label {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: var(--space-1);
  font-weight: 500;
}

.alertes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.alerte-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.3);
  border: 0.5px solid var(--glass-border);
  border-left: 3px solid var(--orange);
}

.alerte-item.alerte-critical {
  border-left-color: var(--red);
  background: rgba(254, 226, 226, 0.3);
}

.alerte-icon {
  width: 18px;
  height: 18px;
  color: var(--orange);
  flex-shrink: 0;
}

.alerte-item.alerte-critical .alerte-icon {
  color: var(--red);
}

.alerte-content {
  flex: 1;
  min-width: 0;
}

.alerte-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 1px;
}

.alerte-detail {
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alerte-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  flex-shrink: 0;
}

.alertes-footer {
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 0.5px solid var(--glass-border);
}

/* ════════════════════════════════════════
   WIDGET FACTURES
   ════════════════════════════════════════ */

.factures-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 80px;
  text-align: center;
}

.factures-single-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--red);
  line-height: 1.1;
}

.factures-single-label {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: var(--space-1);
  font-weight: 500;
}

.factures-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.facture-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.3);
  border: 0.5px solid var(--glass-border);
  border-left: 3px solid var(--green);
}

.facture-row.urgence-retard {
  border-left-color: var(--red);
  background: rgba(254, 226, 226, 0.25);
}

.facture-row.urgence-bientot {
  border-left-color: var(--orange);
}

.facture-row-left {
  flex: 1;
  min-width: 0;
}

.facture-row-client {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
}

.facture-row-chantier {
  font-size: 10px;
  color: var(--gray-500);
}

.facture-row-right {
  text-align: right;
  flex-shrink: 0;
}

.facture-row-montant {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

.factures-retard {
  font-size: 10px;
  font-weight: 600;
  color: var(--red);
  display: block;
  margin-top: 1px;
}

.factures-bientot {
  color: var(--orange);
}

.factures-footer {
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 0.5px solid var(--glass-border);
}

/* ════════════════════════════════════════
   WIDGET CALENDRIER
   ════════════════════════════════════════ */

.cal-month-year {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: center;
  margin-bottom: var(--space-2);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: var(--space-1);
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 1px;
}

.cal-day {
  padding: 4px 0;
  font-size: 11px;
  color: var(--gray-700);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.cal-day:hover {
  background: rgba(90, 158, 53, 0.12);
}

.cal-day.other-month {
  color: var(--gray-300);
}

.cal-day.today {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

/* Events under calendar (M / L) */
.cal-events {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 0.5px solid var(--glass-border);
}

.cal-events-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.cal-event-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: 11px;
}

.cal-event-date {
  color: var(--gray-600);
  font-weight: 500;
  min-width: 100px;
  flex-shrink: 0;
}

.cal-event-title {
  color: var(--gray-800);
  flex: 1;
}

.cal-event-time {
  color: var(--gray-500);
  font-size: 10px;
  flex-shrink: 0;
}

.cal-events-more {
  font-size: 10px;
  color: var(--gray-500);
  text-align: center;
  margin-top: var(--space-1);
}

/* ════════════════════════════════════════
   WIDGET CHART (CA)
   ════════════════════════════════════════ */

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 160px;
  gap: var(--space-3);
  margin-top: var(--space-2);
  position: relative;
}

.widget-size-l .chart-bars {
  height: 180px;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  height: 100%;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green) 100%);
  border-radius: var(--radius-small) var(--radius-small) 0 0;
  transition: height var(--duration-normal) var(--ease-ios);
}

.chart-bar-objectif {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
  opacity: 0.6;
  pointer-events: none;
}

.chart-bar-label {
  font-size: 11px;
  color: var(--gray-600);
  font-weight: 500;
}

.chart-legend {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 0.5px solid var(--glass-border);
}

.chart-legend-item {
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-legend-dot-bar {
  background: var(--green);
}

.chart-legend-dot-objectif {
  background: var(--orange);
  opacity: 0.6;
}

/* ════════════════════════════════════════
   WIDGET HEURES (conservé en réserve)
   ════════════════════════════════════════ */

.widget-hours {
  width: 300px;
  min-height: 150px;
}

.widget-hours .widget-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100px;
  gap: var(--space-2);
}

.hours-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.hours-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--blue) 0%, #60a5fa 100%);
  border-radius: var(--radius-small) var(--radius-small) 0 0;
}

.hours-bar-label {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ════════════════════════════════════════
    PASTILLES ÉVÉNEMENTS CALENDRIER
    ════════════════════════════════════════ */

.cal-days .cal-day {
  position: relative;
}
.cal-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
  flex-wrap: wrap;
}
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
    ANIMATIONS DES WIDGETS
    ════════════════════════════════════════ */

@keyframes widgetFadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.widget {
  opacity: 0;
  animation: widgetFadeSlideUp 0.45s var(--ease-spring) forwards;
}

/* Stagger by widget type */
.widget-kpis      { animation-delay: 0.05s; }
.widget-chantiers { animation-delay: 0.12s; }
.widget-chart     { animation-delay: 0.19s; }
.widget-alertes   { animation-delay: 0.26s; }
.widget-factures  { animation-delay: 0.33s; }
.widget-calendar  { animation-delay: 0.40s; }
.widget-hours     { animation-delay: 0.47s; }

/* Chart bar fill grow */
@keyframes barGrow {
  from { height: 0; }
  to { height: var(--bar-target, 100%); }
}

.chart-bar-fill {
  animation: barGrow 0.6s var(--ease-spring) forwards;
}

.chart-bar:nth-child(1) .chart-bar-fill { animation-delay: 0.25s; }
.chart-bar:nth-child(2) .chart-bar-fill { animation-delay: 0.32s; }
.chart-bar:nth-child(3) .chart-bar-fill { animation-delay: 0.39s; }
.chart-bar:nth-child(4) .chart-bar-fill { animation-delay: 0.46s; }
.chart-bar:nth-child(5) .chart-bar-fill { animation-delay: 0.53s; }
.chart-bar:nth-child(6) .chart-bar-fill { animation-delay: 0.60s; }

/* Hours bar fill grow (same as barGrow) */
.hours-bar-fill {
  animation: barGrow 0.5s var(--ease-spring) forwards;
}

.hours-bar:nth-child(1) .hours-bar-fill { animation-delay: 0.35s; }
.hours-bar:nth-child(2) .hours-bar-fill { animation-delay: 0.42s; }
.hours-bar:nth-child(3) .hours-bar-fill { animation-delay: 0.49s; }
.hours-bar:nth-child(4) .hours-bar-fill { animation-delay: 0.56s; }
.hours-bar:nth-child(5) .hours-bar-fill { animation-delay: 0.63s; }

/* Alert slide-in */
@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alerte-item {
  animation: alertSlideIn 0.4s var(--ease-ios) forwards;
  opacity: 0;
}

.alerte-item:nth-child(1) { animation-delay: 0.40s; }
.alerte-item:nth-child(2) { animation-delay: 0.50s; }
.alerte-item:nth-child(3) { animation-delay: 0.60s; }
.alerte-item:nth-child(4) { animation-delay: 0.70s; }

/* KPI value pop */
@keyframes kpiPop {
  0% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.kpi-value,
.kpi-single-value {
  animation: kpiPop 0.3s var(--ease-spring) forwards;
  opacity: 0;
}

.kpi-card:nth-child(1) .kpi-value,
.kpi-single .kpi-single-value { animation-delay: 0.50s; }
.kpi-card:nth-child(2) .kpi-value { animation-delay: 0.58s; }
.kpi-card:nth-child(3) .kpi-value { animation-delay: 0.66s; }
.kpi-card:nth-child(4) .kpi-value { animation-delay: 0.74s; }

/* Calendar today pulse */
@keyframes todayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(90, 158, 53, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(90, 158, 53, 0.15); }
}

.cal-day.today {
  animation: todayPulse 2s ease-in-out infinite;
}

/* Chantier row slide-in */
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chantier-row {
  animation: rowSlideIn 0.35s var(--ease-ios) forwards;
  opacity: 0;
}

.chantier-row:nth-child(1) { animation-delay: 0.25s; }
.chantier-row:nth-child(2) { animation-delay: 0.33s; }
.chantier-row:nth-child(3) { animation-delay: 0.41s; }
.chantier-row:nth-child(4) { animation-delay: 0.49s; }

/* Facture row slide-in */
.facture-row {
  animation: rowSlideIn 0.35s var(--ease-ios) forwards;
  opacity: 0;
}

.facture-row:nth-child(1) { animation-delay: 0.25s; }
.facture-row:nth-child(2) { animation-delay: 0.33s; }
.facture-row:nth-child(3) { animation-delay: 0.41s; }
.facture-row:nth-child(4) { animation-delay: 0.49s; }

/* KPI highlight shimmer */
@keyframes shimmerHighlight {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.kpi-card-highlight {
  position: relative;
  overflow: hidden;
}

.kpi-card-highlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerHighlight 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: var(--radius-small);
}

/* ════════════════════════════════════════
   MODE ÉDITION
   ════════════════════════════════════════ */

.edit-mode-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.widget .widget-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--white);
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.widget.edit-mode .widget-delete-btn {
  display: flex;
}

.widget .widget-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  z-index: 5;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px 0 0 0;
  border-top: 0.5px solid var(--glass-border);
  border-left: 0.5px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-ios),
              background var(--duration-fast) var(--ease-ios);
}

.widget:hover .widget-resize-handle {
  opacity: 1;
}

.widget .widget-resize-handle:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--gray-700);
}

/* Error state */
.widget-error {
  padding: var(--space-4);
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

/* Mobile: hide desktop widgets */
@media (max-width: 767px) {
  .widgets-container {
    display: none;
  }
}
