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

/* ====== Auth Gate ====== */
.auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg, #0b0d11);
  display: flex; align-items: center; justify-content: center;
}
.auth-gate-inner {
  text-align: center; max-width: 360px; width: 100%; padding: 2rem;
}
.auth-gate-brand {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 2rem;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-bolt { font-size: 3rem; margin-bottom: 0.8rem; }
.auth-gate h2 { font-size: 1.3rem; font-weight: 700; color: #e4e4e7; margin-bottom: 0.5rem; }
.auth-desc { font-size: 0.85rem; color: #71717a; margin-bottom: 1.5rem; }
.auth-qr-wrap { margin-bottom: 1rem; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.auth-qr-wrap img { border-radius: 12px; background: #fff; padding: 12px; }
.auth-loading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: #71717a; font-size: 0.85rem; }
.auth-spinner {
  width: 20px; height: 20px; border: 2px solid #252836; border-top-color: #3b82f6;
  border-radius: 50%; animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-wallet-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1.5rem; background: #f7931a; color: #fff; font-weight: 600;
  border: none; border-radius: 8px; font-size: 0.9rem; text-decoration: none;
  cursor: pointer; margin-bottom: 0.6rem; transition: opacity 0.15s;
}
.auth-wallet-btn:hover { opacity: 0.85; }
.auth-actions { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.auth-copy-btn {
  padding: 0.4rem 1rem; background: none; border: 1px solid #252836;
  color: #71717a; border-radius: 6px; font-size: 0.78rem; cursor: pointer; transition: all 0.15s;
}
.auth-copy-btn:hover { color: #e4e4e7; border-color: #71717a; }
.auth-retry-btn {
  margin-top: 0.8rem; padding: 0.5rem 1.2rem; background: #3b82f6; color: #fff;
  border: none; border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: opacity 0.15s;
}
.auth-retry-btn:hover { opacity: 0.85; }
.auth-status { margin-top: 0.8rem; font-size: 0.8rem; color: #71717a; }

:root {
  --bg: #0b0d11; --surface: #13161d; --card: #1a1d27; --card-border: #252836; --card-hover: #2a2d3a;
  --text: #e4e4e7; --text-dim: #71717a; --text-muted: #52525b;
  --green: #22c55e; --red: #ef4444; --yellow: #eab308; --blue: #3b82f6; --purple: #a855f7; --cyan: #06b6d4; --orange: #f97316;
  --bar-bg: #27272a; --bar-low: #22c55e; --bar-mid: #eab308; --bar-high: #ef4444;
  --radius: 10px; --radius-sm: 6px; --sidebar-w: 200px;
  --chart-grid: #252836; --chart-tick: #71717a; --chart-legend: #e4e4e7;
  --hover: rgba(255,255,255,0.06); --active: rgba(247,147,26,0.15);
}
[data-theme="light"] {
  --bg: #f5f5f7; --surface: #ffffff; --card: #ffffff; --card-border: #e5e5e5; --card-hover: #f0f0f0;
  --text: #1a1a1a; --text-dim: #6b7280; --text-muted: #9ca3af;
  --bar-bg: #e5e7eb;
  --chart-grid: #e5e7eb; --chart-tick: #6b7280; --chart-legend: #1a1a1a;
  --hover: rgba(0,0,0,0.06); --active: rgba(247,147,26,0.12);
}
[data-theme="light"] .sidebar { background: #f9fafb; border-right-color: #e5e5e5; }
[data-theme="light"] .gh-cell[data-level="0"] { background: #ebedf0; }
[data-theme="light"] .gh-cell[data-level="1"] { background: #9be9a8; }
[data-theme="light"] .gh-cell[data-level="2"] { background: #40c463; }
[data-theme="light"] .gh-cell[data-level="3"] { background: #30a14e; }
[data-theme="light"] .gh-cell[data-level="4"] { background: #216e39; }
html, body { height: 100%; font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }
.dim { color: var(--text-dim); }

/* ====== Themed scrollbar ====== */
* { scrollbar-width: thin; scrollbar-color: var(--card-border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 6px; border: 2px solid var(--bg); transition: background 0.15s; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
*::-webkit-scrollbar-corner { background: transparent; }
[data-theme="light"] *::-webkit-scrollbar-thumb { background: #d1d5db; border-color: var(--bg); }
[data-theme="light"] *::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
[data-theme="light"] * { scrollbar-color: #d1d5db transparent; }

/* ====== App shell ====== */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ====== Left sidebar ====== */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--card-border); display: flex; flex-direction: column; padding: 1.2rem 0; }
.sidebar-brand { padding: 0 1.2rem 1.2rem; font-weight: 700; font-size: 1.15rem; background: linear-gradient(135deg, var(--blue), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 0.6rem; }
.nav-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border: none; background: none; color: var(--text-dim); font-size: 0.88rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s; text-align: left; width: 100%; }
.nav-item:hover { color: var(--text); background: var(--card); }
.nav-item.active { color: var(--text); background: var(--card); font-weight: 600; }
.nav-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
/* Sidebar Umami */
.sidebar-umami { padding: 0.6rem 0.8rem; border-top: 1px solid var(--card-border); margin-top: auto; }
.sidebar-umami-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.sidebar-umami-header .widget-link { font-size: 0.68rem; }
.su-total { display: flex; gap: 0.8rem; margin-bottom: 0.3rem; }
.su-stat { font-size: 0.7rem; color: var(--text-dim); }
.su-stat strong { display: block; font-size: 1rem; color: var(--text); font-weight: 700; }
.su-sites { display: flex; flex-direction: column; gap: 2px; }
.su-site { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-dim); padding: 1px 0; }
.su-site span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

.sidebar-footer { padding: 0.6rem 1.2rem 0; border-top: 1px solid var(--card-border); display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--text-dim); }
.theme-toggle { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 0.2rem; opacity: 0.7; transition: opacity 0.2s; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { opacity: 1; }
.theme-toggle svg { width: 1.1em; height: 1.1em; }

/* ====== Content ====== */
.content { flex: 1; overflow-y: auto; padding: 1.25rem; min-width: 0; }

/* ====== Topbar ====== */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--card-border); }
.topbar-date { font-size: 1.05rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 0.8rem; }
.alert-wrapper { position: relative; }
.alert-btn { background: none; border: none; font-size: 1.3rem; cursor: pointer; position: relative; padding: 0.2rem 0.4rem; filter: grayscale(0.3); }
.alert-btn:hover { filter: none; }
.alert-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 1px 5px; border-radius: 8px; }
.hidden { display: none !important; }

/* Refresh button */
.last-refresh { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.refresh-btn { background: none; border: 1px solid var(--card-border); border-radius: var(--radius-sm); width: 30px; height: 30px; font-size: 1.1rem; cursor: pointer; color: var(--text-dim); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.refresh-btn:hover { color: var(--text); border-color: var(--text-dim); }
.refresh-btn.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Alert dropdown ====== */
.alert-dropdown {
  position: absolute; top: 100%; right: 0; z-index: 150;
  width: 380px; max-height: 420px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden; margin-top: 0.4rem;
}
.alert-dd-header { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; border-bottom: 1px solid var(--card-border); }
.alert-dd-header h3 { font-size: 0.85rem; }
.alert-dd-list { max-height: 360px; overflow-y: auto; }
.btn-sm { background: var(--surface); border: 1px solid var(--card-border); color: var(--text-dim); font-size: 0.72rem; padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); cursor: pointer; }
.btn-sm:hover { color: var(--text); background: var(--card-hover); }
.alert-item { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 1rem; border-bottom: 1px solid var(--card-border); font-size: 0.8rem; }
.alert-item:last-child { border-bottom: none; }
.alert-item.unread { background: rgba(59,130,246,0.06); }
.alert-sev { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.alert-msg { flex: 1; }
.alert-msg .alert-machine { font-weight: 600; }
.alert-time { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ====== Views ====== */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.15s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ====== Overview ====== */
.overview-grid { display: grid; grid-template-columns: 1fr 300px 300px; gap: 1rem; align-items: start; }
.ov-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ov-side { display: flex; flex-direction: column; gap: 1rem; }
.ov-notif-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); }
.ov-notif-side #w-btc-mini { flex: 0 0 auto; }
.ov-notif-side #w-notif { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ov-notif-side #w-notif .widget-body { flex: 1; min-height: 0; overflow-y: auto; }
.ov-notif-side #w-errors { display: flex; flex-direction: column; flex: 0 1 auto; max-height: 220px; min-height: 0; overflow: hidden; }
.ov-notif-side #w-errors .widget-body { flex: 1; min-height: 0; overflow-y: auto; }
@media (max-width: 1400px) {
  .overview-grid { grid-template-columns: 1fr 280px 280px; }
}
@media (max-width: 1200px) {
  .overview-grid { grid-template-columns: 1fr 260px; }
  .ov-notif-side { display: contents; position: static; max-height: none; }
  .ov-notif-side #w-notif, .ov-notif-side #w-errors, .ov-notif-side #w-btc-mini { display: block; max-height: none; }
  .ov-notif-side #w-notif .widget-body, .ov-notif-side #w-errors .widget-body { max-height: 320px; overflow-y: auto; }
}
.widget-row { display: flex; gap: 1rem; }
.widget-row .flex-1 { flex: 1; min-width: 0; }

/* ====== Widget ====== */
.widget { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; }
.widget-header { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 1rem; border-bottom: 1px solid var(--card-border); }
.widget-header h3 { font-size: 0.85rem; font-weight: 600; }
.widget-link { font-size: 0.75rem; color: var(--blue); text-decoration: none; }
.widget-link:hover { text-decoration: underline; }
.widget-body { padding: 0.8rem 1rem; }
/* Primary widgets get subtle accent */
#w-power { border-color: rgba(6,182,212,0.25); }
#w-power .widget-header h3 { color: var(--cyan); }
#w-machines-mini { border-color: rgba(59,130,246,0.2); }
#w-machines-mini .widget-header h3 { color: var(--blue); }

/* Error states */
.err-msg { color: var(--red) !important; font-size: 0.8rem; }

/* Skeleton loading */
.widget-body .dim { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Chart loading state */
.chart-wrap { position: relative; }
.chart-wrap::before {
  content: attr(data-loading);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--text-muted); pointer-events: none; z-index: 1;
}
.chart-wrap.chart-loaded::before { display: none; }

/* Claude cache toggle */
.cl-cache-btn { transition: all 0.15s; }
.cl-cache-btn:hover { border-color: var(--purple); color: var(--text); }

/* ====== GitHub Contributions ====== */
.gh-contrib { overflow-x: auto; }
.gh-summary { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.6rem; font-size: 0.8rem; color: var(--text-dim); }
.gh-summary strong { color: var(--text); font-size: 1.1rem; }
.gh-graph { display: flex; gap: 2px; }
.gh-col { display: flex; flex-direction: column; gap: 2px; }
.gh-cell { width: 11px; height: 11px; border-radius: 2px; position: relative; cursor: pointer; }
.gh-cell:hover { outline: 1px solid var(--text-dim); outline-offset: -1px; }
.gh-cell[data-level="0"] { background: #161b22; }
.gh-cell[data-level="1"] { background: #0e4429; }
.gh-cell[data-level="2"] { background: #006d32; }
.gh-cell[data-level="3"] { background: #26a641; }
.gh-cell[data-level="4"] { background: #39d353; }
.gh-months { display: flex; gap: 2px; margin-bottom: 4px; font-size: 0.62rem; color: var(--text-muted); }
.gh-months span { display: inline-block; }
.gh-legend { display: flex; align-items: center; gap: 3px; margin-top: 0.5rem; font-size: 0.68rem; color: var(--text-muted); justify-content: flex-end; }
.gh-legend .gh-cell { width: 10px; height: 10px; }
.gh-day-labels { display: flex; flex-direction: column; gap: 2px; margin-right: 4px; font-size: 0.6rem; color: var(--text-muted); justify-content: flex-start; padding-top: 0; }
.gh-day-labels span { height: 11px; line-height: 11px; }

/* ====== Weather ====== */
.weather-main { display: flex; align-items: center; gap: 0.8rem; }
.weather-icon-big { font-size: 2.4rem; line-height: 1; }
.weather-temp { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.weather-temp sup { font-size: 1rem; font-weight: 400; }
.weather-info { flex: 1; }
.weather-desc { font-size: 0.9rem; margin-bottom: 0.2rem; }
.weather-detail { font-size: 0.75rem; color: var(--text-dim); line-height: 1.6; }
.weather-city { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.weather-forecast { display: flex; gap: 0.4rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--card-border); }
.forecast-day { flex: 1; text-align: center; font-size: 0.72rem; padding: 0.45rem 0.15rem; background: var(--surface); border-radius: var(--radius-sm); transition: background 0.15s; }
.forecast-day .fc-date { color: var(--text-dim); margin-bottom: 0.15rem; font-size: 0.68rem; line-height: 1.3; }
.forecast-day .fc-date b { color: var(--cyan); }
.forecast-day .fc-icon { font-size: 1.3rem; margin: 0.15rem 0; }
.forecast-day .fc-temp { font-weight: 600; }
.forecast-day .fc-temp .lo { color: var(--text-dim); font-weight: 400; }
.forecast-day .fc-desc { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forecast-day.fc-today { background: var(--card-hover); border: 1px solid var(--blue); }

/* ====== Sites ====== */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.4rem; }
.site-chip { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; color: var(--text); font-size: 0.78rem; transition: background 0.15s; overflow: hidden; }
.site-chip:hover { background: var(--card-hover); }
.site-chip.site-primary { box-shadow: 0 0 0 1px rgba(59,130,246,0.3), 0 0 8px rgba(59,130,246,0.1); }
.site-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.site-dot.ok { background: var(--green); }
.site-dot.err { background: var(--red); }
.site-dot.unknown { background: var(--text-muted); }
.site-ms { font-size: 0.68rem; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }

/* ====== Sites detail ====== */
.sites-detail-summary { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.8rem; }
.sites-detail-summary strong { color: var(--text); font-weight: 700; }
.sites-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.8rem; }
.site-detail-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; }
.site-detail-card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.site-detail-card .sd-desc { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.5rem; line-height: 1.35; }
.site-detail-card .sd-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.2rem 0; }
.site-detail-card .sd-row .sd-label { color: var(--text-dim); }
.site-detail-card .sd-uptime.up-good { color: var(--green); }
.site-detail-card .sd-uptime.up-warn { color: var(--yellow); }
.site-detail-card .sd-uptime.up-bad { color: var(--red); }

/* ====== Umami ====== */
.umami-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; }
.umami-card { padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); background: var(--surface); }
.umami-card .uc-domain { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umami-card .uc-stats { display: flex; gap: 0.8rem; }
.umami-card .uc-stat { font-size: 0.75rem; }
.umami-card .uc-stat strong { display: block; font-size: 1rem; color: var(--text); }
.umami-card .uc-stat span { color: var(--text-dim); }
.umami-nocfg { font-size: 0.82rem; color: var(--text-dim); text-align: center; padding: 1rem; }

/* ====== PM2 ====== */
.pm2-list { display: flex; flex-direction: column; gap: 0.3rem; }
.pm2-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; padding: 0.3rem 0.5rem; background: var(--surface); border-radius: var(--radius-sm); }
.pm2-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pm2-dot.online { background: var(--green); }
.pm2-dot.stopped { background: var(--red); }
.pm2-dot.errored { background: var(--orange); }
.pm2-name { flex: 1; font-weight: 500; }
.pm2-meta { font-size: 0.72rem; color: var(--text-dim); }

/* ====== Git ====== */
.git-list { display: flex; flex-direction: column; gap: 0.3rem; }
.git-item { font-size: 0.78rem; padding: 0.35rem 0.5rem; background: var(--surface); border-radius: var(--radius-sm); }
.git-item .gi-repo { font-weight: 600; color: var(--cyan); }
.git-item .gi-msg { color: var(--text); margin-top: 0.15rem; }
.git-item .gi-meta { color: var(--text-muted); font-size: 0.7rem; }

/* ====== SSL ====== */
.ssl-list { display: flex; flex-direction: column; gap: 0.25rem; }
.ssl-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; padding: 0.3rem 0.5rem; background: var(--surface); border-radius: var(--radius-sm); }
.ssl-item .ssl-domain { flex: 1; }
.ssl-item .ssl-days { font-weight: 600; }
.ssl-item .ssl-days.ok { color: var(--green); }
.ssl-item .ssl-days.warn { color: var(--yellow); }
.ssl-item .ssl-days.crit { color: var(--red); }


/* ====== Mini machines ====== */
.mini-machine { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; cursor: pointer; transition: opacity 0.15s; }
.mini-machine:not(:last-child) { border-bottom: 1px solid var(--card-border); }
.mini-machine.offline { opacity: 0.45; }
.mini-machine:hover { opacity: 1; }
.mm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mm-dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.mm-dot.off { background: var(--red); }
.mm-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; flex-shrink: 0; }
.mm-info { flex: 1; min-width: 0; }
.mm-name { font-size: 0.82rem; font-weight: 500; }
.mm-meta { font-size: 0.7rem; color: var(--text-dim); }
.mm-bars { width: 80px; display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.mm-bar { height: 4px; background: var(--bar-bg); border-radius: 2px; overflow: hidden; }
.mm-bar-fill { height: 100%; border-radius: 2px; }

/* ====== Uptime ====== */
.uptime-list { display: flex; flex-direction: column; gap: 0.35rem; }
.uptime-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.uptime-name { width: 4.5rem; color: var(--text-dim); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uptime-bar { flex: 1; height: 12px; display: flex; gap: 1px; border-radius: 2px; overflow: hidden; }
.uptime-bar .ub { flex: 1; min-width: 1px; }
.uptime-pct { width: 3rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ====== Ping ====== */
.ping-list { display: flex; flex-direction: column; gap: 0.25rem; }
.ping-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; padding: 0.25rem 0.4rem; background: var(--surface); border-radius: var(--radius-sm); }
.ping-target { flex: 1; }
.ping-ms { font-weight: 600; font-variant-numeric: tabular-nums; }
.ping-ms.good { color: var(--green); }
.ping-ms.mid { color: var(--yellow); }
.ping-ms.bad { color: var(--red); }

/* ====== Mining ====== */
.mining-range { display: flex; gap: 4px; margin-bottom: 1rem; }
.mr-tab { padding: 0.35rem 0.8rem; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-dim); font-size: 0.8rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s; }
.mr-tab:hover { color: var(--text); background: var(--card-hover); }
.mr-tab.active { color: var(--text); background: var(--card); font-weight: 600; border-color: var(--orange); }
.mining-charts { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.chart-wrap { padding: 0.5rem 0.8rem; height: 220px; }
.mining-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.ms-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.8rem 1rem; text-align: center; min-width: 0; }
.ms-card .ms-val { font-size: 1.35rem; font-weight: 700; color: var(--orange); line-height: 1.25; overflow-wrap: anywhere; }
.ms-card .ms-val.hash { color: var(--cyan); }
.ms-card .ms-val.power { color: var(--yellow); }
.ms-card .ms-val.temp { color: var(--red); }
.ms-card .ms-val.shares { color: var(--green); }
.ms-card .ms-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.15rem; }

.mining-extras-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.mx-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.mx-card .mx-title { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.7rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--card-border); display: flex; align-items: center; gap: 0.4rem; }
.mx-card .mx-icon { display: inline-flex; align-items: center; }
.mx-card .mx-icon svg { width: 1.1em; height: 1.1em; }
.mx-card .mx-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.25rem 0; font-size: 0.85rem; }
.mx-card .mx-row .mx-k { color: var(--text-dim); }
.mx-card .mx-row .mx-v { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.mx-card.lottery .mx-title { color: var(--accent, var(--orange)); }
.mx-card.cost .mx-title { color: var(--yellow); }

.ai-totals { display: flex; flex-direction: column; gap: 0.25rem; }
.ai-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; padding: 0.15rem 0; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ai-name { flex: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.ai-count { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ai-hosts { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--card-border); display: flex; flex-direction: column; gap: 0.2rem; }
.ai-host { display: flex; justify-content: space-between; font-size: 0.7rem; }
.ai-host-name { color: var(--text-dim); }
.ai-host-detail { color: var(--text); font-family: var(--bs-font-monospace, monospace); font-size: 0.65rem; }

.machine-card.miner-link { transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease; }
.machine-card.miner-link:hover { transform: translateY(-2px); border-color: var(--accent, var(--orange)); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.machine-card.miner-link:focus-visible { outline: 2px solid var(--accent, var(--orange)); outline-offset: 2px; }

.miner-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 1rem; }
.miner-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; }
.miner-card-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--card-border); }
.miner-card-header .mc-dot { width: 10px; height: 10px; }
.miner-card-header h3 { font-size: 0.95rem; flex: 1; }
.miner-card-header .miner-model { font-size: 0.75rem; color: var(--text-dim); }
.miner-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; padding: 0.8rem 1rem; }
.miner-stat { text-align: center; }
.miner-stat .mv { font-size: 1.1rem; font-weight: 700; }
.miner-stat .mv.hash { color: var(--cyan); }
.miner-stat .mv.power { color: var(--yellow); }
.miner-stat .mv.temp { color: var(--red); }
.miner-stat .mv.eff { color: var(--green); }
.miner-stat .ml { font-size: 0.68rem; color: var(--text-dim); }
.miner-chart { padding: 0 1rem 0.6rem; }
.miner-chart-bars { display: flex; align-items: flex-end; gap: 1px; height: 60px; }
.miner-chart-bars .mcb { flex: 1; min-width: 1px; border-radius: 1px 1px 0 0; transition: opacity 0.15s; }
.miner-chart-bars .mcb:hover { opacity: 0.8; }
.miner-chart-label { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-top: 0.25rem; }
.miner-details { padding: 0.6rem 1rem; border-top: 1px solid var(--card-border); display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1rem; font-size: 0.75rem; }
.miner-details .md-row { display: flex; justify-content: space-between; }
.miner-details .md-row .md-k { color: var(--text-dim); }

/* ====== Power ====== */
.power-range { display: flex; gap: 2px; }
.pw-tab { padding: 0.15rem 0.5rem; border: 1px solid var(--card-border); background: none; color: var(--text-dim); font-size: 0.7rem; cursor: pointer; border-radius: 3px; }
.pw-tab:hover { color: var(--text); }
.pw-tab.active { color: var(--text); background: var(--surface); border-color: var(--blue); }
.power-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.power-card { flex: 1; min-width: 140px; background: var(--surface); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
.power-card .pw-name { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.power-card .pw-current { font-size: 1.4rem; font-weight: 700; color: var(--cyan); }
.power-card .pw-current span { font-size: 0.75rem; font-weight: 400; color: var(--text-dim); }
.power-card .pw-details { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.3rem; line-height: 1.5; }
.power-card.power-off { opacity: 0.5; }
.power-card .pw-off { font-size: 0.65rem; color: var(--red, #e55); background: rgba(238,85,85,0.15); padding: 0.1em 0.4em; border-radius: 3px; margin-left: 0.3em; vertical-align: middle; }
.power-chart { margin-top: 0.6rem; display: flex; align-items: flex-end; gap: 1px; height: 42px; overflow: hidden; }
.power-chart .pw-bar { flex: 1; background: var(--cyan); border-radius: 1px 1px 0 0; min-width: 1px; max-width: 6px; opacity: 0.7; transition: opacity 0.15s; }
.power-chart .pw-bar:hover { opacity: 1; }
.power-total { margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--card-border); display: flex; gap: 1.5rem; font-size: 0.78rem; }
.power-total .pt-item strong { color: var(--text); }

/* ====== Power detail tab ====== */
.power-detail-range { display: flex; gap: 4px; margin-bottom: 1rem; }
.pd-summary { display: flex; gap: 1rem; margin-bottom: 1rem; }
.pd-sum-item { flex: 1; background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.pd-sum-val { font-size: 1.6rem; font-weight: 700; color: var(--cyan); }
.pd-sum-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }
.pd-table { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.pd-header { display: grid; grid-template-columns: 2fr 0.7fr repeat(4, 1fr); padding: 0.5rem 0.8rem; font-size: 0.72rem; color: var(--text-dim); border-bottom: 1px solid var(--card-border); font-weight: 600; }
.pd-row { display: grid; grid-template-columns: 2fr 0.7fr repeat(4, 1fr); padding: 0.55rem 0.8rem; font-size: 0.8rem; border-bottom: 1px solid var(--card-border); align-items: center; }
.pd-row:last-child { border-bottom: none; }
.pd-row.pd-off { opacity: 0.45; }
.pd-name { font-weight: 500; }
.pd-tag { font-size: 0.65rem; color: var(--text-dim); background: var(--hover); padding: 0.1em 0.35em; border-radius: 3px; }
.pd-status { font-size: 0.72rem; font-weight: 600; }
.pd-on .pd-status { color: var(--green); }
.pd-off .pd-status { color: var(--red, #e55); }
.pd-val { text-align: right; font-variant-numeric: tabular-nums; }
.power-detail-charts { margin-bottom: 1rem; }
.power-detail-charts .chart-wrap { height: 360px; }

@media (max-width: 600px) {
  .pd-summary { flex-direction: column; }
  .pd-header, .pd-row { grid-template-columns: 1.5fr 0.6fr repeat(4, 1fr); font-size: 0.7rem; padding: 0.4rem 0.5rem; }
  .pd-sum-val { font-size: 1.2rem; }
  .pd-table { overflow-x: auto; font-size: 0.75rem; }
  .pd-header, .pd-row { min-width: 500px; }
}

/* ====== Uptime modal ====== */
.utm-tabs { display: flex; gap: 4px; }
.utm-tab {
  padding: 0.35rem 0.8rem; border: 1px solid var(--card-border); background: var(--surface);
  color: var(--text-dim); font-size: 0.8rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s;
}
.utm-tab:hover { color: var(--text); background: var(--card-hover); }
.utm-tab.active { color: var(--text); background: var(--card); font-weight: 600; border-color: var(--blue); }
.utm-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.utm-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.utm-machine { width: 8rem; flex-shrink: 0; display: flex; align-items: center; gap: 0.4rem; }
.utm-bar-wrap { flex: 1; min-width: 0; }
.utm-bar-lg { height: 18px; }
.utm-bar-lg .ub { border-radius: 1px; }
.utm-pct { width: 3.2rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.utm-points { width: 4rem; text-align: right; font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

/* ====== Machines full ====== */
#machines-grid { display: flex; flex-direction: column; gap: 1.2rem; }
.mg-section {}
.mg-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; padding-left: 0.2rem; }
.mg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.machine-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.25rem; cursor: pointer; transition: border-color 0.2s; }
.machine-card:hover { border-color: var(--blue); }
.machine-card.offline { opacity: 0.5; }
.mc-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.mc-icon { font-size: 1.6rem; width: 2.2rem; text-align: center; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; }
.mc-icon svg { width: 1.4rem; height: 1.4rem; }
.mc-title { flex: 1; } .mc-title h2 { font-size: 1rem; font-weight: 600; } .mc-title .mc-os { font-size: 0.75rem; color: var(--text-dim); }
.mc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mc-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); } .mc-dot.off { background: var(--red); }
.mc-stats { display: flex; flex-direction: column; gap: 0.5rem; }
.mc-stat-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.mc-stat-label { width: 2.8rem; color: var(--text-dim); flex-shrink: 0; }
.mc-stat-bar { flex: 1; height: 7px; background: var(--bar-bg); border-radius: 3px; overflow: hidden; }
.mc-stat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.mc-stat-val { min-width: 5.5rem; text-align: right; font-size: 0.75rem; font-variant-numeric: tabular-nums; flex-shrink: 0; white-space: nowrap; }
.mc-footer { margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--card-border); display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.72rem; color: var(--text-dim); }
.mc-footer span::before { content: attr(data-label); margin-right: 0.3rem; opacity: 0.6; }
.mc-peer-msg { text-align: center; font-size: 0.8rem; color: var(--text-dim); padding: 0.8rem 0; }

/* ====== Analytics ====== */
.analytics-range { display: flex; gap: 4px; margin-bottom: 1rem; }
.ar-tab { padding: 0.35rem 0.8rem; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-dim); font-size: 0.8rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s; }
.ar-tab:hover { color: var(--text); background: var(--card-hover); }
.ar-tab.active { color: var(--text); background: var(--card); font-weight: 600; border-color: var(--purple); }
#analytics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
#analytics-grid > .widget:first-child { grid-column: 1 / -1; }
.an-change { font-size: 0.7rem; margin-left: 0.3rem; }
.an-change.up { color: var(--green); }
.an-change.down { color: var(--red); }
.metric-list { display: flex; flex-direction: column; gap: 0.2rem; }
.metric-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; padding: 0.3rem 0; }
.metric-item:not(:last-child) { border-bottom: 1px solid var(--card-border); }
.metric-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-bar-wrap { width: 80px; flex-shrink: 0; }
.metric-bar-outer { height: 6px; background: var(--bar-bg); border-radius: 3px; overflow: hidden; }
.metric-bar-inner { height: 100%; border-radius: 3px; background: var(--purple); }
.metric-val { width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); flex-shrink: 0; }

/* ====== Analytics detail (legacy) ====== */
.analytics-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.5rem; }
.as-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.as-card .as-val { font-size: 1.8rem; font-weight: 700; } .as-card .as-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; }
.analytics-table { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow-x: auto; }
.analytics-table table { width: 100%; border-collapse: collapse; font-size: 0.78rem; white-space: nowrap; }
.analytics-table th { text-align: left; padding: 0.5rem 0.6rem; font-weight: 600; font-size: 0.72rem; color: var(--text-dim); border-bottom: 1px solid var(--card-border); background: var(--surface); }
.analytics-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--card-border); }
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table tr:hover td { background: var(--surface); cursor: pointer; }

/* ====== Modal ====== */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.5rem; max-width: 700px; width: 92%; max-height: 85vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 0.6rem; right: 0.8rem; background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.md-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.2rem; }
.md-icon { font-size: 2rem; } .md-title h2 { font-size: 1.15rem; font-weight: 600; } .md-title .md-os { font-size: 0.8rem; color: var(--text-dim); }
.md-section { margin-bottom: 1rem; }
.md-section h4 { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.md-item { font-size: 0.82rem; } .md-item .md-label { color: var(--text-dim); font-size: 0.72rem; } .md-item .md-val { font-weight: 500; }

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .sidebar { width: 56px; padding: 0.8rem 0; }
  .sidebar-brand { font-size: 0; padding: 0 0 0.8rem; text-align: center; }
  .sidebar-brand::after { content: 'D'; font-size: 1.2rem; -webkit-text-fill-color: var(--blue); }
  .nav-item { justify-content: center; padding: 0.6rem; }
  .nav-item span:not(.nav-icon) { display: none; }
  .nav-icon { margin: 0; }
  .sidebar-footer { padding: 0.6rem 0.4rem 0; font-size: 0.7rem; text-align: center; }
  .sidebar-umami { padding: 0.4rem; font-size: 0.7rem; }
  .sidebar-umami-header span { display: none; }
  .su-total strong { font-size: 0.85rem; }
  .su-sites { display: none; }
  /* Flatten all containers so order works across all widgets */
  .overview-grid { display: flex; flex-direction: column; gap: 0.8rem; }
  .ov-main { display: contents; }
  .ov-side { display: contents; }
  .ov-notif-side { display: contents; }
  .widget-row { display: contents; }
  /* Mobile order: 날씨 → 메모 → sites → services → git → ssl → machines → uptime → ping */
  #w-power { order: 1; }
  #w-sites-ov { order: 2; }
  #w-pm2 { order: 3; }
  #w-git { order: 4; }
  #w-ssl { order: 5; }
  #w-machines-mini { order: 6; }
  #w-uptime { order: 9; }
  #w-ping { order: 10; }
  #w-github { order: 11; }
  .gh-cell { width: 9px; height: 9px; }
  .gh-legend .gh-cell { width: 8px; height: 8px; }
  .gh-day-labels span { height: 9px; line-height: 9px; }
}
/* ====== Mobile hamburger menu ====== */
.mobile-menu-wrapper { display: none; position: relative; }
.hamburger-btn { background: none; border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 6px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; width: 34px; height: 34px; }
.hamburger-btn span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.hamburger-btn.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.mobile-nav { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.4rem; min-width: 160px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.mobile-nav.hidden { display: none; }
.mn-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.55rem 0.8rem; background: none; border: none; border-radius: var(--radius-sm); color: var(--text-dim); font-size: 0.85rem; cursor: pointer; text-align: left; transition: background 0.15s, color 0.15s; }
.mn-item:hover { background: var(--hover); color: var(--text); }
.mn-item.active { background: var(--active); color: var(--text); font-weight: 600; }
.mn-item .nav-icon { font-size: 1rem; width: 1.2em; text-align: center; }

/* ====== Server (VPS) ====== */
.server-info-header { margin-bottom: 1rem; }
.sv-title { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; }
.sv-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sv-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sv-dot.off { background: var(--red); }
.sv-subtitle { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; }
.sv-uptime { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.2rem; }
.server-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.server-summary .ms-val.sv-cpu { color: var(--cyan); }
.server-summary .ms-val.sv-mem { color: var(--purple); }
.server-summary .ms-val.sv-disk { color: var(--yellow); }
.server-summary .ms-val.sv-temp { color: var(--red); }
.server-summary .ms-val.sv-warn { color: var(--yellow) !important; }
.server-summary .ms-val.sv-crit { color: var(--red) !important; }
.sv-caphint { display: inline-block; margin-left: 0.4rem; font-size: 0.68rem; color: var(--text-dim); font-weight: 400; }
.sv-cap { margin-left: 0.5rem; font-size: 0.72rem; font-weight: 400; color: var(--text-dim); letter-spacing: 0.2px; }
.server-range { display: flex; gap: 4px; margin-bottom: 1rem; }
.sv-tab { padding: 0.35rem 0.8rem; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-dim); font-size: 0.8rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s; }
.sv-tab:hover { color: var(--text); background: var(--card-hover); }
.sv-tab.active { color: var(--text); background: var(--card); font-weight: 600; border-color: var(--cyan); }
.server-charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.server-charts .chart-wrap { height: 220px; }
.sv-chart-stats { display: flex; gap: 1.5rem; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 1rem; padding: 0.5rem 0; }
.sv-chart-stats b { color: var(--text); }
.server-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sv-svc-section { margin-bottom: 0.6rem; }
.sv-svc-section:last-child { margin-bottom: 0; }
.sv-svc-label { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.3rem; }
.sv-svc-list { display: flex; flex-direction: column; gap: 0.3rem; }
.sv-net-grid { display: flex; flex-direction: column; gap: 0.25rem; }
.sv-net-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.3rem 0; border-bottom: 1px solid var(--card-border); }
.sv-net-row:last-child { border-bottom: none; }
.sv-net-row .sd-label { color: var(--text-dim); }
.sv-ports { font-size: 0.72rem; color: var(--text-dim); max-width: 200px; text-align: right; word-break: break-all; }
.sv-proc-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.sv-proc-table th { text-align: left; padding: 0.4rem 0.6rem; color: var(--text-dim); font-weight: 600; font-size: 0.72rem; border-bottom: 1px solid var(--card-border); text-transform: uppercase; }
.sv-proc-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--card-border); }
.sv-proc-table tr:hover { background: var(--card-hover); }
.sv-high { color: var(--red); font-weight: 600; }
.sv-mid { color: var(--yellow); }

