/* ============================================================
   SUPERIOR PANEL — Dashboard Styles
   Layout, stat cards grid, responsive sidebar handling
   ============================================================ */

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

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

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard Specific ── */
.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

@media (max-width: 1024px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.chart-card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.chart-container {
  position: relative;
  height: 300px;
}

/* ── Activity Feed ── */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: var(--warning); }
.activity-dot.info { background: var(--accent); }
.activity-dot.danger { background: var(--danger); }

.activity-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── New Order Form ── */
.order-form-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .order-form-container { grid-template-columns: 1fr; }
}

.order-summary {
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-6));
}

.order-summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.order-summary-row .label {
  color: var(--text-muted);
}

.order-summary-row .value {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  padding: var(--space-4) 0 0;
  margin-top: var(--space-3);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.order-summary-total .value {
  color: var(--accent);
}

/* ── Quantity Slider ── */
.quantity-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  outline: none;
  margin: var(--space-3) 0;
}

.quantity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: var(--glow);
  transition: var(--transition-fast);
}

.quantity-slider::-webkit-slider-thumb:hover {
  box-shadow: var(--glow-strong);
  transform: scale(1.1);
}

.quantity-range {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Service Info Panel ── */
.service-info {
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.service-info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.service-info-row .label {
  color: var(--text-muted);
}

.service-info-row .value {
  color: var(--text-primary);
}

/* ── Payment Methods ── */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.payment-method {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.payment-method:hover {
  border-color: var(--border-hover);
}

.payment-method.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.payment-method-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.payment-method-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.payment-method-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ── Amount Presets ── */
.amount-presets {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.amount-preset {
  padding: 6px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.amount-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.amount-preset.active {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Ticket Conversation ── */
.ticket-thread {
  max-height: 500px;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ticket-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.ticket-message.user-message {
  align-self: flex-start;
}

.ticket-message.admin-message {
  align-self: flex-end;
}

.ticket-message-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.user-message .ticket-message-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: var(--radius-xs);
}

.admin-message .ticket-message-bubble {
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-bottom-right-radius: var(--radius-xs);
}

.ticket-message-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  padding: 0 var(--space-1);
}

.admin-message .ticket-message-meta {
  text-align: right;
}

/* ── API Docs ── */
.api-docs-section {
  margin-bottom: var(--space-8);
}

.api-endpoint {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.api-method {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

.api-method.post {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.api-method.get {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.api-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.api-endpoint-body {
  padding: var(--space-4);
}

.api-code {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
