/* Quick Actions Panel - Ultra Compact Design */

/* ========================================
   CRITICAL: FULL WIDTH FORCED LAYOUT
   Эти правила должны быть в начале файла
   для максимального приоритета
   ======================================== */

/* Глобальный override для quick-actions-container */
#quick-actions-container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
  flex: 1 !important;  /* Растягиваем в flex-родителе */
}

/* Все дочерние элементы также на полную ширину */
#quick-actions-container > * {
  max-width: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.quick-actions-panel {
  background: var(--color-bg-elevated, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.quick-actions-title {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-primary, #111827);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Balance Overview Section - ULTRA Компактная сетка */
.balance-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.balance-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--color-bg-elevated, #ffffff);
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 5px;
  transition: all 0.2s ease;
  position: relative;
}

.balance-card:hover {
  border-color: var(--color-primary, #8b5cf6);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
  transform: translateY(-1px);
}

.balance-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.balance-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary, #111827);
  line-height: 1.1;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.balance-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary, #9ca3af);
  margin-left: 2px;
}

.balance-hint {
  font-size: 8.5px;
  font-weight: 400;
  color: var(--color-text-muted, #9ca3af);
  line-height: 1.2;
  margin-top: 1px;
}

/* Цвета для разных типов баланса - используем акценты */
.balance-total {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, transparent 100%);
}

.balance-total .balance-value {
  color: #8b5cf6;
}

.balance-plan {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
}

.balance-plan .balance-value {
  color: #3b82f6;
}

.balance-bonus {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.03) 0%, transparent 100%);
}

.balance-bonus .balance-value {
  color: #22c55e;
}

.balance-purchased {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, transparent 100%);
}

.balance-purchased .balance-value {
  color: #f59e0b;
}

/* Actions Grid - 4 колонки для максимальной компактности */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.quick-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-bg-elevated, #ffffff);
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.quick-action-group:hover {
  border-color: var(--color-border-hover, #d1d5db);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-action-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary, #111827);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  letter-spacing: -0.01em;
}

.action-hint {
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.3;
}

.quick-action-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Input with label wrapper */
.input-with-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  letter-spacing: 0.01em;
}

.field-hint {
  font-size: 9px;
  font-weight: 400;
  color: var(--color-text-muted, #9ca3af);
  line-height: 1.3;
  margin-top: -2px;
}

.quick-input {
  padding: 7px 10px;
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 5px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg, #ffffff);
  color: var(--color-text-primary, #111827);
  transition: all 0.2s ease;
  width: 100%;
  font-weight: 500;
}

.quick-input:hover {
  border-color: var(--color-border-hover, #d1d5db);
}

.quick-input:focus {
  outline: none;
  border-color: var(--color-primary, #8b5cf6);
  background: var(--color-bg, #ffffff);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.quick-input::placeholder {
  color: var(--color-text-muted, #9ca3af);
  font-size: 12px;
  font-weight: 400;
}

.quick-select {
  padding: 7px 10px;
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 5px;
  font-size: 12px;
  background: var(--color-bg, #ffffff);
  color: var(--color-text-primary, #111827);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  width: 100%;
}

.quick-select:hover {
  border-color: var(--color-border-hover, #d1d5db);
}

.quick-select:focus {
  outline: none;
  border-color: var(--color-primary, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Buttons - компактный дизайн */
.btn-quick {
  padding: 7px 14px;
  border: 2px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.01em;
  width: 100%;
  min-height: 34px;
}

/* Primary button - фиолетовый акцент */
.btn-quick.btn-primary {
  background: var(--color-primary, #8b5cf6);
  color: white;
  border-color: var(--color-primary, #8b5cf6);
}

.btn-quick.btn-primary:hover:not(:disabled) {
  background: #7c3aed;
  border-color: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Success button - зеленый */
.btn-quick.btn-success {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

.btn-quick.btn-success:hover:not(:disabled) {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Warning button - желтый */
.btn-quick.btn-warning {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.btn-quick.btn-warning:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Danger button - красный */
.btn-quick.btn-danger {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
}

.btn-quick.btn-danger:hover:not(:disabled) {
  background: #ef4444;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-quick:active:not(:disabled) {
  transform: translateY(0px);
}

.btn-quick:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-quick.loading {
  position: relative;
  color: transparent !important;
}

.btn-quick .spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.user-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid;
}

.user-status.status-active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.user-status.status-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border-color: rgba(107, 114, 128, 0.3);
}

.user-status.status-banned {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Focus states */
.btn-quick:focus-visible {
  outline: 2px solid var(--color-primary, #8b5cf6);
  outline-offset: 2px;
}

.quick-input:focus-visible,
.quick-select:focus-visible {
  outline: 2px solid var(--color-primary, #8b5cf6);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (min-width: 1800px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1800px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1400px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .balance-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
  
  .balance-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .quick-actions-panel {
    padding: 14px;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-group {
    padding: 12px;
  }

  .balance-overview {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .balance-card {
    padding: 10px;
  }
  
  .balance-value {
    font-size: 16px;
  }
}

/* ========================================
   FULL WIDTH LAYOUT
   Профессиональная каскадность через специфичность
   ======================================== */

/* Quick Actions Container - принудительная полная ширина */
#quick-actions-container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Quick Actions - полная ширина через специфичный селектор */
.page-content#user-details-page #quick-actions-container,
.page-content#user-details-page .quick-actions-panel,
.page-content#user-details-page .quick-actions-grid,
.page-content#user-details-page .balance-overview {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