@media (max-width: 1200px) {
  .server-charts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .server-charts { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: 1fr; }
  .sv-chart-stats { flex-wrap: wrap; gap: 0.8rem; }
}

/* ====== Claude Usage ====== */
.claude-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.cl-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.cl-card-label { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.5px; }
.cl-card-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-cost { color: var(--purple); }
.claude-range { display: flex; gap: 0.3rem; margin-bottom: 1rem; }
.cl-tab { padding: 0.35rem 0.9rem; border: 1px solid var(--card-border); border-radius: var(--radius-sm); background: none; color: var(--text-dim); cursor: pointer; font-size: 0.8rem; transition: all 0.15s; }
.cl-tab:hover { color: var(--text); border-color: var(--text-dim); }
.cl-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.cl-machines-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.cl-machine-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 0.8rem; }
.cl-machine-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.cl-machine-stats { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.cl-machine-stats strong { color: var(--text); }
.cl-machine-models { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.cl-model { background: var(--card); padding: 1px 6px; border-radius: 3px; }
.cl-machine-updated { font-size: 0.68rem; color: var(--text-muted); }
.cl-table-wrap { overflow-x: auto; }
.cl-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.cl-table th { text-align: left; padding: 0.5rem 0.6rem; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--card-border); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3px; }
.cl-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--card-border); }
.cl-table tr:hover { background: var(--card); }
.cl-table-total { background: var(--surface); border-top: 2px solid var(--card-border); }
.cl-table-total td { padding-top: 0.6rem; }
.cl-cost-note { margin-top: 0.6rem; font-size: 0.68rem; color: var(--text-dim); line-height: 1.5; }
.cl-month-row:hover { background: var(--hover); }
.cl-month-row.cl-month-active { background: var(--active); }
.cl-month-row.cl-month-active .cl-expand-hint { transform: rotate(90deg); }
.cl-expand-hint { display: inline-block; font-size: 0.7rem; color: var(--text-dim); margin-left: 0.3em; transition: transform 0.15s; }
.cl-month-clear { cursor: pointer; }

