:root {
  --navy: #1a4b8c;
  --navy-soft: #2d6cb8;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-yellow: #fff8d6;
  --bg-yellow-border: #f5d442;
  --bg-red: #fde2e2;
  --bg-red-border: #f5a5a5;
  --bg-green: #e3f1d8;
  --bg-green-border: #9bcb6e;
  --text: #222;
  --text-muted: #666;
  --border: #e0e0e0;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
  font-size: 15px;
}
.dash-wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 48px; }
.dash-header h1 { color: var(--navy); margin: 0 0 4px; font-size: 26px; }
.dash-header .subtitle { color: var(--text-muted); font-size: 13px; }

/* Status bar */
.status-bar {
  margin: 16px 0 28px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
}
.status-item { display: flex; align-items: center; gap: 4px; }
.status-item .label { color: var(--text-muted); }
.status-item .value { font-weight: 600; }
.status-item.ok .value { color: #2a7d2a; }
.status-item.warn .value { color: #b58900; }
.status-item.alert .value { color: #c33; }
.status-item.muted .value { color: #aaa; }

/* Widgets */
.widget {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
  background: white;
}
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.widget-header h2 { color: var(--navy); margin: 0; font-size: 17px; }
.widget-header a { color: var(--navy-soft); font-size: 13px; text-decoration: none; }
.widget-header a:hover { text-decoration: underline; }
.widget-meta { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }

.widget-row {
  padding: 6px 0;
  display: grid;
  grid-template-columns: 220px 1fr 100px 60px;
  gap: 12px;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}
.widget-row:last-child { border-bottom: none; }
.widget-row .sku { font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; }
.widget-row .desc { color: var(--text-muted); font-size: 13px; }
.widget-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.widget-row .badge { font-size: 12px; }
.widget-row.increase .num { color: #c33; }
.widget-row.decrease .num { color: #2a7d2a; }
.widget-row.new .num { color: #888; font-style: italic; }
.widget-row.removed .num { color: #888; font-style: italic; }
.widget-row.drop .num { color: #c33; }
.widget-row.spike .num { color: #2a7d2a; }
.widget-row a { color: var(--navy-soft); text-decoration: none; }
.widget-row a:hover { text-decoration: underline; }

.widget-summary { font-size: 14px; margin-bottom: 6px; }
.widget-empty { color: var(--text-muted); font-style: italic; padding: 8px 0; }

/* Section heading inside widget */
.widget-subtitle { font-weight: 600; margin: 12px 0 4px; font-size: 13px; color: var(--navy); }

/* Tools entry cards (bottom) */
.tools-section { margin-top: 36px; }
.tools-section h2 { color: var(--navy); font-size: 17px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.tool-card {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  background: white;
}
.tool-card:hover { background: var(--bg-soft); border-color: var(--navy); }
.tool-card h3 { color: var(--navy); margin: 0 0 4px; font-size: 16px; }
.tool-card p { color: var(--text-muted); margin: 0; font-size: 13px; }

/* Alert categories within Widget 3 */
.alert-cat { margin: 8px 0; }
.alert-cat-summary { font-weight: 600; }
.alert-cat-skus { margin-left: 16px; padding-left: 8px; border-left: 2px solid var(--border); }
