/**
 * Dashboard V2 - CSS isolé
 * Préfixe: dv2-
 * Réutilise les classes existantes du dashboard pour les widgets
 */

/* ═══════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════ */

.dv2-dashboard-wrapper {
  position: relative;
  align-self: flex-start; /* Fix Bug 2: Prevent the entire dashboard from centering upwards and overlapping the navbar when it has many widgets */
}

.dv2-dashboard-content {
  transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 80px; /* Force the entire layout to clear the global navbar */
  box-sizing: border-box; /* Ensure padding squashes content rather than expanding width */
}

.dv2-dashboard-wrapper.dv2-editing .dv2-dashboard-content {
  padding-left: 334px; /* Squash the center column to make room for the personalize panel */
}

.dashboard-header-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

/* Override original welcome banner for V2 context */
.dv2-dashboard-content .dashboard-welcome-banner,
.dv2-dashboard-content .dashboard-stats-bar {
  margin: 0 !important;
  padding: 24px !important;
  background: var(--bg-card) !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important; /* Matches .dv2-widget-block */
  border-radius: 16px !important; /* Matches .dv2-widget-block */
  overflow: hidden;
}

.dv2-dashboard-content .dashboard-stats-bar {
  padding: 4px 12px !important; /* Restore exactly V1 padding */
  min-height: 52px !important; /* Restore exactly V1 height */
  border-radius: 12px !important; /* Match V1 smaller radius */
}

/* Subtle placeholders for hidden elements */
.dv2-header-ghost {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ═══════════════════════════════════════
   SIDEBAR UNIFICATION
   ═══════════════════════════════════════ */

.dashboard-sidebar-left {
  flex: 0 0 320px !important;
  width: 320px !important;
  max-width: 320px !important;
  transition: all 0.3s ease;
  margin-left: 24px;
}

.dashboard-sidebar-right {
  flex: 0 0 320px !important;
  width: 320px !important;
  max-width: 320px !important;
  transition: all 0.3s ease;
  margin-right: 24px;
}

/* Ensure main content takes remaining space correctly */
.dashboard-main {
  flex: 1;
  min-width: 0;
  padding: 0 24px;
}

/* ═══════════════════════════════════════
   INERT MODE (links disabled in edit mode)
   ═══════════════════════════════════════ */

.dv2-inert {
  pointer-events: none;
  opacity: 0.7;
  filter: grayscale(0.15);
}

.dv2-inert::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: not-allowed;
}

.dv2-inert {
  position: relative;
}

/* ═══════════════════════════════════════
   FLOATING EDIT BUTTON (FAB)
   ═══════════════════════════════════════ */

