* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
}

/* Admin layout styles */
.admin-logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo-collapsed {
  justify-content: center;
  font-size: 24px;
}

.admin-header {
  background: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.admin-content {
  margin: 24px;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  min-height: calc(100vh - 112px);
}

/* Dashboard stat cards */
.stat-card {
  text-align: center;
}

.stat-card .ant-statistic-title {
  font-size: 14px;
  color: #666;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  margin-bottom: 8px;
}

/* Chart containers */
.chart-container {
  width: 100%;
  height: 300px;
}

/* Playground */
.playground-output {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 16px;
  min-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 14px;
  line-height: 1.6;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot-green { background: #52c41a; }
.status-dot-red { background: #ff4d4f; }
.status-dot-orange { background: #faad14; }
.status-dot-blue { background: #1677ff; }
.status-dot-default { background: #d9d9d9; }

/* Token display */
.token-count {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Monaco, monospace;
}

/* Plan cards */
.plan-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.plan-card.recommended {
  border: 2px solid #1677ff;
}

.plan-card .price {
  font-size: 36px;
  font-weight: 700;
  color: #1677ff;
}

.plan-card .price-unit {
  font-size: 16px;
  color: #666;
}

/* Notification badge */
.notification-badge .ant-badge-count {
  box-shadow: none;
}

/* Subscription cards */
.subscription-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px;
  color: #fff;
}

/* Page loading */
.page-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
}

/* Table operations */
.table-operations {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .admin-content {
    margin: 12px;
    padding: 16px;
  }
}

@media (max-width: 576px) {
  /* Prevent horizontal overflow on mobile */
  body {
    overflow-x: hidden;
  }

  #root {
    overflow-x: hidden;
  }

  /* Shrink table font on small screens */
  .ant-table {
    font-size: 13px;
  }

  .ant-table-thead > tr > th {
    padding: 8px 12px;
    font-size: 12px;
  }

  .ant-table-tbody > tr > td {
    padding: 8px 12px;
  }

  /* Card tighter padding on mobile */
  .ant-card-body {
    padding: 16px;
  }

  /* Form items tighter spacing */
  .ant-form-item {
    margin-bottom: 12px;
  }

  /* InputNumber must not overflow on narrow screens */
  .ant-input-number {
    min-width: 0 !important;
  }

  /* Admin header — already handled in JS; CSS fallback */
  .admin-header {
    padding: 0 12px;
  }

  /* Page loading shorter on mobile */
  .page-loading {
    height: 200px;
  }

  /* Typography scaling for mobile */
  html {
    font-size: 14px;
  }

  h1.ant-typography { font-size: 22px !important; }
  h2.ant-typography { font-size: 18px !important; }
  h3.ant-typography { font-size: 16px !important; }
  h4.ant-typography { font-size: 15px !important; }

  .ant-statistic-content-value {
    font-size: 20px !important;
  }

  .ant-statistic-title {
    font-size: 12px !important;
  }
}
