/* ============================================
   城市生命线安全监测平台 — 设计系统 CSS
   Unified Design Token System
   Dark Navy Theme · Cyan/Blue Accents
   ============================================ */

:root {
  /* ===== 背景色系 ===== */
  --bg-deep: #0a1628;
  --bg-primary: #0a1628;
  --bg-secondary: #111d33;
  --bg-panel: #0d2137;
  --bg-card: #162340;
  --bg-card-hover: #1a2a4a;
  --bg-input: #0d1a2e;
  --bg-sidebar: #0e1a30;
  --bg-header: #0c1829;
  --bg-toolbar: #111d33;
  --bg-hover: rgba(0, 180, 255, 0.06);
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --bg-page: #0a1628;

  /* ===== 边框色系 ===== */
  --border-primary: #1e3a5f;
  --border-color: #1e3a5f;
  --border-light: #2a4a6f;
  --border-subtle: rgba(0, 180, 255, 0.15);
  --border-active: #00d4ff;
  --border-focus: #00d4ff;

  /* ===== 文字色系 ===== */
  --text-bright: #ffffff;
  --text-primary: #e8f0ff;
  --text-secondary: #8aa4c8;
  --text-muted: #5a7a9a;
  --text-accent: #00d4ff;
  --text-white: #ffffff;

  /* ===== 强调色 ===== */
  --accent-cyan: #00d4ff;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-yellow: #eab308;

  /* ===== 标签色 ===== */
  --tag-critical-bg: #dc2626;
  --tag-critical-text: #fff;
  --tag-major-bg: #f59e0b;
  --tag-major-text: #fff;
  --tag-medium-bg: #3b82f6;
  --tag-medium-text: #fff;
  --tag-minor-bg: #6b7280;
  --tag-minor-text: #fff;
  --tag-general-bg: #4dabf7;
  --tag-general-text: #fff;
  --tag-success-bg: #10b981;
  --tag-success-text: #fff;
  --tag-info-bg: #06b6d4;
  --tag-info-text: #fff;
  --tag-default-bg: #374151;
  --tag-default-text: #d1d5db;

  /* ===== 阴影 ===== */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 12px rgba(0, 212, 255, 0.3);
  --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.25);
  --shadow-glow-blue: 0 4px 24px rgba(0, 100, 255, 0.15);

  /* ===== 圆角 ===== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ===== 布局尺寸 ===== */
  --sidebar-width: 220px;
  --header-height: 56px;
  --toolbar-height: 48px;
  --page-max-width: 1400px;

  /* ===== 间距系统 (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;
  --space-16: 64px;

  /* ===== 字体 ===== */
  --font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

  /* ===== 字号 ===== */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 34px;

  /* ===== 字重 ===== */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ===== 过渡 ===== */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  --ease-fast: 0.15s ease;
  --ease-normal: 0.25s ease;
  --ease-slow: 0.4s ease;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-md);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   APP SHELL — CSS Grid 布局骨架
   支持两种 HTML 结构：
   A) .app-shell > .app-header + .app-sidebar + .app-main
   B) .app-shell > .app-header + .app-body > .app-sidebar + .app-main [+ .app-right-panel]
   ============================================ */
.app-shell {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ===== Header — 跨两列 ===== */
.app-header {
  grid-column: 1 / -1;
  grid-row: 1;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  overflow: hidden;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-accent);
  white-space: nowrap;
}

.app-header .logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
}

.app-header .header-spacer {
  flex: 1;
}

.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .header-time {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.app-header .header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition-fast);
  position: relative;
}

.app-header .header-icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-accent);
}

.app-header .header-icon-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
}

.app-header .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.breadcrumb .sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.breadcrumb .current {
  color: var(--text-accent);
}

/* ===== App Body (sidebar + main + optional right panel) ===== */
.app-body {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.app-sidebar {
  grid-column: 1;
  grid-row: 2;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 8px 0;
  z-index: 90;
}

.app-sidebar .sidebar-section-label {
  padding: 10px 20px 4px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}

.app-sidebar .sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 16px;
}

.app-sidebar .sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 9px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  gap: 10px;
  font-size: var(--text-md);
  border-left: 3px solid transparent;
  position: relative;
  white-space: nowrap;
}

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

.app-sidebar .sidebar-nav-item.active {
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-accent);
  border-left-color: var(--accent-cyan);
}

.app-sidebar .sidebar-nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
  flex-shrink: 0;
}

.app-sidebar .sidebar-nav-item.active .nav-icon {
  opacity: 1;
}

.app-sidebar .sidebar-nav-item .nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

.app-sidebar .nav-badge.danger {
  background: var(--accent-red);
  color: white;
}

.app-sidebar .nav-badge.warning {
  background: var(--accent-orange);
  color: white;
}

/* Legacy sidebar classes (for backward compat with older CSS) */
.app-sidebar .nav-section-title {
  padding: 10px 20px 4px;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}

.app-sidebar .nav-item {
  display: flex;
  align-items: center;
  padding: 9px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  gap: 10px;
  font-size: var(--text-md);
  border-left: 3px solid transparent;
  position: relative;
  white-space: nowrap;
}

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

.app-sidebar .nav-item.active {
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-accent);
  border-left-color: var(--accent-cyan);
}

.app-sidebar .nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
}

.app-sidebar .nav-item.active .nav-icon {
  opacity: 1;
  color: var(--accent-cyan);
}

.app-sidebar .nav-item .nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

