/* =============================================================
   BMT — Design System (mockup)
   Tokens, layout primitives, componenti
   ============================================================= */

:root {
  /* Brand */
  --brand-primary: #1f6f43;
  --brand-primary-dark: #154d2e;
  --brand-primary-soft: #e6f3eb;
  --brand-accent: #d97a2c;
  --brand-accent-soft: #fdeedd;

  /* Status */
  --success: #1f7a4d;
  --success-soft: #e3f4ec;
  --warning: #c98410;
  --warning-soft: #fbf1d9;
  --danger: #c0382b;
  --danger-soft: #fbe5e2;
  --info: #2a5fcc;
  --info-soft: #e3ecfa;

  /* Neutrals */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-app: #f5f7f5;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f4;
  --border: #e2e8e3;
  --border-strong: #c8d2cb;

  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-app);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 0; }

small { color: var(--text-secondary); font-size: 12px; }

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ----------- Layout: app shell ------------ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f3a23;
  color: #d6e7dd;
  padding: var(--s-5) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4ea874, #1f6f43);
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}
.brand-name {
  font-weight: 700; font-size: 16px; color: white;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 11px; color: #95b6a3; margin-top: 2px;
}

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; color: #6e8b7a; text-transform: uppercase; letter-spacing: 0.08em; padding: var(--s-3) var(--s-3) var(--s-1); }

.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-3);
  border-radius: 8px;
  color: #c1d6c8;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,0.10); color: white; }
.nav-item .badge-mini { margin-left: auto; }
.nav-item .icon { width: 18px; height: 18px; opacity: 0.85; flex-shrink: 0; }
.nav-item.soon { color: #6e8b7a; cursor: not-allowed; }
.nav-item.soon:hover { background: transparent; color: #6e8b7a; text-decoration: none; }
.nav-item.soon::after {
  content: 'soon';
  margin-left: auto;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6e8b7a;
  border: 1px solid #3d5546;
  border-radius: 99px;
  padding: 1px 6px;
}
.brand[href] { text-decoration: none; }
.brand[href]:hover .brand-name { color: #9ed8b6; }

.tenant-pill {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  margin-top: auto;
  font-size: 12px;
}
.tenant-pill .avatar { width: 24px; height: 24px; border-radius: 6px; background: var(--brand-accent); color: white; display:grid; place-items:center; font-weight:600; font-size: 11px; }

/* Content */
.content { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--s-3) var(--s-6);
  display: flex; align-items: center; gap: var(--s-4);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; }
.topbar-spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 8px var(--s-3);
  width: 320px;
  color: var(--text-secondary);
}
.search input {
  border: none; outline: none; background: transparent;
  flex: 1; font-size: 13px; color: var(--text-primary);
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: grid; place-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--bg-subtle); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.user-chip {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
}
.avatar-md { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #5e9cff, #2a5fcc); color: white; display:grid; place-items:center; font-weight: 600; font-size: 12px; }

.main {
  padding: var(--s-6);
  flex: 1;
  display: flex; flex-direction: column; gap: var(--s-5);
}

/* ----------- Components ------------ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-header .muted { font-size: 12px; }
.card-body { padding: var(--s-5); }
.card-body.dense { padding: 0; }

/* Stat */
.stat {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-5);
}
.stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-delta { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 9px var(--s-4);
  font-size: 13px; font-weight: 500;
  border-radius: 8px; border: 1px solid transparent;
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer;
  transition: 0.12s;
}
.btn:hover { background: var(--bg-subtle); }
.btn.primary { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.btn.primary:hover { background: var(--brand-primary-dark); }
.btn.outline { border-color: var(--border-strong); }
.btn.danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px var(--s-3); font-size: 12px; }
.btn.lg { padding: 12px var(--s-5); font-size: 14px; }
.btn.block { width: 100%; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle); color: var(--text-secondary);
  white-space: nowrap;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.badge .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-mini {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill);
  background: var(--brand-accent); color: white;
}

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  background: var(--bg-subtle); color: var(--text-secondary);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

/* Grid helpers */
.grid { display: grid; gap: var(--s-5); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2-1 { grid-template-columns: 2fr 1fr; }
.grid.cols-1-2 { grid-template-columns: 1fr 2fr; }

.row { display: flex; gap: var(--s-3); align-items: center; }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.between { justify-content: space-between; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: var(--s-3) var(--s-5); text-align: left; }
.table th {
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-subtle); }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.field input, .field select, .field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  outline: none;
}
.field input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-soft); }
.field .hint { font-size: 11px; color: var(--text-muted); }