@media (max-width: 600px) {
  .sidebar { display: none; }
  .content { padding: 0.75rem; }
  #machines-grid { grid-template-columns: 1fr; }
  .alert-dropdown { width: 300px; }
  .mobile-menu-wrapper { display: block; }
  .claude-cards { grid-template-columns: repeat(2, 1fr); }
  .cl-machines-grid { grid-template-columns: 1fr; }
  /* Claude tables: hide less important columns on mobile */
  .cl-table th:nth-child(6), .cl-table td:nth-child(6),
  .cl-table th:nth-child(7), .cl-table td:nth-child(7) { display: none; }
  .cl-table { font-size: 0.72rem; }
  .cl-table th, .cl-table td { padding: 0.3rem 0.4rem; }
  /* Node: stack charts and grids */
  .node-status-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .node-stat .ns-value { font-size: 1rem; }
}

/* ====== Site Uptime Badge ====== */
.site-uptime { font-size: 0.65rem; color: var(--green); margin-left: 4px; font-weight: 600; }
.sd-uptime { font-weight: 600; }

/* ====== Node (Bitcoin) Tab ====== */
.node-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.node-stat { background: var(--surface); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.75rem; }
.node-stat .ns-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.node-stat .ns-value { font-size: 1.3rem; font-weight: 700; margin-top: 2px; }
.node-stat .ns-sub { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
.node-stat.highlight { border-color: var(--orange); }
.node-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.node-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.node-block-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--card-border); font-size: 0.8rem; }
.node-block-row:last-child { border-bottom: none; }
.nb-height { font-weight: 700; color: var(--orange); font-family: monospace; }
.nb-hash { color: var(--text-dim); font-family: monospace; font-size: 0.7rem; text-decoration: none; }
.nb-hash:hover { text-decoration: underline; color: var(--blue); }
.nb-interval { color: var(--text-dim); font-size: 0.7rem; margin: 0 0.4rem; }
.nb-txs { color: var(--blue); }
.nb-size { color: var(--text-dim); font-size: 0.75rem; }
.nb-time { color: var(--text-dim); font-size: 0.75rem; }
.node-fee-row { display: flex; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--card-border); font-size: 0.8rem; gap: 0.5rem; }
.node-fee-row:last-child { border-bottom: none; }
.nf-target { color: var(--text-dim); min-width: 80px; flex-shrink: 0; }
.nf-bar { flex: 1; height: 6px; background: var(--card-border); border-radius: 3px; overflow: hidden; }
.nf-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.nf-rate { font-weight: 600; font-family: monospace; min-width: 70px; text-align: right; flex-shrink: 0; }
.node-peer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.node-peer-list { font-size: 0.8rem; }
.node-peer-item { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid var(--card-border); }
.node-peer-item:last-child { border-bottom: none; }
.np-version { font-family: monospace; color: var(--text-dim); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }
.np-count { font-weight: 600; }
.node-sync-bar { width: 100%; height: 6px; background: var(--card-border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.node-sync-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; table-layout: fixed; }
.data-table th { text-align: left; padding: 0.5rem 0.6rem; color: var(--text-dim); font-weight: 600; font-size: 0.72rem; border-bottom: 1px solid var(--card-border); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.data-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--card-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table tr:hover { background: var(--card-hover); }
@media(max-width:768px) { .data-table { font-size: 0.72rem; } .data-table th, .data-table td { padding: 0.3rem 0.4rem; } }
.btc-mini-rows { display: flex; flex-direction: column; gap: 0.3rem; }
.btc-mini-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.btc-mini-row .dim { color: var(--text-dim); font-size: 0.72rem; }
@media(max-width:768px) {
  .node-charts { grid-template-columns: 1fr; }
  .node-grid { grid-template-columns: 1fr; }
  .node-peer-grid { grid-template-columns: 1fr; }
  .node-status-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ====== Services ====== */
:root {
  --svc-pm2: #06b6d4; --svc-systemd: #a855f7; --svc-docker: #3b82f6; --svc-cron: #eab308;
}
.services-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.6rem; }
.services-stats { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-dim); flex-wrap: wrap; }
.services-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.services-search { background: var(--card); border: 1px solid var(--card-border); color: var(--text); padding: 0.35rem 0.6rem; border-radius: 6px; font-size: 0.82rem; width: 220px; outline: none; transition: border-color 0.15s; }
.services-search:focus { border-color: var(--svc-systemd); }
.services-search::placeholder { color: var(--text-muted); }
.services-filters { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.svc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--card-border); background: var(--card); color: var(--text-dim); font-size: 0.74rem; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.svc-chip:hover { background: var(--hover); color: var(--text); }
.svc-chip.active { background: color-mix(in srgb, var(--chip-color, var(--text)) 15%, transparent); color: var(--chip-color, var(--text)); border-color: color-mix(in srgb, var(--chip-color, var(--text)) 45%, transparent); }
.svc-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--chip-color, var(--text-dim)); }
.svc-chip-count { color: var(--text-muted); font-weight: 500; margin-left: 2px; font-variant-numeric: tabular-nums; }
.svc-chip.active .svc-chip-count { color: var(--chip-color, var(--text)); opacity: 0.85; }
.svc-machine-count { font-size: 0.72rem; color: var(--text-muted); background: var(--bar-bg); padding: 1px 7px; border-radius: 10px; margin-left: 6px; font-variant-numeric: tabular-nums; font-weight: 500; }
.svc-empty { padding: 2rem; text-align: center; }
@media (max-width: 640px) { .services-search { width: 100%; } .services-controls { width: 100%; } }
.svc-stat strong { color: var(--text); }
.svc-stat-sep { color: var(--text-muted); }
.svc-machine-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.svc-machine-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; flex-wrap: wrap; gap: 0.5rem; }
.svc-machine-name { font-size: 1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; }
.svc-machine-meta { font-size: 0.78rem; color: var(--text-dim); font-family: monospace; }
.svc-machine-note { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.svc-online, .svc-offline { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.svc-online { background: var(--green); box-shadow: 0 0 4px var(--green); }
.svc-offline { background: var(--red); opacity: 0.6; }
.svc-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.svc-table thead { border-bottom: 1px solid var(--card-border); }
.svc-table th { text-align: left; padding: 0.4rem 0.6rem; color: var(--text-dim); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.svc-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.svc-table tbody tr:last-child td { border-bottom: none; }
.svc-table tbody tr:hover { background: var(--hover); }
.svc-name-cell strong { color: var(--text); font-family: monospace; font-size: 0.82rem; }
.svc-desc-cell { color: var(--text-dim); max-width: 320px; }
.svc-type-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--badge-color) 15%, transparent); color: var(--badge-color); white-space: nowrap; }
.svc-type-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--badge-color); flex-shrink: 0; }
.svc-lang { font-size: 0.7rem; color: var(--text-muted); background: var(--bar-bg); padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.svc-url { font-size: 0.72rem; color: var(--blue); text-decoration: none; font-family: monospace; }
.svc-url:hover { text-decoration: underline; }
.svc-sched { font-size: 0.7rem; color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); padding: 1px 5px; border-radius: 3px; font-family: monospace; }
.svc-status { font-size: 0.72rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.svc-status-ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.svc-status-stopped { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.svc-status-warn { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); }
.svc-status-unknown { background: var(--bar-bg); color: var(--text-muted); }
.svc-status-cron { background: color-mix(in srgb, var(--yellow) 12%, transparent); color: var(--yellow); }
@media(max-width:768px) {
  .svc-table th:nth-child(4), .svc-table td:nth-child(4) { display: none; }
  .svc-machine-header { flex-direction: column; align-items: flex-start; }
  .svc-desc-cell { max-width: none; }
}

/* Power Monthly */
.pw-month-row { cursor: pointer; }
.pw-month-row:hover { background: var(--hover); }
.pw-month-row.pw-month-active { background: var(--active); }
.pw-month-detail { display: none; }
.pw-month-detail.pw-month-active { display: table-row; }
.pw-month-detail .sub-row { font-size: 0.85em; color: var(--muted); padding: 4px 12px; }
.pw-month-clear { margin-left: 8px; }

/* Cost Breakdown Tooltip */
.pw-cost-cell { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; position: relative; }
.tooltip-popup { position: absolute; z-index: 100; bottom: 100%; right: 0; min-width: 280px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.3); padding: 0; font-size: 0.78rem; }
.tooltip-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--card-border); font-weight: 600; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.tooltip-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.tooltip-close:hover { color: var(--text); }
.tooltip-table { width: 100%; border-collapse: collapse; }
.tooltip-table td { padding: 0.3rem 0.8rem; }
.tooltip-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tooltip-table .tooltip-sub td { border-top: 1px solid var(--card-border); color: var(--text-dim); }
.tooltip-table .tooltip-total td { border-top: 2px solid var(--card-border); padding-top: 0.5rem; }