/* ===== Main Content Area ===== */
.app-main {
  grid-column: 2;
  grid-row: 2;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
  min-width: 0;
}

/* ===== Right Panel (GIS dashboard) ===== */
.app-right-panel {
  width: 320px;
  min-width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

/* ============================================
   PAGE LAYOUT COMPONENTS
   ============================================ */
.page-toolbar {
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: var(--toolbar-height);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-toolbar .toolbar-title {
  font-size: var(--text-md);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

.page-toolbar .toolbar-separator {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

.page-toolbar .toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-content {
  padding: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text-primary);
  white-space: nowrap;
  font-family: var(--font-family);
  line-height: 1.4;
}

.btn:hover {
  background: var(--bg-card-hover);
}

.btn-primary {
  background: var(--accent-cyan);
  color: #0a1628;
  border-color: var(--accent-cyan);
}

.btn-primary:hover {
  background: #33daff;
  border-color: #33daff;
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.btn-secondary:hover {
  background: #4b92f8;
}

.btn-danger {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: var(--text-sm);
}

.btn-xs {
  padding: 3px 8px;
  font-size: var(--text-xs);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
}

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

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

.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.btn-group .btn.active {
  background: var(--accent-cyan);
  color: #0a1628;
}

/* ============================================
   TAGS
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.tag-critical {
  background: var(--tag-critical-bg);
  color: var(--tag-critical-text);
}

.tag-major {
  background: var(--tag-major-bg);
  color: var(--tag-major-text);
}

.tag-medium {
  background: var(--tag-medium-bg);
  color: var(--tag-medium-text);
}

.tag-minor {
  background: var(--tag-minor-bg);
  color: var(--tag-minor-text);
}

.tag-general {
  background: var(--tag-general-bg);
  color: var(--tag-general-text);
}

.tag-success {
  background: var(--tag-success-bg);
  color: var(--tag-success-text);
}

.tag-info {
  background: var(--tag-info-bg);
  color: var(--tag-info-text);
}

.tag-default {
  background: var(--tag-default-bg);
  color: var(--tag-default-text);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: var(--fw-medium);
  font-size: var(--text-md);
  color: var(--text-primary);
}

.card-header .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header .card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 16px;
}

/* ============================================
   STAT GRID & CARDS
   ============================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-unit {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-left: 4px;
  font-weight: var(--fw-normal);
}

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

.stat-card .stat-trend {
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .stat-trend.up {
  color: var(--accent-green);
}

.stat-card .stat-trend.down {
  color: var(--accent-red);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 0 var(--radius-md) 0 60px;
  opacity: 0.08;
}

.stat-card.info::after { background: var(--accent-cyan); }
.stat-card.success::after { background: var(--accent-green); }
.stat-card.warning::after { background: var(--accent-orange); }
.stat-card.danger::after { background: var(--accent-red); }

/* ============================================
   DATA TABLE
   ============================================ */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: var(--text-base);
}

.data-table th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(0, 212, 255, 0.04);
}

.data-table .cell-actions {
  display: flex;
  gap: 6px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group .form-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: var(--text-md);
  font-family: var(--font-family);
  transition: var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238aa4c8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--text-md);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 0;
  overflow-x: auto;
}

.tab-item {
  padding: 10px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: var(--text-md);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-item:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.04);
}

.tab-item.active {
  color: var(--text-accent);
  border-bottom-color: var(--accent-cyan);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.visible {
  display: flex;
}

.modal-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-dialog .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
}

.modal-dialog .modal-body {
  padding: 20px;
}

.modal-dialog .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  background: var(--bg-secondary);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-slow);
  background: var(--accent-cyan);
}

.progress-fill.green { background: var(--accent-green); }
.progress-fill.orange { background: var(--accent-orange); }
.progress-fill.red { background: var(--accent-red); }
.progress-fill.blue { background: var(--accent-blue); }

/* ============================================
   STEPS
   ============================================ */
.steps {
  display: flex;
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.step.completed {
  color: var(--accent-green);
}

.step.current {
  color: var(--text-accent);
}

.step .step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
}

.step.completed .step-number {
  background: var(--accent-green);
  color: white;
}

.step.current .step-number {
  background: var(--accent-cyan);
  color: #0a1628;
}

/* ============================================
   STATUS DOT
   ============================================ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online { background: var(--accent-green); }
.status-dot.offline { background: var(--accent-red); }
.status-dot.warning { background: var(--accent-orange); }
.status-dot.idle { background: var(--text-muted); }

/* ============================================
   PANEL
   ============================================ */
.panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}

.panel-body {
  padding: 14px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state .empty-icon {
  font-size: 48px;
  opacity: 0.3;
}

/* ============================================
   FLEX HELPERS
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* ============================================
   TEXT HELPERS
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--text-accent); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-bright { color: var(--text-bright); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-orange); }
.text-info { color: var(--accent-blue); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.font-bold { font-weight: var(--fw-bold); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-medium { font-weight: var(--fw-medium); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   UTILITY
   ============================================ */
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.grid { display: grid; }
.cursor-pointer { cursor: pointer; }
.whitespace-nowrap { white-space: nowrap; }
.min-w-0 { min-width: 0; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-slide { animation: slideIn 0.3s ease; }
.animate-fade { animation: fadeIn 0.3s ease; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .app-right-panel { width: 280px; min-width: 280px; }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 180px;
  }
  .stat-grid { grid-template-columns: 1fr; }
  .app-right-panel { display: none; }
}
