/* =============================================
   探针监控系统 - 全局样式
   ============================================= */

/* ---- Design Tokens (CSS Variables) ---- */
:root {
  /* Gray Scale */
  --gray-50: #f8f9fa;
  --gray-100: #f0f1f3;
  --gray-200: #e2e5e9;
  --gray-300: #cdd2d9;
  --gray-400: #9ba3af;
  --gray-500: #6b7383;
  --gray-600: #4b5362;
  --gray-700: #313843;
  --gray-800: #1d2129;
  --gray-900: #0f1217;

  /* Brand */
  --brand-500: #4361ee;
  --brand-600: #3451d1;
  --brand-50: #edf0fd;

  /* Semantic */
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --sky-500: #0ea5e9;
  --sky-100: #e0f2fe;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 0 3px rgba(67,97,238,0.15);

  /* Card */
  --card-bg: #ffffff;
  --card-border: var(--gray-200);

  /* Input */
  --input-bg: #ffffff;
  --input-border: var(--gray-200);

  /* Table */
  --table-header-bg: var(--gray-50);
  --table-stripe: var(--gray-50);
  --table-hover: var(--gray-50);

  /* Modal */
  --modal-overlay: rgba(0,0,0,0.45);
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --gray-50: #0f1217;
  --gray-100: #1a1e27;
  --gray-200: #2a303d;
  --gray-700: #d4d6db;
  --gray-800: #e8eaef;
  --card-bg: #1a1e27;
  --card-border: #2a303d;
  --input-bg: #0f1217;
  --input-border: #2a303d;
  --table-header-bg: #1a1e27;
  --table-stripe: rgba(255,255,255,0.02);
  --table-hover: rgba(255,255,255,0.04);
  --modal-overlay: rgba(0,0,0,0.7);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-500);
  text-decoration: none;
}

a:hover {
  color: var(--brand-600);
}

/* ---- Login Page ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--gray-50);
}

.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

[data-theme="dark"] .login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  margin-bottom: 12px;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-form {
  width: 100%;
}

/* ---- Form Components ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: var(--shadow-glow);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input.error {
  border-color: var(--red-500);
}

.form-input:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
}

.form-error {
  font-size: 12px;
  color: var(--red-500);
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-500);
  cursor: pointer;
}

/* Password Input */
.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .form-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.password-toggle:hover {
  color: var(--gray-600);
}

.password-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--brand-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--brand-600);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #c7cdf5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--red-500);
  border: 1px solid var(--red-500);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-danger:hover {
  background: var(--red-500);
  color: #fff;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---- Alerts ---- */
.alert {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid;
}

.alert-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.alert-info {
  background: #f0f9ff;
  border-color: #7dd3fc;
  color: #075985;
}

.alert-success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success { background: var(--green-100); color: #15803d; }
.badge-warning { background: var(--amber-100); color: #92400e; }
.badge-danger  { background: var(--red-100); color: #b91c1c; }
.badge-info    { background: var(--sky-100); color: #075985; }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); }

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

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

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 16px;
}

/* ---- Tables ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--table-header-bg);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  user-select: none;
}

.table tbody td {
  padding: 10px 12px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--table-hover);
}

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

/* ---- Toggle ---- */
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--gray-300);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.active {
  background: var(--brand-500);
}

.toggle::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
}

.toggle.active::after {
  left: 18px;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--brand-500);
  border-bottom-color: var(--brand-500);
}

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

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

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--modal-overlay);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}

.modal {
  position: relative !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 48px);
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.2s;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

.modal-body {
  padding: 20px;
  font-size: 14px;
  color: var(--gray-700);
}

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

/* ---- Dropdown ---- */
.dropdown {
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
}

.dropdown-item {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: var(--gray-50);
}

.dropdown-item.danger {
  color: var(--red-500);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 4px 0;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 68px;
  right: 24px;
  z-index: 1100;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  animation: slideInRight 0.25s ease-out;
}