.dv2-fab-edit {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dv2-fab-edit:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.dv2-fab-edit.active {
  background: var(--danger-color, #f44336);
}

/* ═══════════════════════════════════════
   CUSTOMIZATION ASIDE PANEL
   ═══════════════════════════════════════ */

.dv2-customize-panel {
  position: fixed;
  top: 45px;
  left: 0;
  bottom: 0;
  width: 310px;
  background: var(--bg-card);
  border-right: 2px solid var(--border-color);
  z-index: 999;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dv2-slide-enter-active,
.dv2-slide-leave-active {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dv2-slide-enter-from,
.dv2-slide-leave-to {
  transform: translateX(-100%);
}

.dv2-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.dv2-panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.dv2-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.dv2-panel-close:hover {
  background: var(--danger-color, #f44336);
  color: white;
}

/* Toggle row */
.dv2-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.dv2-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ═══════════════════════════════════════
   WIDGETS POOL (DRAGGABLE MINIATURES)
   ═══════════════════════════════════════ */

.dv2-panel-widgets-pool {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
  min-height: 50px;
}

.dv2-mini-widget {
  background: var(--bg-secondary);
  border: 1.5px dashed var(--border-color);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
  overflow: hidden; /* Hide any full widget content if dropped here */
  position: relative;
  min-height: 80px;
}

/* Ensure only the intended icon and span are visible in case of DOM debris during drag */
.dv2-mini-widget > *:not(i):not(span) {
  display: none !important;
}

.dv2-mini-widget:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dv2-mini-widget i {
  font-size: 1.5rem;
  color: var(--primary);
}

.dv2-mini-widget span {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.1;
}

/* Ghost for miniatures */
.dv2-mini-ghost {
  opacity: 0.4;
  border-style: solid;
  border-color: var(--primary);
}

/* ═══════════════════════════════════════
   GHOST TRANSITION (Full to Mini)
   ═══════════════════════════════════════ */

/* Default: hidden inside full widgets */
.dv2-mini-ghost-info {
  display: none;
}

/* When a full widget becomes a placeholder inside the miniature pool */
.dv2-panel-widgets-pool .dv2-widget-block,
.dv2-panel-widgets-pool .dv2-ghost {
  max-width: 130px !important;
  max-height: 80px !important;
  margin: 0 !important;
  border: 1.5px dashed var(--primary) !important;
  border-radius: 12px !important;
  background: var(--bg-secondary) !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dv2-panel-widgets-pool .dv2-widget-block > *:not(.dv2-mini-ghost-info),
.dv2-panel-widgets-pool .dv2-ghost > *:not(.dv2-mini-ghost-info) {
  display: none !important;
}

.dv2-panel-widgets-pool .dv2-mini-ghost-info {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-primary);
  width: 100%;
  height: 100%;
}

.dv2-panel-widgets-pool .dv2-mini-ghost-info i {
  font-size: 1.4rem;
  color: var(--primary);
  display: block !important;
}

.dv2-panel-widgets-pool .dv2-mini-ghost-info span {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  display: block !important;
}

/* ═══════════════════════════════════════
   CONTEXT MENU (Right Click)
   ═══════════════════════════════════════ */

.dv2-context-menu {
  position: fixed;
  z-index: 2000;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  min-width: 180px;
  animation: dv2-menu-pop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

@keyframes dv2-menu-pop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dv2-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dv2-menu-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.dv2-menu-item.danger:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.dv2-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.4rem 0;
}

.dv2-toggle-row span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* KPI sub-toggles */
.dv2-kpi-subtoggle {
  margin-top: 0.5rem;
  padding: 0.65rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.dv2-kpi-subtoggle-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.dv2-toggle-row-sm {
  padding: 0.15rem 0;
  font-size: 0.8rem;
}
.dv2-toggle-row-sm input[type="checkbox"] {
  width: 14px;
  height: 14px;
}
.dv2-kpi-privacy-hint {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Panel sections */
.dv2-panel-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.dv2-panel-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dv2-panel-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.4rem 0;
}

/* Available widget */
.dv2-panel-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.dv2-panel-widget span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}

.dv2-panel-add-btns {
  display: flex;
  gap: 0.2rem;
}

.dv2-panel-add-btns button {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 700;
  transition: all 0.2s;
}

.dv2-panel-add-btns button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Widget item in column config */
.dv2-panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  border-left: 3px solid var(--primary);
}

.dv2-panel-item span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}

.dv2-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: rgba(255, 0, 0, 0.1);
  color: var(--danger-color, #f44336);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dv2-remove:hover {
  background: var(--danger-color, #f44336);
  color: white;
}

/* Panel actions */
.dv2-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.dv2-btn-save {
  width: 100%;
  padding: 0.7rem;
  border: none;
  background: var(--success-color, #4caf50);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.dv2-btn-save:hover {
  filter: brightness(1.1);
}

.dv2-btn-save:disabled {
  opacity: 0.6;
  cursor: wait;
}

.dv2-btn-reset {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.dv2-btn-reset:hover {
  background: var(--border-color);
}

/* ═══════════════════════════════════════
   DRAG & DROP (Sortable)
   ═══════════════════════════════════════ */

.dv2-sortable-zone {
  min-height: 100px;
  padding: 0.5rem;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  transition: min-height 0.3s ease;
}

.dv2-editing .dv2-sortable-zone {
  min-height: calc(100vh - 160px);
}

.dv2-widget-block {
  position: relative;
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.dv2-widget-block.dv2-widget-allow-overflow {
  overflow: visible !important;
}

/* Fix "double card" effect: flatten inner widgets */
.dv2-widget-block .antenna-widget,
.dv2-widget-block .week-planning-widget,
.dv2-widget-block .changelog-widget,
.dv2-widget-block .dv2-player-tv-widget,
.dv2-widget-block .ms-widget,
.dv2-widget-block .ft-widget,
.dv2-widget-block .chatel-widget,
.dv2-widget-block .notes-widget,
.dv2-widget-block .fm-sidebar-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
}

.dv2-widget-editing {
  border: 2px dashed var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 59, 130, 246), 0.1);
}

.dv2-drag-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark, #2563eb) 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dv2-drag-handle:active {
  cursor: grabbing;
}

.dv2-drag-hint {
  font-size: 0.65rem;
  opacity: 0.8;
  font-weight: 400;
}

.dv2-ghost {
  opacity: 0.2;
  border: 2px dashed var(--primary) !important;
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.05);
}

.dv2-dragging {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.02) rotate(1deg);
  z-index: 9999;
}

/* ═══════════════════════════════════════
   PLANNING WIDGET REFINEMENTS
   ═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   FOREIGN TARIFF (TARIFS MONDE) REFINEMENTS
   ═══════════════════════════════════════ */

.ft-select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  outline: none;
}

