/* ============================================
   跨境电商AI智能定制后台 - Design System
   Style: Ultra-clean light theme
   ============================================ */

/* --- Local Fonts --- */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/DMSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/DMSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/DMSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/DMSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/DMSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/DMSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- CSS Variables --- */
:root {
  /* Primary palette */
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --primary-hover: #3b82f6;

  /* Accent */
  --accent: #f59e0b;
  --accent-light: #fef3c7;

  /* Semantic */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #6366f1;
  --info-light: #e0e7ff;

  /* Neutrals */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #eff6ff;

  --border: #e2e8f0;
  --border-focus: #2563eb;
  --border-light: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-xl: 0 8px 32px rgba(0,0,0,0.10);

  /* Typography */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;

  /* Layout */
  --sidebar-w: 220px;
  --header-h: 56px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--fs-base); -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Layout --- */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 10;
}

.sidebar-logo {
  padding: var(--sp-xl) var(--sp-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--fs-lg);
}

.sidebar-logo .logo-text {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md) var(--sp-sm);
}

.nav-group { margin-bottom: var(--sp-lg); }

.nav-group-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  user-select: none;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--primary);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: var(--fs-xs);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.main-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xl);
}

.main-header h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.3px;
}

.main-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-xl);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease);
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Grid System --- */
.grid { display: grid; gap: var(--sp-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* --- Form Controls (Unified) --- */
.form-group { margin-bottom: var(--sp-lg); }

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xs);
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* Input & Textarea */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--duration) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input.sm { padding: 5px var(--sp-sm); font-size: var(--fs-sm); }
.form-input.lg { padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-md); }

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* Select */
.form-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text);
  user-select: none;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
  position: relative;
}

.form-check input[type="checkbox"] { border-radius: 4px; }
.form-check input[type="radio"] { border-radius: 50%; }

.form-check input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4.5px; top: 1.5px;
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check input[type="radio"]:checked {
  border-color: var(--primary);
  background: var(--bg-input);
}

.form-check input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 3.5px; top: 3.5px;
  width: 7px; height: 7px;
  background: var(--primary);
  border-radius: 50%;
}

.form-check input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Toggle Switch */
.form-switch {
  display: flex; align-items: center; gap: var(--sp-sm);
  cursor: pointer; user-select: none; font-size: var(--fs-base);
}

.form-switch input { display: none; }

.form-switch .switch-track {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background var(--duration) var(--ease);
}

.form-switch .switch-track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease);
}

.form-switch input:checked + .switch-track {
  background: var(--primary);
}

.form-switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  user-select: none;
  white-space: nowrap;
  line-height: 1.5;
}

.btn:active { transform: scale(0.97); }

.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { padding: 4px var(--sp-sm); font-size: var(--fs-sm); }
.btn-lg { padding: var(--sp-md) var(--sp-xl); font-size: var(--fs-md); }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-group { display: flex; gap: var(--sp-sm); }

/* --- Tags & Badges --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-info { background: var(--info-light); color: var(--info); }

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.table th {
  background: var(--bg);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  padding: var(--sp-sm) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* --- Stat Cards --- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.stat-card .stat-value {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.stat-card .stat-change {
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* --- Range Slider --- */
.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--duration) var(--ease);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* --- Progress Bar --- */
.progress {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s var(--ease);
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* --- Tooltip --- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--text);
  color: var(--text-inverse);
  font-size: var(--fs-xs);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration) var(--ease);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 5;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--sp-3xl) var(--sp-xl);
  color: var(--text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: var(--sp-lg); opacity: 0.3; }
.empty-state p { font-size: var(--fs-md); margin-bottom: var(--sp-lg); }

/* --- Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.font-mono { font-family: var(--font-mono); }
.w-full { width: 100%; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }
.hidden { display: none !important; }
.relative { position: relative; }

/* --- Tab Content Animation --- */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s var(--ease);
}

.tab-pane.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  top: var(--sp-xl);
  right: var(--sp-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  animation: slideIn 0.3s var(--ease);
  min-width: 260px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

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

/* --- Global Dialog --- */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; animation: dialogFadeIn 0.18s ease;
}
.dialog-overlay.hidden { display: none; }
.dialog-box {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: var(--sp-xl) var(--sp-xl) var(--sp-lg);
  min-width: 340px; max-width: 420px; text-align: center;
  animation: dialogScaleIn 0.2s ease;
}
.dialog-icon { margin-bottom: var(--sp-md); }
.dialog-title {
  font-size: var(--fs-lg); font-weight: 600;
  color: var(--text-primary); margin-bottom: var(--sp-xs);
}
.dialog-msg {
  font-size: var(--fs-sm); color: var(--text-secondary);
  line-height: 1.6; margin-bottom: var(--sp-lg);
}
.dialog-actions {
  display: flex; gap: var(--sp-sm); justify-content: center;
}
.dialog-actions .btn { min-width: 88px; }
.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
@keyframes dialogFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes dialogScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
