/**
 * Apple Human Interface Guidelines Design System
 *
 * 符合 Apple HIG 的设计系统，支持深色/浅色模式
 * 使用 SF Pro 系统字体和 Apple 系统颜色
 */

/* ==================== CSS Variables ==================== */
:root {
  /* Font Family */
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, Menlo, Monaco, monospace;

  /* Font Sizes */
  --text-caption2: 11px;
  --text-caption1: 12px;
  --text-footnote: 13px;
  --text-subhead: 15px;
  --text-body: 17px;
  --text-headline: 17px;
  --text-title3: 20px;
  --text-title2: 22px;
  --text-title1: 28px;
  --text-large-title: 34px;

  /* Spacing (8pt Grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Animation */
  --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-in: cubic-bezier(0.42, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.58, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* Light Mode Colors (Default) */
  --system-blue: #007AFF;
  --system-green: #34C759;
  --system-indigo: #5856D6;
  --system-orange: #FF9500;
  --system-pink: #FF2D55;
  --system-purple: #AF52DE;
  --system-red: #FF3B30;
  --system-teal: #5AC8FA;
  --system-yellow: #FFCC00;

  --system-gray: #8E8E93;
  --system-gray2: #AEAEB2;
  --system-gray3: #C7C7CC;
  --system-gray4: #D1D1D6;
  --system-gray5: #E5E5EA;
  --system-gray6: #F2F2F7;

  --label-primary: #000000;
  --label-secondary: rgba(60, 60, 67, 0.6);
  --label-tertiary: rgba(60, 60, 67, 0.3);
  --label-quaternary: rgba(60, 60, 67, 0.18);

  --bg-primary: #FFFFFF;
  --bg-secondary: #F2F2F7;
  --bg-tertiary: #FFFFFF;
  --bg-grouped: #F2F2F7;

  --separator: rgba(60, 60, 67, 0.29);
  --separator-opaque: #C6C6C8;

  /* Glass Effect (Light) */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(20px) saturate(180%);

  /* Background Gradient */
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dark Mode Colors */
@media (prefers-color-scheme: dark) {
  :root {
    --system-blue: #0A84FF;
    --system-green: #30D158;
    --system-indigo: #5E5CE6;
    --system-orange: #FF9F0A;
    --system-pink: #FF375F;
    --system-purple: #BF5AF2;
    --system-red: #FF453A;
    --system-teal: #64D2FF;
    --system-yellow: #FFD60A;

    --system-gray: #8E8E93;
    --system-gray2: #636366;
    --system-gray3: #48484A;
    --system-gray4: #3A3A3C;
    --system-gray5: #2C2C2E;
    --system-gray6: #1C1C1E;

    --label-primary: #FFFFFF;
    --label-secondary: rgba(235, 235, 245, 0.6);
    --label-tertiary: rgba(235, 235, 245, 0.3);
    --label-quaternary: rgba(235, 235, 245, 0.18);

    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --bg-grouped: #1C1C1E;

    --separator: rgba(84, 84, 88, 0.6);
    --separator-opaque: #38383A;

    /* Glass Effect (Dark) */
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Background Gradient (Dark) */
    --gradient-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
}

/* ==================== Base Reset ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-system);
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--label-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
}

/* ==================== Typography ==================== */
.text-large-title {
  font-size: var(--text-large-title);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.text-title1 {
  font-size: var(--text-title1);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.text-title2 {
  font-size: var(--text-title2);
  font-weight: 700;
}

.text-title3 {
  font-size: var(--text-title3);
  font-weight: 600;
}

.text-headline {
  font-size: var(--text-headline);
  font-weight: 600;
}

.text-body {
  font-size: var(--text-body);
  font-weight: 400;
}

.text-subhead {
  font-size: var(--text-subhead);
  font-weight: 400;
}

.text-footnote {
  font-size: var(--text-footnote);
  font-weight: 400;
}

.text-caption1 {
  font-size: var(--text-caption1);
  font-weight: 400;
}

.text-caption2 {
  font-size: var(--text-caption2);
  font-weight: 400;
}

.text-secondary {
  color: var(--label-secondary);
}

.text-tertiary {
  color: var(--label-tertiary);
}

.text-mono {
  font-family: var(--font-mono);
}

/* ==================== Glass Panel ==================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 12px 24px rgba(0, 0, 0, 0.04);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
  .glass-panel {
    background: var(--bg-tertiary);
  }
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-system);
  font-size: var(--text-body);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--duration-instant) var(--ease-out),
              opacity var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn-primary {
  color: #FFFFFF;
  background: var(--system-blue);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Secondary Button */
.btn-secondary {
  color: var(--system-blue);
  background: rgba(0, 122, 255, 0.1);
}

/* Tertiary Button */
.btn-tertiary {
  color: var(--system-blue);
  background: transparent;
}

/* Destructive Button */
.btn-destructive {
  color: #FFFFFF;
  background: var(--system-red);
}

/* Ghost Button */
.btn-ghost {
  color: var(--label-primary);
  background: var(--system-gray6);
}

@media (prefers-color-scheme: dark) {
  .btn-ghost {
    background: var(--system-gray5);
  }
}

/* Small Button */
.btn-sm {
  min-height: 32px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-subhead);
}

/* Icon Button */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* ==================== Input Fields ==================== */
.input-field {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-system);
  font-size: var(--text-body);
  color: var(--label-primary);
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  outline: none;
  transition: box-shadow var(--duration-fast) var(--ease-default);
}

.input-field:focus {
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.3);
}

.input-field::placeholder {
  color: var(--label-tertiary);
}

.input-field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Glass Input */
.input-glass {
  background: rgba(118, 118, 128, 0.12);
}

@media (prefers-color-scheme: dark) {
  .input-glass {
    background: rgba(118, 118, 128, 0.24);
  }
}

/* Input Group */
.input-group {
  display: flex;
  gap: 0;
}

.input-group .input-field {
  border-radius: 0;
}

.input-group .input-field:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .input-field:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group .btn {
  border-radius: 0;
}

.input-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Form Label */
.form-label {
  display: block;
  font-size: var(--text-subhead);
  font-weight: 500;
  color: var(--label-primary);
  margin-bottom: var(--space-2);
}

/* Form Hint */
.form-hint {
  font-size: var(--text-caption1);
  color: var(--label-secondary);
  margin-top: var(--space-1);
}

/* Form Group */
.form-group {
  margin-bottom: var(--space-4);
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.04);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

@supports not (backdrop-filter: blur(20px)) {
  .card-glass {
    background: var(--bg-tertiary);
  }
}

/* ==================== Grouped List ==================== */
.list-grouped {
  background: var(--bg-grouped);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.list-section {
  background: var(--bg-tertiary);
  margin: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.list-section:first-child {
  margin-top: var(--space-4);
}

.list-section:last-child {
  margin-bottom: var(--space-4);
}

.list-section-header {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-footnote);
  font-weight: 400;
  color: var(--label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.list-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  position: relative;
}

.list-item:not(:last-child) {
  border-bottom: 0.5px solid var(--separator);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: var(--text-body);
  color: var(--label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: var(--text-subhead);
  color: var(--label-secondary);
}

.list-item-value {
  font-size: var(--text-body);
  color: var(--label-secondary);
  margin-left: auto;
}

.list-item-accessory {
  margin-left: var(--space-2);
  color: var(--label-quaternary);
}

/* ==================== Segmented Control ==================== */
.segmented-control {
  display: inline-flex;
  background: var(--system-gray6);
  padding: 2px;
  border-radius: var(--radius-sm);
  gap: 0;
}

@media (prefers-color-scheme: dark) {
  .segmented-control {
    background: var(--system-gray5);
  }
}

.segmented-control-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-system);
  font-size: var(--text-subhead);
  font-weight: 500;
  color: var(--label-primary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.segmented-control-item:hover {
  color: var(--system-blue);
}

.segmented-control-item.active {
  background: var(--bg-tertiary);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ==================== Navigation Bar ==================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 100;
}

@supports not (backdrop-filter: blur(20px)) {
  .navbar {
    background: var(--bg-primary);
  }
}

.navbar-title {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--label-primary);
}

.navbar-leading,
.navbar-trailing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ==================== Toolbar ==================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-primary);
  border-bottom: 0.5px solid var(--separator);
}

.toolbar-leading,
.toolbar-center,
.toolbar-trailing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toolbar-leading {
  min-width: 70px;
  justify-content: flex-start;
}

.toolbar-center {
  flex: 1;
  justify-content: center;
}

.toolbar-trailing {
  min-width: 70px;
  justify-content: flex-end;
}

.toolbar-title {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--label-primary);
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  color: var(--system-blue);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-system);
  font-size: var(--text-body);
}