.ft-select:hover {
  border-color: var(--primary);
}

.ft-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}


.ft-foreign-tariff .fm-plan-card-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.ft-foreign-tariff .fm-plan-card,
.ft-foreign-tariff .fm-plan-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}


.ft-foreign-tariff .fm-plan-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  text-align: center;
}

.ft-foreign-tariff .fm-plan-card-body {
  padding: 0.5rem 1rem 1rem;
}

.ft-plan-details {
  display: flex;
  flex-direction: column;
}

.ft-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.ft-row:last-of-type {
  border-bottom: none;
}

.ft-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ft-label i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.ft-value {
  font-weight: 700;
  color: var(--free-red, #d40000); /* Values are red by default like official Free mobile FIS */
}

.ft-value.ft-val-included, 
.ft-value.ft-val-unlimited {
  color: #10b981;
}

.ft-data-penalty {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.6;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--border-color);
}

.ft-btn-group {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  border: none;
  box-shadow: inset 0 0 0 1px var(--border-color); /* Inset shadow to prevent clipping */
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  background-clip: padding-box;
}

.ft-btn-split {
  flex: 1;
  padding: 10px;
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
}

.ft-btn-split:first-child::after {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border-color);
}



.ft-btn-split:hover {
  background: var(--bg-hover);
  color: var(--free-red, #d40000);
}

.ft-btn-split i {
  font-size: 1rem;
}

.wp-shift-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;
  border-left: 4px solid rgba(0, 0, 0, 0.1);
  transition: opacity 0.2s;
  min-height: 48px;
}

.wp-shift-info {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  line-height: 1.3;
}

.wp-shift-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
  min-width: 0 !important;
}

.wp-shift-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.wp-shift-time {
  font-size: 13px !important;
  font-weight: 600 !important;
  opacity: 0.95 !important;
}

.wp-shift-footer {
  /* wp-shift-break equivalent */
  font-size: 12px !important;
  font-weight: 500 !important;
  opacity: 0.8 !important;
  margin-top: 0 !important;
}

.wp-shift-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.wp-shift-card.is-off,
.wp-shift-card.is-conge {
  background: repeating-linear-gradient(45deg,
      #1a1a24,
      #1a1a24 10px,
      #22222e 10px,
      #22222e 20px) !important;
  border-left: none !important;
  color: #ffffff !important;
  transition: none !important;
  font-weight: 700 !important;
  justify-content: center !important;
}

/* ═══════════════════════════════════════
   PLAYER TV WIDGET
   ═══════════════════════════════════════ */

.dv2-player-tv-widget {
  overflow: hidden;
  border: none;
}

.dv2-player-tv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0.75rem;
}