/* Trading tab */
.trading-grid { margin-bottom: 1rem; }
#chart-trading-pnl { min-height: 200px; }
.td-detail td { background: var(--surface); }
.td-day-row:hover { background: var(--hover); }
@media (max-width: 768px) {
  .trading-grid { grid-template-columns: 1fr !important; }
}

/* Sites overview table */
.sites-tbl-summary { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; }
.sites-tbl { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.sites-tbl th, .sites-tbl td { padding: 0.3rem 0.6rem; vertical-align: middle; }
.sites-tbl th { text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 1.5px solid var(--border); font-size: 0.7rem; letter-spacing: 0.02em; text-transform: uppercase; }
.sites-tbl th.thr { text-align: right; }
.sites-tbl td { border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); }
.sites-tbl tr:hover { background: var(--card-hover); }
.sites-tbl .st-name { font-weight: 600; white-space: nowrap; }
.sites-tbl .st-url { white-space: nowrap; }
.sites-tbl .st-url a { color: var(--blue); text-decoration: none; font-size: 0.72rem; }
.sites-tbl .st-url a:hover { text-decoration: underline; }
.sites-tbl .st-desc { color: var(--text-muted); font-size: 0.72rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sites-tbl .st-status, .sites-tbl .st-ms, .sites-tbl .st-ssl, .sites-tbl .st-up { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sites-tbl .st-ms .dim { font-size: 0.62rem; opacity: 0.6; margin-left: 1px; }
.sites-tbl .st-up, .sites-tbl .st-ssl { font-weight: 600; font-size: 0.75rem; }
.sites-tbl .st-status { color: var(--text-muted); font-size: 0.75rem; }
.sites-tbl .up-good { color: var(--green); }
.sites-tbl .up-warn { color: var(--yellow); }
.sites-tbl .up-bad { color: var(--red); }


/* Notifications widget */
.notif-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notif-item { display: block; padding: 0.5rem 0.7rem; background: var(--surface); border-radius: 6px; text-decoration: none; color: inherit; transition: background 0.15s; }
.notif-item:hover { background: var(--card-hover); }
.notif-row { display: flex; justify-content: space-between; font-size: 0.7rem; margin-bottom: 0.25rem; }
.notif-channel { color: var(--orange, #f7931a); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.notif-time { color: var(--text-muted); }
.notif-title { font-size: 0.85rem; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-body { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Bot status widget */
.bot-status-tbl { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.bot-status-tbl th, .bot-status-tbl td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); text-align: left; }
.bot-status-tbl th { color: var(--text-muted); font-weight: 500; font-size: 0.68rem; text-transform: uppercase; }
.bot-status-tbl th.num, .bot-status-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bot-status-tbl .bs-name { display: block; font-size: 0.68rem; color: var(--text-muted); font-weight: 400; margin-top: 0.15rem; }
.bot-status-tbl .bs-ok { color: var(--green, #3fb950); font-weight: 600; }
.bot-status-tbl .bs-warn { color: var(--yellow, #d29922); font-weight: 600; }
.bot-status-tbl .bs-err { color: var(--red, #f85149); font-weight: 600; }
.bot-status-tbl .bs-unknown { color: var(--text-muted); }


/* Channel detail modal */
.bs-row { cursor: pointer; }
.bs-row:hover { background: var(--card-hover); }
.notif-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 1rem; }
.notif-modal { background: var(--surface, #161b22); border: 1px solid var(--border, #21262d); border-radius: 12px; max-width: 600px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
.notif-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border, #21262d); }
.notif-modal-header h3 { margin: 0; font-size: 0.95rem; color: var(--orange, #f7931a); text-transform: uppercase; letter-spacing: 0.03em; }
.notif-modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 0 0.5rem; }
.notif-modal-close:hover { color: var(--text, #c9d1d9); }
.notif-modal-body { padding: 1rem; overflow-y: auto; }
.notif-modal-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notif-modal-item { display: block; padding: 0.6rem 0.8rem; background: var(--bg, #0d1117); border: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); border-radius: 6px; text-decoration: none; color: inherit; transition: border-color 0.15s; }
.notif-modal-item:hover { border-color: var(--orange, #f7931a); }
.nmi-title { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.2rem; }
.nmi-body { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.nmi-time { font-size: 0.68rem; color: var(--text-muted); }


/* Recent Errors widget */
.errors-list { display: flex; flex-direction: column; gap: 0.4rem; }
.err-item { padding: 0.5rem 0.7rem; background: var(--surface); border-radius: 6px; border-left: 3px solid var(--red, #f85149); }
.err-row { display: flex; gap: 0.5rem; align-items: center; font-size: 0.7rem; margin-bottom: 0.2rem; }
.err-level { font-weight: 600; text-transform: uppercase; font-size: 0.62rem; padding: 0 0.35rem; border-radius: 3px; }
.err-level.err-error { background: rgba(248, 81, 73, 0.15); color: var(--red, #f85149); }
.err-level.err-fatal { background: var(--red, #f85149); color: white; }
.err-source { color: var(--text-muted); font-family: var(--font-mono, monospace); }
.err-time { margin-left: auto; color: var(--text-muted); }
.err-msg { font-size: 0.75rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }


/* Error detail modal */
.err-item { cursor: pointer; }
.err-item:hover { opacity: 0.85; }
.err-detail-time { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.err-detail-msg { font-size: 0.9rem; margin-bottom: 1rem; padding: 0.6rem; background: var(--bg, #0d1117); border-radius: 6px; word-wrap: break-word; }
.err-detail-details { font-size: 0.72rem; color: var(--text-muted); background: var(--bg, #0d1117); padding: 0.8rem; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 50vh; }

/* ── Diagnostics (자가진단) tab ──────────────────────────────────── */
.diag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.diag-grid .chart-wrap { height: 200px; }
.diag-stat { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 0.35rem 0; border-bottom: 1px solid var(--card-border); }
.diag-stat:last-child { border-bottom: none; }
.diag-stat span { color: var(--text-dim); }
.diag-stat b { font-variant-numeric: tabular-nums; }
.diag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.diag-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.diag-table th { text-align: left; color: var(--text-dim); font-weight: 500; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--card-border); }
.diag-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--card-border); font-variant-numeric: tabular-nums; }
.diag-table tr:last-child td { border-bottom: none; }
.diag-table .diag-err { color: var(--text-dim); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-errlog { list-style: none; font-size: 0.76rem; display: flex; flex-direction: column; gap: 0.35rem; }
.diag-errlog li { font-variant-numeric: tabular-nums; word-break: break-all; }
.diag-err-src { color: var(--orange); }
@media (max-width: 900px) { .diag-grid { grid-template-columns: 1fr; } }