/* Alert */
.alert {
  display: flex; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  background: var(--info-soft);
  border-left: 3px solid var(--info);
  font-size: 13px;
}
.alert.warning { background: var(--warning-soft); border-color: var(--warning); }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); }
.alert.success { background: var(--success-soft); border-color: var(--success); }

/* Timeline (tracciabilità) */
.timeline { position: relative; padding-left: 38px; }
.timeline::before {
  content: ''; position: absolute; left: 18px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border-strong);
}
.timeline-step { position: relative; margin-bottom: var(--s-6); }
.timeline-step::before {
  content: ''; position: absolute; left: -27px; top: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--brand-primary);
}
.timeline-step.pending::before { background: white; box-shadow: 0 0 0 2px var(--border-strong); }
.timeline-step.warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }

.timeline-step .step-head {
  display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-2);
}
.timeline-step .step-title { font-weight: 600; font-size: 14px; }
.timeline-step .step-time { font-size: 12px; color: var(--text-secondary); }

.params-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  background: var(--bg-subtle);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  margin-top: var(--s-2);
}
.param { display: flex; flex-direction: column; gap: 2px; }
.param-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.param-value { font-size: 13px; font-weight: 500; }

/* Index page */
.showcase {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s-12) var(--s-6);
}
.showcase-hero { text-align: center; margin-bottom: var(--s-12); }
.showcase-hero h1 { font-size: 36px; margin-bottom: var(--s-3); }
.showcase-hero p { color: var(--text-secondary); font-size: 16px; max-width: 720px; margin: 0 auto; }

.showcase-section { margin-bottom: var(--s-12); }
.showcase-section h2 {
  font-size: 14px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}

.mockup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-5);
}
.mockup-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--s-5);
  display: flex; gap: var(--s-4);
  text-decoration: none; color: inherit;
  transition: 0.15s;
  box-shadow: var(--shadow-xs);
}
.mockup-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.mockup-card .preview {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  background: var(--brand-primary-soft);
  display: grid; place-items: center;
  color: var(--brand-primary);
  flex-shrink: 0;
}
.mockup-card h3 { margin: 0 0 4px 0; }
.mockup-card .desc { font-size: 12px; color: var(--text-secondary); }

/* Mobile frame */
.phone-frame {
  width: 390px;
  height: 800px;
  border-radius: 44px;
  background: #1a1a1a;
  padding: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  position: relative;
  flex-shrink: 0;
}
.phone-frame::before {
  content: ''; position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #1a1a1a;
  border-radius: 20px;
  z-index: 5;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: var(--bg-app);
  display: flex; flex-direction: column;
  position: relative;
}
.status-bar {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
}

.phones-stage {
  background: linear-gradient(135deg, #e9efea, #d8e3da);
  min-height: 100vh;
  padding: var(--s-12) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-8);
}
.phones-row {
  display: flex; gap: var(--s-8); flex-wrap: wrap; justify-content: center;
  padding: var(--s-6) 0;
}
.phones-stage .stage-title { text-align: center; max-width: 720px; }
.phones-stage .stage-title h1 { font-size: 30px; margin-bottom: var(--s-3); }
.phones-stage .stage-title p { color: var(--text-secondary); font-size: 15px; }
.phone-label {
  text-align: center; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: var(--s-3);
}

/* Mobile screens */
.m-header {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s-3);
}
.m-header .back {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-subtle);
  display: grid; place-items: center;
}
.m-header .title { font-weight: 600; font-size: 15px; }
.m-header .subtitle { font-size: 11px; color: var(--text-secondary); }

.m-content { flex: 1; overflow-y: auto; padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }

.m-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--s-4);
  border: 1px solid var(--border);
}

.m-tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--s-2) 0 calc(var(--s-2) + 16px);
}
.m-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--text-muted);
}
.m-tab.active { color: var(--brand-primary); }
.m-tab .icon { width: 22px; height: 22px; }

/* Big touch button */
.big-action {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4);
  background: var(--brand-primary-soft);
  color: var(--brand-primary-dark);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #cae3d3;
}
.big-action .icon-circle {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-primary);
  color: white;
  display: grid; place-items: center;
}

/* Consumer hero */
.consumer-hero {
  height: 280px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.45) 100%),
              linear-gradient(135deg, #d2825a, #944922);
  position: relative;
  display: flex; align-items: flex-end;
  padding: var(--s-5);
  color: white;
}
.consumer-hero .product-pill {
  position: absolute; top: var(--s-4); left: var(--s-4);
  background: rgba(255,255,255,0.95);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.consumer-hero h1 { font-size: 22px; line-height: 1.2; margin-bottom: 4px; color: white; }
.consumer-hero .tagline { font-size: 13px; opacity: 0.92; }

.cert-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.cert {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.cert .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); }

