.topbar {
  height: 68px;
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-accent-success-light);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-success-dark);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: var(--shadow-button-hover), 0 1px 0 rgba(255,255,255,0.2) inset;
  transform: translateY(-1px);
}

.btn-primary:active {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: var(--shadow-button-active), 0 1px 0 rgba(255,255,255,0.15) inset;
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #94a3b8;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary:active {
  background: var(--color-bg-tertiary);
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}

.btn-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: var(--shadow-button), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-info:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: var(--shadow-md), 0 1px 0 rgba(255,255,255,0.2) inset;
  transform: translateY(-1px);
}

.btn-info:active {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: var(--shadow-button-hover), 0 1px 0 rgba(255,255,255,0.2) inset;
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-button), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: var(--shadow-button-hover), 0 1px 0 rgba(255,255,255,0.2) inset;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm svg {
  width: 16px;
  height: 16px;
}

.card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.card-title-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--color-accent-danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder {
  color: var(--color-text-tertiary);
}

.form-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-active);
  color: var(--color-text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 1001;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: var(--color-text-inverse);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: var(--color-text-inverse);
}

.toast.info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: var(--color-text-inverse);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.sales-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.sales-stat {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.sales-stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.sales-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.sales-chart-container {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.sales {
  background: #3b82f6;
}

.legend-dot.commission {
  background: #10b981;
}

.chart-wrapper {
  height: 200px;
  position: relative;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.stream-url-config {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-url-config .form-group {
  margin-bottom: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-tertiary);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--color-border);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-dialog {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0;
  width: 420px;
  max-width: 90vw;
  box-shadow: 
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.1);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-dialog-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.confirm-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-dialog-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-dialog-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.confirm-dialog-icon.warning svg {
  fill: #fbbf24;
}

.confirm-dialog-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.confirm-dialog-icon.danger svg {
  fill: #f87171;
}

.confirm-dialog-icon.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.confirm-dialog-icon.info svg {
  fill: #60a5fa;
}

.confirm-dialog-icon.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.confirm-dialog-icon.success svg {
  fill: #34d399;
}

.confirm-dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.confirm-dialog-body {
  padding: 20px 24px;
}

.confirm-dialog-message {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  white-space: pre-line;
}

.confirm-dialog-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
  justify-content: flex-end;
}

.confirm-dialog-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-dialog-btn.cancel {
  background: rgba(71, 85, 105, 0.3);
  border-color: rgba(71, 85, 105, 0.4);
  color: #94a3b8;
}

.confirm-dialog-btn.cancel:hover {
  background: rgba(71, 85, 105, 0.5);
  color: #f1f5f9;
}

.confirm-dialog-btn.confirm {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.confirm-dialog-btn.confirm:hover {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

.confirm-dialog-btn.danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.confirm-dialog-btn.danger:hover {
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}
