:root {
  --shell-bg: #0a1220;
  --shell-bg-2: #111b2e;
  --sidebar-border: rgba(148, 163, 184, 0.16);
  --sidebar-text: #dbe7f5;
  --sidebar-muted: #88a0be;
  --content-bg: #eef3f8;
  --panel-bg: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-border: #d6e0ea;
  --heading: #102033;
  --text: #233548;
  --muted: #61758a;
  --accent: #35b9ff;
  --accent-2: #1d4ed8;
  --success: #0f9d58;
  --warning: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.82), rgba(8, 15, 28, 0.82)),
    repeating-linear-gradient(0deg, rgba(53, 185, 255, 0.08) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(53, 185, 255, 0.06) 0 1px, transparent 1px 44px),
    var(--content-bg);
  min-height: 100vh;
}
body.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at top, rgba(30, 64, 175, 0.35), transparent 25%),
    linear-gradient(180deg, #08101d, #0f172a 46%, #07101d 100%);
}
.shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 308px;
  background: linear-gradient(180deg, var(--shell-bg) 0%, #0c1628 45%, var(--shell-bg-2) 100%);
  color: var(--sidebar-text);
  padding: 18px 14px;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}
.brand, .sidebar-block, .topbar-status {
  border: 1px solid rgba(123, 160, 198, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.68));
  border-radius: 18px;
}
.brand { padding: 16px; margin-bottom: 14px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(53,185,255,0.28), rgba(29,78,216,0.22));
  border: 1px solid rgba(53,185,255,0.32);
  color: #e0f2fe;
  font-weight: 700;
  margin-bottom: 12px;
}
.brand h1 { margin: 0; font-size: 1.03rem; color: #f8fbff; }
.brand p { margin: 6px 0 0; color: var(--sidebar-muted); font-size: 0.82rem; line-height: 1.35; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(15, 118, 110, 0.18);
  border: 1px solid rgba(45, 212, 191, 0.18);
  color: #99f6e4;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
}
.nav-section {
  margin: 16px 8px 8px;
  color: #6480a0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.71rem;
  font-weight: 700;
}
.sidebar a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  margin-bottom: 6px;
  transition: 0.18s ease;
}
.sidebar a:hover, .sidebar a.active {
  background: linear-gradient(180deg, rgba(17, 28, 46, 0.95), rgba(13, 25, 43, 0.95));
  border-color: rgba(53, 185, 255, 0.22);
  transform: translateX(2px);
}
.sidebar .icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(123, 160, 198, 0.14);
}
.sidebar .label { display: block; font-size: 0.92rem; font-weight: 700; }
.sidebar .sub { display: block; color: var(--sidebar-muted); font-size: 0.75rem; line-height: 1.25; }
.sidebar-block { padding: 14px; margin-top: 12px; }
.sidebar-block h3 {
  margin: 0 0 10px;
  font-size: 0.76rem;
  color: #c7d6e8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-kpi { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.sidebar-kpi:last-child { margin-bottom: 0; }
.sidebar-kpi span { color: var(--sidebar-muted); font-size: 0.76rem; }
.sidebar-kpi strong { color: #f8fbff; font-size: 0.95rem; }
.scrollbar-hidden {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}
.sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
  display: none;
}
.main { flex: 1; min-width: 0; background: transparent; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  backdrop-filter: blur(12px);
  background: rgba(239, 244, 250, 0.88);
  border-bottom: 1px solid rgba(155, 175, 196, 0.26);
}
.topbar h2 { margin: 0; color: var(--heading); font-size: 1.04rem; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; }
.topbar-meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.topbar-status { padding: 10px 14px; min-width: 220px; }
.topbar-status .tiny { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.topbar-status strong { display: block; color: var(--heading); }
.page { padding: 20px; }
.panel-card, .table-shell, .hero-panel, .kpi-card, .module-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}
.panel-card, .table-shell, .hero-panel { padding: 20px; }
.hero-panel {
  color: #eff6ff;
  background:
    linear-gradient(135deg, rgba(9, 18, 36, 0.98), rgba(17, 24, 39, 0.96) 52%, rgba(13, 28, 51, 0.96) 100%),
    repeating-linear-gradient(0deg, rgba(53, 185, 255, 0.08) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(53, 185, 255, 0.06) 0 1px, transparent 1px 34px);
  border-color: rgba(53, 185, 255, 0.22);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}
.hero-title { font-size: 1.55rem; font-weight: 800; margin: 0 0 10px; }
.hero-copy { color: #adc0d8; max-width: 60ch; }
.kpi-grid, .module-grid { display: grid; gap: 14px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-card { padding: 16px; height: 100%; position: relative; overflow: hidden; }
.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53,185,255,0.15), transparent 68%);
}
.kpi-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; font-weight: 700; }
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--heading); margin: 10px 0 6px; }
.kpi-sub { color: var(--muted); font-size: 0.83rem; }
.module-card { display: block; padding: 16px; text-decoration: none; color: inherit; height: 100%; }
.module-card:hover { transform: translateY(-1px); box-shadow: 0 18px 42px rgba(15,23,42,0.12); }
.module-card .module-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.module-card .module-title { font-size: 0.95rem; font-weight: 800; color: var(--heading); }
.module-card .module-subtitle { color: var(--muted); font-size: 0.82rem; min-height: 2.4em; }
.module-card .module-stat { font-size: 1.5rem; font-weight: 800; }
.section-title { margin: 0; font-size: 1rem; font-weight: 800; color: var(--heading); }
.section-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 0.83rem; }
.section-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.signal-list { display: grid; gap: 10px; }
.signal-row, .timeline-row, .info-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel-soft);
}
.info-strip { align-items: center; }
.table { margin-bottom: 0; }
.table thead th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-color: #dbe4ed;
}
.table tbody td, .table tbody th { color: var(--text); border-color: #e4ebf2; }
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
}
.empty-note {
  padding: 14px;
  border: 1px dashed #b8c8d8;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--muted);
}
.desktop-toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.desktop-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
}
.system-map-export-link {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  color: #334155;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  opacity: 0.72;
  backdrop-filter: blur(10px);
}
.system-map-export-link:hover,
.system-map-export-link:focus {
  color: #0f172a;
  opacity: 1;
  border-color: rgba(29, 78, 216, 0.32);
}
.panel-list, .stack-grid { display: grid; gap: 10px; }
.metric-pill { border-radius: 999px; padding: 8px 12px; font-weight: 800; }
.status-meter { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-soft); }
.status-meter > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.status-meter-label { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.status-meter-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.status-meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent-2); }
.tone-danger .status-meter-bar span { background: var(--danger); }
.tone-warning .status-meter-bar span { background: var(--warning); }
.tone-success .status-meter-bar span { background: var(--success); }
.plant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plant-card { border: 1px solid var(--panel-border); border-radius: 14px; background: var(--panel-soft); padding: 14px; }
.plant-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 12px; }
.plant-card h4 { font-size: 1rem; margin: 0; color: var(--heading); }
.plant-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.plant-kpis div { border: 1px solid #dce6ef; border-radius: 10px; background: #fff; padding: 8px; }
.plant-kpis span { display: block; color: var(--muted); font-size: 0.72rem; }
.plant-kpis strong { color: var(--heading); }
.tone-left-danger { border-left: 4px solid var(--danger); }
.tone-left-warning { border-left: 4px solid var(--warning); }
.tone-left-success { border-left: 4px solid var(--success); }
.tone-left-primary, .tone-left-info { border-left: 4px solid var(--accent-2); }
.tone-left-secondary { border-left: 4px solid #64748b; }
.signal-row-strong { align-items: center; }
.structure-tree { display: grid; gap: 6px; font-size: 0.88rem; }
.tree-plant, .tree-area, .tree-sub { border: 1px solid #dbe4ed; background: #fff; border-radius: 10px; padding: 8px 10px; }
.tree-area { margin-left: 18px; }
.tree-sub { margin-left: 36px; color: var(--muted); }
.hierarchy-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hierarchy-card { border-left: 5px solid var(--accent-2); }
.hierarchy-label {
  color: #086b77;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.sector-list { display: grid; gap: 10px; margin-top: 12px; }
.sector-node {
  border: 1px solid #cfe3e8;
  border-radius: 8px;
  background: #f7fbfc;
  padding: 10px;
}
.node-head, .subsector-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.node-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  margin-right: 7px;
}
.subsector-list {
  display: grid;
  gap: 7px;
  margin: 8px 0 0 20px;
  padding-left: 12px;
  border-left: 2px solid #bde7ef;
}
.subsector-node {
  background: #fff;
  border: 1px solid #dcebef;
  border-radius: 8px;
  padding: 8px 10px;
}
.icon-actions { display: inline-flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #b9dbe3;
  border-radius: 8px;
  background: #fff;
  color: #086b77;
  font-weight: 800;
  line-height: 1;
}
.icon-danger { color: #b42318; border-color: #f1b8b8; }
.compact-condition {
  padding: 12px 14px;
  min-height: 0;
  height: auto;
  box-shadow: none;
}
.compact-condition::after { display: none; }
.compact-condition .kpi-value { font-size: 1.15rem; margin: 4px 0; }
.compact-condition .kpi-sub {
  font-size: 0.78rem;
  line-height: 1.25;
  max-height: 2.6em;
  overflow: auto;
}
.measurement-accordion { display: grid; gap: 8px; }
.measurement-detail {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f7fbfc;
  padding: 9px 10px;
}
.measurement-detail summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.measurement-values-row td {
  background: #fbfdfe;
  border-top: 0;
  padding-top: 0;
}
.measurement-values-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 8px;
}
.value-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d7e8ed;
  border-radius: 8px;
  background: #ffffff;
  color: #315861;
  padding: 5px 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.form-panel {
  border: 1px solid #dce6ef;
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
}
.data-points-grid { display: grid; gap: 12px; }
.login-card {
  max-width: 1180px;
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(123, 160, 198, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.login-hero {
  padding: 36px;
  color: #f8fbff;
  background:
    linear-gradient(135deg, rgba(9, 18, 36, 0.98), rgba(17, 24, 39, 0.95) 52%, rgba(14, 49, 120, 0.8) 100%),
    repeating-linear-gradient(0deg, rgba(53, 185, 255, 0.08) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(90deg, rgba(53, 185, 255, 0.06) 0 1px, transparent 1px 38px);
}
.login-panel { padding: 36px; background: rgba(255,255,255,0.98); }
.login-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.login-metric { border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 16px; padding: 14px; background: rgba(15, 23, 42, 0.22); }
.login-metric span { display: block; color: #b8c7d9; font-size: 0.78rem; }
.login-metric strong { display: block; font-size: 1.65rem; margin-top: 6px; }
.users-list { margin: 18px 0 0; padding-left: 18px; color: #b8c7d9; }
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .shell { display: block; }
  .sidebar { width: auto; }
  .hero-grid, .module-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .page, .topbar { padding: 16px; }
  .kpi-grid, .login-matrix { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
}

/* Pavimentos Quilin corporate layer */
:root {
  --shell-bg: #063b42;
  --shell-bg-2: #0b5961;
  --sidebar-border: rgba(189, 230, 240, 0.24);
  --sidebar-text: #ecfeff;
  --sidebar-muted: #afd3da;
  --content-bg: #f4f8fa;
  --panel-bg: #ffffff;
  --panel-soft: #f7fbfc;
  --panel-border: #d9e8ec;
  --heading: #102a32;
  --text: #263b43;
  --muted: #647981;
  --accent: #3fc4df;
  --accent-2: #086b77;
  --success: #16815f;
  --warning: #b7791f;
  --danger: #c2413a;
}

body {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7fbfc 0%, #edf5f7 100%);
}

body.login-screen {
  background:
    linear-gradient(135deg, rgba(6, 59, 66, 0.92), rgba(8, 107, 119, 0.88)),
    linear-gradient(180deg, #f7fbfc, #e9f4f7);
}

.sidebar {
  background: linear-gradient(180deg, #063b42 0%, #0a5660 58%, #08363d 100%);
  box-shadow: 8px 0 28px rgba(4, 42, 48, 0.14);
}

.brand, .sidebar-block, .topbar-status {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(191, 231, 240, 0.2);
}

.brand-mark {
  border-radius: 8px;
  background: #ffffff;
  color: #086b77;
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 8px 18px rgba(3, 35, 42, 0.18);
  letter-spacing: 0;
}

.brand-mark-light {
  background: #ffffff;
  color: #086b77;
  flex: 0 0 auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.brand-caption {
  color: #c4e6ed;
  font-size: 0.82rem;
}

.status-pill {
  background: #e5f8fb;
  color: #075966;
  border-color: #b8e8f0;
}

.sidebar .status-pill {
  background: rgba(229, 248, 251, 0.14);
  color: #dffaff;
}

.sidebar a {
  border-radius: 8px;
  padding: 9px 10px;
}

.sidebar a:hover, .sidebar a.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(177, 230, 241, 0.34);
  transform: none;
}

.sidebar .icon {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 0.72rem;
  font-weight: 800;
  color: #dffaff;
}

.app-window {
  min-height: 100vh;
}

.app-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 8px 18px;
  color: #dffaff;
  background: #07363d;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.chrome-lights {
  display: flex;
  gap: 6px;
}

.chrome-lights span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9edee9;
  opacity: 0.75;
}

.chrome-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
}

.eyebrow {
  color: #086b77;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-card, .table-shell, .hero-panel, .kpi-card, .module-card, .plant-card, .form-panel, .login-card, .login-metric, .status-meter, .signal-row, .timeline-row, .info-strip, .empty-note {
  border-radius: 8px;
}

.panel-card, .table-shell, .kpi-card, .module-card {
  background: #ffffff;
  border-color: var(--panel-border);
  box-shadow: 0 10px 28px rgba(20, 55, 64, 0.08);
}

.hero-panel {
  background:
    linear-gradient(135deg, rgba(6, 59, 66, 0.98), rgba(8, 107, 119, 0.94)),
    linear-gradient(180deg, #ffffff, #eef8fa);
  border-color: rgba(63, 196, 223, 0.38);
}

.hero-copy {
  color: #d3eef3;
}

.badge-soft {
  background: #dff7fb;
  color: #075966;
}

.btn-primary {
  --bs-btn-bg: #086b77;
  --bs-btn-border-color: #086b77;
  --bs-btn-hover-bg: #075966;
  --bs-btn-hover-border-color: #075966;
}

.btn-outline-primary {
  --bs-btn-color: #086b77;
  --bs-btn-border-color: #7fcfdd;
  --bs-btn-hover-bg: #086b77;
  --bs-btn-hover-border-color: #086b77;
}

.btn-success {
  --bs-btn-bg: #16815f;
  --bs-btn-border-color: #16815f;
}

.btn-warning {
  --bs-btn-bg: #f4c45b;
  --bs-btn-border-color: #f4c45b;
  --bs-btn-color: #3f2c05;
}

.table thead th {
  background: #f0f7f9;
  color: #315861;
  border-bottom: 1px solid #cfe3e8;
}

.table tbody tr:hover {
  background: #f7fbfc;
}

.form-control, .form-select {
  border-color: #cfe0e5;
  border-radius: 8px;
}

.form-control:focus, .form-select:focus {
  border-color: #3fc4df;
  box-shadow: 0 0 0 0.2rem rgba(63, 196, 223, 0.18);
}

.alert {
  border-radius: 8px;
  border-width: 1px;
}

.login-card {
  max-width: 1120px;
  box-shadow: 0 24px 64px rgba(4, 42, 48, 0.28);
}

.login-hero {
  background:
    linear-gradient(135deg, rgba(6, 59, 66, 0.98), rgba(8, 107, 119, 0.92)),
    linear-gradient(180deg, #ffffff, #e5f8fb);
}

.login-panel {
  background: #ffffff;
}

.login-metric {
  background: rgba(255,255,255,0.12);
  border-color: rgba(217, 244, 249, 0.26);
}

.tutorial-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.tutorial-nav {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 6px;
  align-self: start;
}

.tutorial-nav a {
  display: block;
  padding: 9px 10px;
  text-decoration: none;
  color: #315861;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.tutorial-section {
  scroll-margin-top: 104px;
  margin-bottom: 16px;
}

.tutorial-section h3 {
  color: var(--heading);
  font-weight: 800;
  margin-bottom: 10px;
}

.tutorial-section h4 {
  font-size: 1rem;
  color: #086b77;
  font-weight: 800;
  margin-top: 18px;
}

.tutorial-section li {
  margin-bottom: 6px;
}

.step-list {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f7fbfc;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #086b77;
  color: #ffffff;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 22px;
}

.template-row,
.vibration-row,
.wear-row {
  position: relative;
  padding-right: 42px;
}

.template-delete-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hierarchy-trash-disclosure {
  display: inline-block;
  width: 100%;
}

.hierarchy-trash-disclosure > summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
}

.hierarchy-trash-disclosure > summary::-webkit-details-marker {
  display: none;
}

.hierarchy-trash-toggle {
  color: #48666d;
}

.measurement-actions-heading {
  min-width: 230px;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f7fbfc;
}

.measurement-actions {
  min-width: 230px;
  vertical-align: top;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

.measurement-action-card {
  width: min(100%, 260px);
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--panel-border);
}

.measurement-action-card.delete {
  border-left: 4px solid #dc3545;
  background: #fff8f8;
}

.measurement-action-card.restore {
  border-left: 4px solid #198754;
  background: #f7fff9;
}

.measurement-action-card .btn {
  font-weight: 800;
}

.measurement-action-label {
  margin-bottom: 6px;
  color: #5a6f76;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.measurement-primary-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 900;
}

.icon-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 800;
}

.measurement-icon-form {
  display: inline-flex;
  margin: 0;
}

.asset-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.asset-delete-form {
  display: inline-flex;
  margin: 0;
}

.asset-row-deleted {
  opacity: 0.82;
  border-left: 4px solid #dc3545;
}

.asset-deleted-notice {
  border-left: 5px solid #dc3545;
}

.icon-action.is-processing {
  opacity: 0.55;
  pointer-events: none;
}

.action-delete {
  background-color: #fff7f7 !important;
  border-color: #f1b8b8 !important;
  color: #b42318 !important;
}

.action-restore {
  background-color: #f7fff9 !important;
  border-color: #9ad2ad !important;
  color: #146c43 !important;
}

.measurement-action-modal .modal-title {
  color: #102a32;
  font-weight: 900;
}

.measurement-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.measurement-inline-actions strong {
  color: #647981;
  font-size: 0.78rem;
}

.measurement-removing {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.app-toast {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #102a32;
  box-shadow: 0 14px 30px rgba(20, 55, 64, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 800;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-success {
  border-color: #9ad2ad;
  background: #f7fff9;
  color: #146c43;
}

.app-toast-error {
  border-color: #f1b8b8;
  background: #fff7f7;
  color: #b42318;
}

.measurement-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 31, 36, 0.42);
  backdrop-filter: blur(3px);
}

.measurement-dialog-backdrop.show {
  display: flex;
}

.measurement-dialog {
  width: min(460px, 100%);
  border: 1px solid #cfe3e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 42, 50, 0.26);
  overflow: hidden;
}

.measurement-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #e4eef1;
  background: #f7fbfc;
}

.measurement-dialog-head h3 {
  margin: 0;
  color: #102a32;
  font-size: 1rem;
  font-weight: 900;
}

.measurement-dialog-head p {
  margin: 4px 0 0;
  color: #647981;
  font-size: 0.84rem;
}

.measurement-dialog-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d6e6ea;
  border-radius: 8px;
  background: #ffffff;
  color: #5a6f76;
  font-size: 1.15rem;
  line-height: 1;
}

.measurement-dialog-body {
  padding: 16px 18px 4px;
}

.measurement-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
}

.measurement-trash-link {
  font-weight: 800;
}

.measurement-row-deleted {
  opacity: 0.78;
  border-left: 4px solid #dc3545;
}

.measurement-row-deleted .measurement-actions {
  background: #f3f4f6;
}

.measurement-visible-card {
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-left: 4px solid #3fc4df;
  border-radius: 8px;
  background: #fff;
}

.measurement-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.measurement-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-row-delete {
  box-shadow: inset 4px 0 0 #dc3545;
}

.audit-row-restore {
  box-shadow: inset 4px 0 0 #198754;
}

.audit-json {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f7fbfc;
  color: #102a32;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

@media (max-width: 992px) {
  .tutorial-layout { grid-template-columns: 1fr; }
  .tutorial-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hierarchy-board { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .tutorial-nav { grid-template-columns: 1fr; }
  .desktop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
}

@media (min-width: 769px) {
  :root {
    --desktop-sidebar-width: clamp(280px, 22vw, 308px);
  }

  html,
  body.app-shell {
    height: 100%;
  }

  body.app-shell {
    overflow: hidden;
  }

  .shell {
    display: grid;
    grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr);
    align-items: stretch;
    min-height: 100vh;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    width: var(--desktop-sidebar-width);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .main {
    min-width: 0;
    min-height: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .app-window {
    min-height: 100%;
  }

  .page,
  .topbar,
  .app-chrome {
    min-width: 0;
  }

  .table-responsive {
    overflow-x: auto;
  }
}