.toolbar-btn:active {
  background: rgba(0, 122, 255, 0.1);
}

/* ==================== Sheet Modal ==================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-default),
              visibility var(--duration-normal) var(--ease-default);
}

.sheet-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 201;
  transform: translateY(100%);
  transition: transform var(--duration-normal) var(--ease-default);
  max-height: calc(100vh - 44px);
  overflow: hidden;
}

.sheet.visible {
  transform: translateY(0);
}

.sheet-grabber {
  width: 36px;
  height: 5px;
  background: var(--label-quaternary);
  border-radius: 2.5px;
  margin: var(--space-2) auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.5px solid var(--separator);
}

.sheet-title {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--label-primary);
}

.sheet-cancel,
.sheet-done {
  font-family: var(--font-system);
  font-size: var(--text-body);
  color: var(--system-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.sheet-done {
  font-weight: 600;
}

.sheet-content {
  padding: var(--space-4);
  overflow-y: auto;
  max-height: calc(100vh - 150px);
}

/* ==================== Alert ==================== */
.alert-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-default),
              visibility var(--duration-normal) var(--ease-default);
}

.alert-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.alert {
  width: 270px;
  background: var(--bg-tertiary);
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  transform: scale(0.9);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.alert-backdrop.visible .alert {
  transform: scale(1);
}

.alert-content {
  padding: var(--space-5) var(--space-4);
}

.alert-title {
  font-size: var(--text-headline);
  font-weight: 600;
  color: var(--label-primary);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: var(--text-footnote);
  color: var(--label-primary);
  line-height: 1.4;
}

.alert-buttons {
  display: flex;
  border-top: 0.5px solid var(--separator);
}

.alert-btn {
  flex: 1;
  padding: var(--space-3);
  font-family: var(--font-system);
  font-size: var(--text-body);
  color: var(--system-blue);
  background: transparent;
  border: none;
  cursor: pointer;
}

.alert-btn:not(:last-child) {
  border-right: 0.5px solid var(--separator);
}

.alert-btn:active {
  background: var(--bg-secondary);
}

.alert-btn-cancel {
  font-weight: 400;
}

.alert-btn-default {
  font-weight: 600;
}

.alert-btn-destructive {
  color: var(--system-red);
}

/* ==================== Table ==================== */
.table-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

@supports not (backdrop-filter: blur(20px)) {
  .table-glass {
    background: var(--bg-tertiary);
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-size: var(--text-footnote);
  font-weight: 600;
  color: var(--label-secondary);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
}

.table td {
  font-size: var(--text-subhead);
  color: var(--label-primary);
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.5px solid var(--separator);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: var(--bg-secondary);
}

/* ==================== Badge ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: var(--text-caption1);
  font-weight: 600;
  color: #FFFFFF;
  background: var(--system-gray);
  border-radius: var(--radius-full);
}

.badge-success {
  background: var(--system-green);
}

.badge-error {
  background: var(--system-red);
}

.badge-warning {
  background: var(--system-orange);
}

.badge-info {
  background: var(--system-blue);
}

/* ==================== Result Card ==================== */
.result-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
}

.result-success {
  background: rgba(52, 199, 89, 0.15);
  color: var(--system-green);
}

.result-error {
  background: rgba(255, 59, 48, 0.15);
  color: var(--system-red);
}

@media (prefers-color-scheme: dark) {
  .result-success {
    background: rgba(48, 209, 88, 0.2);
    color: var(--system-green);
  }

  .result-error {
    background: rgba(255, 69, 58, 0.2);
    color: var(--system-red);
  }
}

.result-title {
  font-size: var(--text-headline);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.result-content {
  font-size: var(--text-subhead);
}

/* Auth Code Box */
.auth-code-box {
  background: rgba(0, 0, 0, 0.05);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-footnote);
  word-break: break-all;
  margin: var(--space-3) 0;
}

@media (prefers-color-scheme: dark) {
  .auth-code-box {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ==================== Pagination ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4);
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-3);
  font-family: var(--font-system);
  font-size: var(--text-subhead);
  color: var(--system-blue);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.pagination-btn:hover {
  background: rgba(0, 122, 255, 0.1);
}

.pagination-btn:disabled {
  color: var(--label-quaternary);
  cursor: not-allowed;
}

.pagination-btn.active {
  color: #FFFFFF;
  background: var(--system-blue);
}

.pagination-info {
  font-size: var(--text-caption1);
  color: var(--label-secondary);
  margin-left: var(--space-4);
}

/* ==================== Search Bar ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(118, 118, 128, 0.12);
  border-radius: var(--radius-md);
}

@media (prefers-color-scheme: dark) {
  .search-bar {
    background: rgba(118, 118, 128, 0.24);
  }
}

.search-bar-icon {
  color: var(--label-tertiary);
  font-size: var(--text-body);
}

.search-bar-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-system);
  font-size: var(--text-body);
  color: var(--label-primary);
  outline: none;
}

.search-bar-input::placeholder {
  color: var(--label-tertiary);
}

/* ==================== Stats Card ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  transition: transform var(--duration-fast) var(--ease-default);
}

@supports not (backdrop-filter: blur(20px)) {
  .stat-card {
    background: var(--bg-tertiary);
  }
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-label {
  font-size: var(--text-caption1);
  font-weight: 500;
  color: var(--label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: var(--text-title1);
  font-weight: 700;
  color: var(--system-blue);
}

.stat-value.success {
  color: var(--system-green);
}

.stat-value.error {
  color: var(--system-red);
}

/* ==================== Utility Classes ==================== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }

.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden { display: none; }
.visible { display: block; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