.journey-step {
  display: flex; gap: var(--s-3); padding: var(--s-3) 0;
  border-bottom: 1px dashed var(--border);
}
.journey-step:last-child { border-bottom: none; }
.journey-step .num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-primary-soft);
  color: var(--brand-primary-dark);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.journey-step .when { font-size: 11px; color: var(--text-muted); }
.journey-step .what { font-weight: 600; font-size: 13px; }
.journey-step .where { font-size: 12px; color: var(--text-secondary); }

.blockchain-card {
  background: linear-gradient(135deg, #1f3a5f, #0f1f3a);
  color: white;
  border-radius: var(--radius);
  padding: var(--s-4);
  display: flex; gap: var(--s-3);
}
.blockchain-card .check {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.blockchain-card .label { font-size: 11px; color: #9bb3d4; text-transform: uppercase; letter-spacing: 0.06em; }
.blockchain-card .title { font-weight: 600; margin-top: 2px; }
.blockchain-card .hash { font-family: var(--font-mono); font-size: 10px; color: #b8c8e0; margin-top: 6px; word-break: break-all; }

/* Sparkline / mini chart */
.spark { width: 100%; height: 40px; }

/* Sensor card */
.sensor-tile {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sensor-tile.alert { border-color: var(--danger); background: var(--danger-soft); }
.sensor-tile .head { display: flex; justify-content: space-between; align-items: flex-start; }
.sensor-tile .name { font-weight: 600; font-size: 13px; }
.sensor-tile .loc { font-size: 11px; color: var(--text-secondary); }
.sensor-tile .value { font-size: 22px; font-weight: 700; }
.sensor-tile .range { font-size: 11px; color: var(--text-muted); }

/* DAG editor / template */
.dag-canvas {
  background: var(--bg-subtle);
  background-image:
    radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: var(--radius);
  padding: var(--s-6);
  min-height: 460px;
  position: relative;
  overflow: hidden;
}
.dag-node {
  position: absolute;
  background: var(--bg-card);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-sm);
  min-width: 170px;
  font-size: 13px;
  cursor: grab;
}
.dag-node.selected { box-shadow: 0 0 0 3px var(--brand-primary-soft), var(--shadow-md); }
.dag-node .step-code { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dag-node .step-name { font-weight: 600; margin-top: 2px; }
.dag-node .step-meta { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.dag-node.start { border-color: var(--brand-accent); }
.dag-node.end { border-color: var(--info); }

/* Floor plan */
.floor-plan {
  background: var(--bg-subtle);
  border-radius: var(--radius);
  padding: var(--s-4);
  position: relative;
  height: 380px;
  background-image:
    repeating-linear-gradient(0deg, var(--border) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 40px);
}
.zone {
  position: absolute;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.sensor-pin {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--success);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--success);
  cursor: pointer;
}
.sensor-pin.warn { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.sensor-pin.alert {
  background: var(--danger); box-shadow: 0 0 0 1px var(--danger);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 56, 43, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(192, 56, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 56, 43, 0); }
}

/* Kbd */
kbd {
  display: inline-block; padding: 2px 6px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-subtle);
}

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

/* Tabs */
.tab-bar {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s-5);
  background: var(--bg-card);
}
.tab-btn {
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  border: none; background: none; cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-subtle); }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-3); padding: var(--s-12) var(--s-6);
  color: var(--text-muted); text-align: center;
}
.empty-state svg { opacity: 0.35; }

/* Progress bar */
.progress-bar {
  height: 8px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden;
}
.progress-bar-fill { height: 100%; background: var(--brand-primary); border-radius: 4px; }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* Role tag */
.role-tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--brand-primary-soft); color: var(--brand-primary-dark);
  border: 1px solid #cae3d3;
}
.role-tag.admin { background: var(--info-soft); color: var(--info); border-color: #cdd9ee; }
.role-tag.quality { background: var(--warning-soft); color: var(--warning); border-color: #f1d99e; }
.role-tag.readonly { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--border); }

/* Hash display */
.hash-box {
  background: var(--bg-subtle); padding: 8px 12px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 11px; word-break: break-all; color: var(--text-secondary);
}

/* Metric row */
.metric-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.metric-row:last-child { border-bottom: none; }
