Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

7.4 KB
Raw Blame
.dashboard {
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.dashboard .page-header {
  margin-bottom: 2rem;
}

/* H1 inherited from global */

.dashboard .status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.dashboard .status-badge.connected {
  background: rgba(37, 211, 102, 0.1);
  color: var(--primary-text);
}

.dashboard .status-badge.disconnected {
  background: var(--bg-light);
  color: var(--text-muted);
}

.dashboard .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

/* Collapse the 4-up tile grid to 2 columns on iPad Mini portrait (768px wide) and other narrow
   viewports so the tiles don't squeeze into thin slivers. Falls back to a single column on phones. */
@media (max-width: 1024px) {
  .dashboard .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

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

.dashboard .stat-card {
  position: relative;
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dashboard .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.dashboard .stat-icon {
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.dashboard .stat-watermark {
  position: absolute;
  inset-inline-end: -10px;
  bottom: -15px;
  width: 96px;
  height: 96px;
  opacity: 0.04;
  color: var(--text-primary);
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 1;
}

.dashboard .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
}

.dashboard .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  z-index: 2;
}

.dashboard .stat-detail {
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.5rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.dashboard .sessions-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

.dashboard .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* H2 inherited from global */

.dashboard .section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.dashboard .sessions-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: 0.875rem;
}

.dashboard .sessions-table .table-header,
.dashboard .sessions-table .table-row {
  display: grid;
  grid-template-columns: 140px 200px 140px 1fr 180px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  align-items: center;
}

.dashboard .sessions-table .table-header {
  background: var(--bg-light);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.dashboard .sessions-table .table-row {
  border-bottom: 1px solid var(--border);
}

.dashboard .sessions-table .table-row:last-child {
  border-bottom: none;
}

.dashboard .session-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.dashboard .session-id {
  font-family: 'JetBrains Mono Variable', 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.dashboard .session-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.dashboard .phone {
  color: var(--text-primary);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.dashboard .status-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  width: fit-content;
}

.dashboard .status-pill.ready {
  background: rgba(37, 211, 102, 0.1);
  color: var(--primary-text);
}

.dashboard .status-pill.initializing,
.dashboard .status-pill.authenticating {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-text);
}

.dashboard .status-pill.qr_ready {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

/* Needs a human: a heavier tint of the in-progress amber, so the two do not read alike. The Sessions page
   paints the same status with 22 percent; 30 left the amber text at 3.83:1 on the dark card. */
.dashboard .status-pill.action_required {
  background: rgba(245, 158, 11, 0.22);
  color: var(--warning-text);
}

.dashboard .status-pill.created,
.dashboard .status-pill.disconnected {
  background: var(--bg-light);
  color: var(--text-muted);
}

.dashboard .status-pill.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error-text);
}

.dashboard .last-active {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.dashboard .actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.dashboard .btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.dashboard .btn-sm:hover {
  background: var(--bg-white);
  border-color: var(--text-muted);
}

.dashboard .btn-sm.danger {
  color: var(--error-text);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
}

.dashboard .btn-sm.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

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

  /* Convert table to card layout wherever its fixed columns do not fit: they need about 1150px of
     viewport with the sidebar open. */
  .dashboard .sessions-table .table-header {
    display: none;
  }

  .dashboard .sessions-table .table-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .dashboard .sessions-table .table-row:last-child {
    border-bottom: none;
  }

  .dashboard .session-info-cell {
    order: 1;
  }

  .dashboard .session-id {
    font-size: 0.9375rem;
    font-weight: 600;
  }

  .dashboard .phone {
    order: 2;
  }

  .dashboard .status-pill {
    order: 3;
  }

  .dashboard .last-active {
    order: 4;
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .dashboard .actions {
    order: 5;
    justify-content: flex-start;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .dashboard {
    padding: 1rem;
  }

  .dashboard .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard .stat-value {
    font-size: 1.5rem;
  }

  .dashboard .sessions-section {
    padding: 1rem;
  }

  .dashboard .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .dashboard {
    padding: 0.75rem;
  }
}