.dv2-player-tv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: none;
  cursor: pointer;
}

.dv2-player-tv-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.dv2-player-tv-item span {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   WELCOME WIDGET
   ═══════════════════════════════════════ */

.dv2-welcome-widget {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.dv2-faded {
  opacity: 0.4;
  filter: grayscale(0.3);
}

.dv2-hidden-welcome-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

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

@media (max-width: 1024px) {
  .dv2-dashboard-wrapper.dv2-editing .dv2-dashboard-content {
    padding-left: 0; /* Reset squash on mobile */
  }

  .dv2-customize-panel {
    width: 100%;
    position: relative;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
    box-shadow: none;
    max-height: 50vh;
  }
}

@media (max-width: 768px) {
  .dv2-fab-edit {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .dv2-player-tv-item img {
    width: 36px;
    height: 36px;
  }
}

/* ═══════════════════════════════════════
   NEW WIDGETS (Sales, Notes, Tools)
   ═══════════════════════════════════════ */

.ms-widget-body {
  padding: 1rem;
}

.ms-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.ms-form-group.full-width {
  grid-column: span 2;
}

.ms-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ms-form-group input,
.ms-form-group select,
.ms-form-group textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s;
  height: 38px;
  /* Force consistent height */
  box-sizing: border-box;
}

.ms-form-group textarea {
  height: auto;
  min-height: 38px;
}

.ms-form-group input:focus,
.ms-form-group select:focus,
.ms-form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--bg-card);
}

.ms-submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--primary) !important;
  color: var(--text-inverse, #ffffff) !important;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
}

.ms-submit-btn span {
  color: #ffffff !important;
}

.ms-submit-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb, 59, 130, 246), 0.4);
}