.toast-success { background: #166534; color: #fff; }
.toast-error   { background: #991b1b; color: #fff; }
.toast-info    { background: #1e3a5f; color: #fff; }

/* ---- Credential Box ---- */
.credential-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
  color: var(--gray-800);
  word-break: break-all;
}

.credential-box .copy-btn {
  flex-shrink: 0;
  margin-left: 8px;
  font-size: 12px;
  color: var(--brand-500);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.credential-box .copy-btn:hover {
  background: var(--brand-50);
}

.credential-box .copy-btn.copied {
  color: var(--green-500);
}

/* ---- Terminal Log ---- */
.terminal-log {
  background: #0d1117;
  color: #c9d1d9;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
}

.terminal-log .line-success { color: #7ee787; }
.terminal-log .line-error   { color: #f85149; }
.terminal-log .line-info    { color: #79c0ff; }
.terminal-log .line-warning { color: #d2991d; }
.terminal-log .line-dim     { color: #6e7681; }

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

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

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

/* Sidebar */
.sidebar {
  width: 220px;
  background: #1d2129;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.sidebar-menu {
  flex: 1;
  padding: 8px 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  display: block;
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7383;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 20px;
  color: #b0b8c4;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.sidebar-menu-item.active {
  background: rgba(67,97,238,0.12);
  color: #fff;
  border-left-color: var(--brand-500);
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-version {
  font-size: 11px;
  color: #6b7383;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 220px;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: 52px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.hamburger:hover {
  background: var(--gray-100);
}

.topbar-brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-search {
  position: relative;
  margin-right: 8px;
}

.search-input {
  width: 220px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--gray-700);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--brand-500);
}

.search-input::placeholder {
  color: var(--gray-400);
}

/* ---- Search Panel ---- */
.search-panel {
  position: absolute;
  top: 38px;
  left: 0;
  width: 520px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 4px 0;
}

.search-section-title {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}

.search-result-item:hover {
  background: var(--brand-50);
}

.search-result-item small {
  color: var(--gray-400);
  font-size: 12px;
  margin-left: auto;
}

.search-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}

.search-empty::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%239ba3af' stroke-width='1.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.6;
}

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

.status-dot.online {
  background: var(--green-500);
}

.status-dot.offline {
  background: var(--gray-400);
}

.topbar-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}

.topbar-icon-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 16px;
  padding: 0 4px;
}

.user-dropdown {
  position: relative;
}

.user-btn {
  width: auto;
  padding: 0 8px;
  gap: 6px;
}

.user-name {
  font-size: 13px;
  color: var(--gray-700);
}

/* Page Content */
.page-content {
  padding: 24px;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
}

.page-meta {
  font-size: 12px;
  color: var(--gray-500);
}

/* Dashboard Cards */
.dashboard-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-card {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.summary-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.summary-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
  font-feature-settings: "tnum";
}

.summary-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

.trend-up {
  color: var(--green-500);
}

/* Charts */
.dashboard-charts {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chart-card {
  flex: 1;
  min-width: 320px;
}

/* Top Items (CPU/Memory ranking) */
.top-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

.top-item:last-child {
  border-bottom: none;
}

.top-item-name {
  width: 90px;
  font-size: 13px;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-item-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.top-item-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.top-item-value {
  width: 42px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  font-feature-settings: "tnum";
}

/* Period Switch */
.chart-period-switch {
  display: inline-flex;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.chart-period-switch button {
  padding: 3px 10px;
  font-size: 11px;
  border: none;
  background: var(--card-bg);
  color: var(--gray-500);
  cursor: pointer;
  border-right: 1px solid var(--gray-200);
  transition: background 0.15s, color 0.15s;
}

.chart-period-switch button:last-child {
  border-right: none;
}

.chart-period-switch button.active {
  background: var(--brand-500);
  color: #fff;
}

/* Bottom Row */
.dashboard-bottom {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-bottom > .card {
  flex: 1;
  min-width: 320px;
}

/* Node Grid */
.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.node-card-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.node-card-item:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
}

.node-card-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.node-card-status.online {
  background: var(--green-500);
  animation: pulse-dot 2s infinite;
}

.node-card-status.offline {
  background: var(--gray-400);
}

.node-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.node-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-card-ip {
  font-size: 11px;
  color: var(--gray-500);
}

/* Alerts */
.recent-alerts {
  display: flex;
  flex-direction: column;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item-text {
  flex: 1;
  font-size: 13px;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-item-time {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-500);
}

.empty-state p {
  font-size: 14px;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 1279px) {
  .sidebar {
    width: 56px;
  }
  .sidebar-brand-text,
  .menu-text,
  .sidebar-section-title {
    display: none;
  }
  .sidebar-menu-item {
    justify-content: center;
    padding: 0;
  }
  .main-content {
    margin-left: 56px;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 16px 0;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }
  .topbar-brand {
    display: none;
  }
  .search-input {
    width: 160px;
  }
}

@media (max-width: 767px) {
  .dashboard-cards {
    flex-direction: column;
  }
  .summary-card {
    min-width: 100%;
  }
  .dashboard-charts,
  .dashboard-bottom {
    flex-direction: column;
  }
  .page-content {
    padding: 16px;
  }
  .user-name {
    display: none;
  }
  .search-input {
    width: 120px;
  }
}

/* ============================================ */

/* ---- Deploy Progress ---- */
.deploy-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.deploy-progress-fill {
  height: 100%;
  background: var(--brand-500);
  border-radius: var(--radius-full);
  transition: width 0.5s ease, background 0.3s;
  position: relative;
}

.deploy-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: deployShimmer 1.5s infinite;
}

@keyframes deployShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.deploy-step-pending,
.deploy-step-done,
.deploy-step-current,
.deploy-step-failed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  transition: color 0.3s;
}

.deploy-step-pending {
  color: var(--gray-400);
}

.deploy-step-done {
  color: var(--green-500);
}

.deploy-step-current {
  color: var(--brand-500);
  font-weight: 600;
}

.deploy-step-failed {
  color: var(--red-500);
}

.deploy-step-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