.ms-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ms-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ms-form-success {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(var(--success-rgb, 76, 175, 80), 0.1);
  color: var(--success-color, #4caf50);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.ms-form-error {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(var(--danger-rgb, 244, 67, 54), 0.1);
  color: var(--danger-color, #f44336);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* Quick Note - Premium Design */
.quick-note-widget {
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.quick-note-tabs {
  display: flex;
  gap: 4px; /* Reduced gap */
  background: var(--bg-secondary);
  padding: 3px; /* Reduced padding */
  border-radius: 8px;
}

.quick-note-tabs button {
  width: 28px; /* Significantly reduced from 36px to match standard header height */
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.quick-note-tabs button.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-note-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.qn-title-input {
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: 0 !important;
  padding: 8px 0 !important;
  color: var(--text-main) !important;
}

.qn-title-input:focus {
  border-bottom-color: var(--primary) !important;
}

.qn-content-input {
  resize: none;
  min-height: 100px;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 12px !important;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.2s;
  color: var(--text-main) !important;
}

.qn-content-input:focus {
  background: var(--bg-card) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Chatel / Foreign Result Box */
.qn-chatel-box,
.ft-res-box {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ft-large-res .ft-res-grid {
  gap: 10px;
}

.ft-res-sep {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.ft-copy-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.ft-copy-btn {
  padding: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;

  /* Foreign Tariff - FreeMobile Style */
  .ft-plans-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
  }

  .ft-plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s;
  }

  .ft-plan-card-header {
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .ft-plan-name {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
  }

  .ft-plan-badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .ft-plan-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ft-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
  }

  .ft-plan-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
  }

  .ft-plan-row-label i {
    font-size: 1.1rem;
    color: var(--primary);
    opacity: 0.8;
  }

  .ft-plan-row-value {
    font-weight: 700;
    color: var(--text-primary);
  }

  /* Value variants from FreeMobile.js */
  .ft-val-unlimited {
    color: var(--primary);
  }

  .ft-val-included {
    color: var(--success-color, #4caf50);
  }

  .ft-val-paid {
    color: #f39c12;
  }

  .ft-plan-row.italic {
    font-style: italic;
    font-size: 0.75rem;
    margin-top: -4px;
    padding-left: 28px;
  }

  .ft-plan-sep {
    height: 1px;
    border-top: 1px dashed var(--border-color);
    margin: 4px 0;
  }

  .ft-plan-copy-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .ft-plan-copy-btn {
    padding: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
  }

  .ft-plan-copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .ft-placeholder {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Responsiveness fix for mobile sales grid in sidebar */
  .ms-form-grid {
    grid-template-columns: 1fr !important;
    /* Force 1 col in sidebar by default for safety */
  }

  @media (min-width: 300px) {
    .ms-form-grid {
      grid-template-columns: repeat(2, 1fr) !important;
    }
  }

  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.ft-copy-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}


.ft-loading {
  padding: 1rem;
  text-align: center;
  color: var(--primary);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   PERFORMANCE & SKELETONS
   ═══════════════════════════════════════ */

@keyframes dv2-pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

.dv2-skeleton {
  background: var(--bg-hover);
  border-radius: 4px;
  animation: dv2-pulse 1.5s infinite ease-in-out;
  pointer-events: none;
}

.dv2-skeleton-label {
  height: 12px;
  width: 60%;
  margin-bottom: 8px;
}

.dv2-skeleton-value {
  height: 24px;
  width: 40%;
}

.dv2-skeleton-item {
  height: 60px;
  width: 100%;
  margin-bottom: 12px;
  border-radius: 12px;
}

.dv2-skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.dv2-skeleton-header {
  height: 20px;
  width: 140px;
  margin-bottom: 16px;
}

.dv2-skeleton-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.dv2-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dv2-skeleton-line {
  flex: 1;
  height: 12px;
  background: var(--bg-hover);
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   TEMPLATES & MODALS
   ═══════════════════════════════════════ */

.dv2-templates-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.dv2-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dv2-template-item:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateX(4px);
}

.dv2-template-item.is-active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.15);
}

.dv2-template-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.dv2-template-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.dv2-badge-public,
.dv2-badge-private {
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 12px;
  width: fit-content;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.dv2-badge-public {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.dv2-badge-private {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.dv2-btn-delete-template {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dv2-btn-delete-template:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

.dv2-btn-add-template {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s;
}

.dv2-btn-add-template:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
}

/* Modal System */
.dv2-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.dv2-modal-card {
  background: var(--bg-card);
  width: 90%;
  max-width: 420px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: dv2-modal-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dv2-modal-pop {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.dv2-modal-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.dv2-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.dv2-modal-header button {
  background: var(--bg-secondary);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dv2-modal-header button:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.dv2-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dv2-field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dv2-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dv2-field input[type="text"] {
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.dv2-field input[type="text"]:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.dv2-field-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dv2-field-inline:hover {
  background: var(--bg-tertiary);
}

.dv2-field-inline input {
  accent-color: var(--primary);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.dv2-modal-footer {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg-secondary);
}

.dv2-btn-cancel {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.dv2-btn-cancel:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

.dv2-btn-save-confirm {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: var(--text-inverse);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.dv2-btn-save-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.dv2-btn-save-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.dv2-btn-cancel-update {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.dv2-btn-cancel-update:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

@keyframes dv2-pulse-primary {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
  }
}

.pulse-primary {
  animation: dv2-pulse-primary 2s infinite;
}


/* Game Center Widget Styling - Compact 3-col Square */
.game-center-widget.dv2-widget-card {
  height: 100%;
}

.game-library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}

.game-card-mini {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.game-card-mini:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.game-banner-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.game-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(var(--primary-rgb), 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.game-card-mini:hover .game-banner-overlay {
  opacity: 1;
}

.game-banner-overlay i {
  font-size: 1.8rem;
  color: white;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
}

/* FreeField Widget Styling - Full Visibility + Smooth Transition */
.free-field-widget.dv2-widget-card .wp-body {
  height: 540px;
  padding: 0;
  background: #000;
  overflow: hidden;
  opacity: 1;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    border-top 0.4s ease;
  border-top: 1px solid var(--border-color);
}

.free-field-widget.is-collapsed .wp-body {
  height: 0 !important;
  opacity: 0 !important;
  border-top: none !important;
  pointer-events: none;
}

.btn-eye-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.btn-eye-toggle i {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s ease;
}

/* Eye off specific color and rotation in collapsed state */
.free-field-widget.is-collapsed .btn-eye-toggle i {
  transform: rotate(180deg);
}

.free-field-widget.is-collapsed .btn-eye-toggle:not(:hover) i {
  color: var(--primary);
}

/* Ensure white icon on hover regardless of state */
.btn-eye-toggle:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff !important;
}

.btn-eye-toggle:hover i {
  color: #ffffff !important;
}

.game-full-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.game-iframe-isolated {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* KPI & Stats Widget */
.kpi-stats-widget .dv2-widget-body {
    padding: 1.25rem;
    transition: opacity 0.3s;
}
.kpi-stats-widget.is-loading .dv2-widget-body {
    opacity: 0.5;
    pointer-events: none;
}
.kpi-automated-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(142, 114, 243, 0.1);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.kpi-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.kpi-input-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.kpi-input-group input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}
.kpi-input-group input:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}
.kpi-input-group .lock-icon {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 1rem;
}
.kpi-import-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.kpi-import-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(142, 114, 243, 0.05);
}

.kpi-loader,
.kpi-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    gap: 15px;
    color: var(--text-muted);
}

.kpi-loader i {
    font-size: 2rem;
    color: var(--primary);
}

.kpi-empty-state i {
    font-size: 2rem;
    color: var(--danger-color, #ef4444);
}

.kpi-empty-state p {
    font-size: 0.85rem;
    max-width: 200px;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 1.5s linear infinite;
}

.kpi-input-group.is-locked input {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: default;
}

/* ═══════════════════════════════════════
   GLOBAL WIDGET DESIGN SYSTEM (DV2)
   ═══════════════════════════════════════ */

.dv2-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    min-height: 58px;
    border-radius: 16px 16px 0 0; /* Match parent block radius to prevent bleeding */
}

.dv2-widget-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.dv2-icon-box {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    color: var(--primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Premium Date Selector (Capsule) */
.dv2-date-capsule-premium {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px 12px;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.dv2-date-capsule-premium:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

/* Premium Custom Dropdown */
.kpi-custom-select {
    position: relative;
    user-select: none;
}

.kpi-select-trigger {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border-radius: 6px;
}

.kpi-select-trigger:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.kpi-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 120px;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
}

.kpi-select-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.kpi-select-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.kpi-select-item.active {
    background: var(--primary);
    color: white;
}

.animate-pop {
    animation: kpiPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kpiPop {
    from { transform: translateX(-50%) scale(0.9); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.dv2-capsule-sep {
    color: var(--border-color);
    font-weight: 300;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════
   WIDGET SPECIFICS (KPI / STATS)
   ═══════════════════════════════════════ */

.kpi-body-top {
    padding: 12px 20px;
    display: flex;
    justify-content: center;
}

/* Reduced gap between header line and content */
.dv2-widget-header + .dv2-widget-body .kpi-body-top {
    padding-top: 4px;
}

.kpi-date-sep {
    color: var(--border-color);
    margin: 0 4px;
    font-size: 0.8rem;
    font-weight: 300;
}

/* PREMIUM IMPORT BUTTON */
.kpi-import-btn-premium {
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

.kpi-import-btn-premium i:first-child {
    font-size: 1.2rem;
    color: var(--primary);
}

.kpi-import-btn-premium span {
    flex: 1;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.kpi-import-btn-premium i:last-child {
    font-size: 1rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

.kpi-import-btn-premium:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.kpi-import-btn-premium:hover i:last-child {
    transform: translateX(4px);
    opacity: 1;
    color: var(--primary);
}

/* Modal Import Stats */
.import-stats-modal {
    max-width: 600px !important;
}
.import-section {
    margin-bottom: 1.5rem;
}
.import-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.import-textarea {
    width: 100%;
    height: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-main);
    resize: vertical;
}
.import-status {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.import-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}
.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}
.mapping-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 0.85rem;
}
.pasted-name {
    flex: 1;
    font-weight: 600;
}
.mapping-item select {
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-main);
}

/* ═══════════════════════════════════════
   MANAGEMENT SALES WIDGET
   ═══════════════════════════════════════ */

.ms-management-widget .ms-refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: all 0.2s;
  font-size: 1.1rem;
}

.ms-management-widget .ms-refresh-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.ms-management-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-management-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.ms-management-item:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Info Section */
.ms-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ms-item-info .ms-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 38px;
  font-weight: 600;
}

.ms-item-info .ms-advisor {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px; /* Increased now that ID is gone */
}

/* Actions Section */
.ms-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.ms-btn-action {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.ms-btn-reveal {
  background: #6366f1; /* Indigo */
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.ms-btn-approve {
  background: var(--success);
  box-shadow: 0 0 8px rgba(var(--success-rgb), 0.25);
}

.ms-btn-refuse {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.25);
}

.ms-btn-action:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

/* Admin Section and Widgets in Pool */
.dv2-admin-section {
    border-top: 2px solid var(--primary-light);
    background: rgba(var(--primary-rgb), 0.03);
    border-radius: 0 0 12px 12px;
    margin-top: 8px;
}

.dv2-admin-section h4 {
    color: var(--primary) !important;
}

.dv2-mini-widget.admin-widget {
    border-style: solid;
    border-color: var(--primary-light);
    background: rgba(var(--primary-rgb), 0.05);
}

.dv2-mini-widget.admin-widget i {
    color: var(--primary);
}

[data-theme="dark"] .dv2-admin-section {
    background: rgba(var(--primary-rgb), 0.08);
}

.ms-empty, .ms-loading, .ms-error {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.ms-empty i {
  font-size: 2rem;
  color: var(--success);
  opacity: 0.6;
}

.game-full-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.game-iframe-isolated {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* ═══ FREEFIELD HARVEST NOTIFICATION ═══ */
.ff-harvest-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--ff-notif-from, #3b82f6) 0%, var(--ff-notif-to, #1d4ed8) 100%);
  border: 2px solid var(--ff-notif-border, rgba(147, 197, 253, 0.6));
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px var(--ff-notif-shadow, rgba(59, 130, 246, 0.35));
  cursor: pointer;
  z-index: 9990;
  max-width: 320px;
  color: var(--ff-notif-text, #ffffff);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ff-harvest-notification:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--ff-notif-shadow, rgba(59, 130, 246, 0.5));
}

.ff-notif-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  animation: harvest-notif-bounce 2s ease-in-out infinite;
}

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

.ff-notif-title {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
}

.ff-notif-message {
  font-size: 0.78rem;
  opacity: 0.9;
  line-height: 1.3;
}

.ff-notif-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 6px;
  color: white;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s;
  padding: 0;
}

.ff-notif-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Vue transition */
.ff-notif-slide-enter-active { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease; }
.ff-notif-slide-leave-active { transition: transform 0.25s ease, opacity 0.2s ease; }
.ff-notif-slide-enter-from,
.ff-notif-slide-leave-to { transform: translateX(380px); opacity: 0; }

@keyframes harvest-notif-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@media (max-width: 640px) {
  .ff-harvest-notification {
    bottom: 16px;
    right: 16px;
    max-width: calc(100vw - 48px);
  }
}

/* ═══ GAME CENTER WIDGET BADGE ═══ */
.ff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--ff-notif-from, #3b82f6) 0%, var(--ff-notif-to, #1d4ed8) 100%);
  color: var(--ff-notif-text, #ffffff);
  padding: 3px 9px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 8px;
  letter-spacing: 0.3px;
  animation: badge-pulse 2s ease-in-out infinite;
  box-shadow: 0 2px 8px var(--ff-notif-shadow, rgba(59, 130, 246, 0.3));
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}