:root {
  --navy-950: #061522;
  --navy-900: #081d2e;
  --navy-850: #0b2639;
  --navy-800: #103147;
  --ink: #102638;
  --muted: #607586;
  --muted-2: #8798a6;
  --canvas: #f2f6f8;
  --card: #ffffff;
  --line: #dde7ec;
  --line-soft: #eaf0f3;
  --teal: #0cbca8;
  --teal-dark: #068f81;
  --cyan: #2c96ff;
  --green: #2ba97f;
  --amber: #e99a2d;
  --coral: #ed6a5e;
  --purple: #786cf2;
  --shadow-sm: 0 1px 2px rgba(12, 33, 48, .05), 0 4px 14px rgba(12, 33, 48, .04);
  --shadow-lg: 0 24px 60px rgba(5, 25, 39, .2);
  --radius: 16px;
  --sidebar-width: 264px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(44,150,255,.28);
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 1000; top: 8px; left: 8px;
  transform: translateY(-150%);
  background: white; color: var(--ink);
  padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex; flex-direction: column;
  padding: 26px 18px 18px;
  background:
    radial-gradient(circle at 20% 2%, rgba(21,212,189,.13), transparent 27%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #fff;
  z-index: 50;
  overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 7px; }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #15d4bd, #2388ff);
  box-shadow: 0 8px 25px rgba(21,212,189,.22);
  font-size: 20px; font-weight: 850;
}
.brand > div:last-child { display: flex; flex-direction: column; line-height: 1.14; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand span { color: #96adbc; font-size: 12px; margin-top: 4px; }
.brand-mark span { color: white; font-size: inherit; margin: 0; }
.demo-badge {
  display: flex; align-items: center; gap: 8px;
  margin: 25px 6px 18px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: #8fa9b9;
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
}
.demo-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(233,154,45,.12); }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  appearance: none; border: 0;
  display: grid; grid-template-columns: 21px 1fr auto; align-items: center;
  width: 100%; padding: 11px 12px; gap: 11px;
  background: transparent; color: #91a9b9;
  border-radius: 10px; text-align: left; font-size: 13px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(21,212,189,.18), rgba(35,136,255,.09)); box-shadow: inset 3px 0 var(--teal); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item small {
  min-width: 21px; height: 20px; display: grid; place-items: center;
  padding: 0 5px; border-radius: 10px;
  background: rgba(255,255,255,.07); color: #a7bdca; font-size: 10px;
}
.nav-item .nav-alert { color: #ffd9d4; background: rgba(237,106,94,.22); }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.infra-card {
  width: 100%; display: grid; grid-template-columns: 32px 1fr 16px; gap: 9px; align-items: center;
  border: 1px solid rgba(21,212,189,.18); border-radius: 12px;
  padding: 12px 10px; color: #d9e6eb; background: rgba(21,212,189,.06); text-align: left;
}
.infra-card:hover { background: rgba(21,212,189,.1); }
.infra-card > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.infra-card strong { font-size: 11px; }
.infra-card small { font-size: 9px; color: #7f9baa; display: flex; align-items: center; gap: 5px; }
.infra-card small i { width: 6px; height: 6px; border-radius: 50%; background: #2bd49f; box-shadow: 0 0 0 3px rgba(43,212,159,.12); }
.infra-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(21,212,189,.12); color: #35dac3; }
.infra-icon svg { width: 16px; }
.user-card { margin-top: 17px; padding: 14px 6px 0; border-top: 1px solid rgba(255,255,255,.08); display: grid; grid-template-columns: 34px 1fr 20px; gap: 9px; align-items: center; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #24465b; color: #cbe1ea; font-size: 11px; font-weight: 700; }
.user-card div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.user-card strong { font-size: 11px; }
.user-card span { font-size: 9px; color: #7894a5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card button { border: 0; background: transparent; color: #7793a4; padding: 0; }

main { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
  height: 78px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.eyebrow { margin: 0 0 1px; font-size: 9px; text-transform: uppercase; color: var(--muted-2); letter-spacing: .09em; font-weight: 700; }
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.prototype-badge {
  height: 32px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px; border: 1px solid #f0c875; border-radius: 999px;
  background: #fff5d8; color: #8a5711;
  font-size: 10px; font-weight: 800; letter-spacing: .015em; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(138,87,17,.08);
}
.prototype-badge svg { width: 13px; height: 13px; }
.sync-status { display: grid; grid-template-columns: 8px auto; align-items: center; column-gap: 7px; margin-right: 8px; }
.sync-status span:not(.sync-dot) { font-size: 10px; font-weight: 700; color: var(--ink); }
.sync-status small { grid-column: 2; font-size: 9px; color: var(--muted-2); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); grid-row: 1 / span 2; box-shadow: 0 0 0 4px rgba(43,169,127,.11); }
.icon-button {
  border: 1px solid var(--line); background: white; color: var(--ink);
  width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; padding: 0;
}
.icon-button:hover { background: #f5f8fa; border-color: #cad8df; }
.icon-button svg { width: 17px; height: 17px; }
.notification-button { position: relative; }
.notification-button i {
  position: absolute; top: -5px; right: -6px;
  min-width: 17px; height: 17px; display: grid; place-items: center;
  border-radius: 9px; background: var(--coral); color: white;
  font-size: 8px; font-style: normal; border: 2px solid white;
}
.secondary-button, .primary-button, .ghost-button {
  min-height: 37px; padding: 0 14px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11px; font-weight: 700; transition: .18s ease;
}
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.secondary-button:hover { border-color: #bdcdd5; background: #f9fbfc; }
.primary-button { border: 1px solid var(--teal); background: var(--teal); color: #032e2a; box-shadow: 0 6px 18px rgba(12,188,168,.13); }
.primary-button:hover { background: #12cbb5; transform: translateY(-1px); }
.ghost-button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.ghost-button:hover { background: #f2f6f8; }
.secondary-button svg, .primary-button svg { width: 15px; height: 15px; }
.full-width { width: 100%; }
.mobile-only { display: none; }

.content { padding: 27px 30px 42px; max-width: 1600px; margin: 0 auto; }
.view { display: none; animation: viewIn .28s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.view-heading h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.035em; }
.view-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.title-row { display: flex; align-items: center; gap: 10px; }
.filters { display: flex; gap: 9px; }
.filters label, .standalone-select { display: flex; flex-direction: column; gap: 3px; }
.filters label span, .standalone-select span { font-size: 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 700; margin-left: 2px; }
select {
  appearance: none; min-width: 150px; height: 37px;
  padding: 0 32px 0 11px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; background:
    linear-gradient(45deg, transparent 50%, #77909f 50%) calc(100% - 15px) 15px / 5px 5px no-repeat,
    linear-gradient(135deg, #77909f 50%, transparent 50%) calc(100% - 10px) 15px / 5px 5px no-repeat,
    white;
  font-size: 11px; font-weight: 650;
}
.live-chip, .beta-chip, .ai-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding: 0 9px; border-radius: 12px; font-size: 9px; font-weight: 800; letter-spacing: .02em;
}
.live-chip { color: #08795e; background: #e5f7f1; }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: #26b88a; }
.beta-chip { color: #6258cb; background: #eeecff; }
.ai-chip { color: #206cad; background: #e8f4ff; }
.ai-chip svg { width: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 13px; }
.kpi-card { padding: 18px 18px 16px; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.metric-icon { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; }
.metric-icon svg { width: 17px; height: 17px; }
.metric-icon.cyan { background: #e5f4ff; color: #237dc5; }
.metric-icon.amber { background: #fff2df; color: #bd7412; }
.metric-icon.green { background: #e5f7f1; color: #138260; }
.metric-icon.purple { background: #eeecff; color: #6459ce; }
.metric-icon.gradient { color: white; background: linear-gradient(135deg, var(--teal), #2d8df1); }
.trend { border-radius: 10px; padding: 3px 7px; font-size: 9px; font-weight: 750; }
.trend.positive { color: #117759; background: #e6f6f0; }
.trend.negative { color: #b05f16; background: #fff0dc; }
.trend.neutral { color: #5e58b7; background: #efeeff; }
.kpi-card > p { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.kpi-card h3 { margin: 0 0 3px; font-size: 23px; letter-spacing: -.035em; }
.kpi-card > small { color: var(--muted-2); font-size: 9px; }
.kpi-card.compact { padding: 18px; }
.kpi-card.compact h3 { font-size: 22px; margin-top: 6px; }
.text-warning { color: #c97817; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(275px, .85fr); gap: 13px; }
.consumption-card { padding: 19px; min-height: 370px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-header h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.card-header p { margin: 3px 0 0; font-size: 9px; color: var(--muted-2); }
.chart-legend { display: flex; align-items: center; gap: 13px; font-size: 8px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.chart-legend i { display: block; width: 14px; height: 3px; border-radius: 2px; }
.chart-legend .actual { background: var(--teal); }
.chart-legend .reference { background: #aab9c2; }
.chart-legend .forecast { border-top: 2px dashed var(--cyan); height: 0; }
.chart-container { min-height: 246px; margin: 13px 0 0; }
.chart-container svg { width: 100%; height: 100%; overflow: visible; }
.chart-container text { font-family: var(--font); fill: #8294a1; font-size: 9px; }
.chart-grid { stroke: #e7eef1; stroke-width: 1; }
.chart-line-actual { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-reference { fill: none; stroke: #adbac2; stroke-width: 1.7; stroke-dasharray: 5 5; }
.chart-line-forecast { fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-dasharray: 5 5; stroke-linecap: round; }
.chart-area { fill: url(#areaGradient); }
.chart-point { fill: white; stroke: var(--teal); stroke-width: 2; }
.chart-tooltip-box { fill: #0a2638; filter: drop-shadow(0 5px 10px rgba(6,21,34,.18)); }
.chart-tooltip-text { fill: white !important; font-size: 9px !important; font-weight: 700; }
.chart-insight {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 9px; align-items: center;
  background: #f1faf8; border: 1px solid #d8f0ea; border-radius: 10px;
  padding: 9px 11px; color: #315e58;
}
.chart-insight > svg { width: 17px; color: var(--teal-dark); }
.chart-insight p { margin: 0; font-size: 9px; }
.chart-insight button { border: 0; background: transparent; color: var(--teal-dark); font-size: 9px; font-weight: 750; white-space: nowrap; }
.priority-card, .alerts-card { padding: 18px; }
.priority-list { margin-top: 11px; }
.priority-item { display: grid; grid-template-columns: 1fr 38px; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.priority-item:first-child { border-top: 0; }
.priority-item:hover strong { color: var(--teal-dark); }
.priority-item > div:first-child { min-width: 0; }
.priority-item strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priority-item small { color: var(--muted-2); font-size: 8px; }
.score-mini { position: relative; width: 37px; height: 37px; display: grid; place-items: center; }
.score-mini svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-mini circle { fill: none; stroke-width: 3; }
.score-mini circle:first-child { stroke: #edf1f3; }
.score-mini circle:last-child { stroke: var(--coral); stroke-linecap: round; }
.score-mini span { font-size: 9px; font-weight: 800; }
.text-button { color: var(--teal-dark); border: 0; background: transparent; padding: 3px; font-size: 9px; font-weight: 750; }
.compact-alerts { margin-top: 10px; }
.compact-alert { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.compact-alert:first-child { border-top: 0; }
.alert-marker { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; }
.alert-marker.critical { background: var(--coral); box-shadow: 0 0 0 4px rgba(237,106,94,.1); }
.alert-marker.warning { background: var(--amber); box-shadow: 0 0 0 4px rgba(233,154,45,.1); }
.compact-alert strong { display: block; font-size: 9px; }
.compact-alert p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.compact-alert time { font-size: 8px; color: var(--muted-2); white-space: nowrap; }
.recommendation-card { padding: 18px 20px; background: linear-gradient(140deg, #fff 40%, #f5fbfb); }
.recommendation-head { display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; }
.recommendation-head > div { display: flex; flex-direction: column; }
.recommendation-head > div span { color: var(--teal-dark); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.recommendation-head h3 { margin: 2px 0 0; font-size: 14px; }
.potential { padding: 5px 8px; border-radius: 10px; background: #e6f6f0; color: #14775a; font-size: 9px; font-weight: 800; }
.recommendation-card > p { margin: 15px 0 11px; color: var(--muted); font-size: 10px; }
.recommendation-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.recommendation-meta span { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line-soft); background: white; border-radius: 8px; padding: 6px 8px; font-size: 8px; color: var(--muted); }
.recommendation-meta svg { width: 12px; height: 12px; color: var(--teal-dark); }
.card-actions { display: flex; gap: 6px; margin-top: 14px; }
.human-note { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--muted-2); font-size: 8px; }
.human-note svg { width: 12px; }
.source-strip {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  margin-top: 13px; padding: 13px 16px;
  background: #eaf1f4; border: 1px solid #d9e4e9; border-radius: 12px;
}
.source-strip > div { display: grid; grid-template-columns: 27px auto; column-gap: 10px; }
.source-strip > div > svg { grid-row: 1 / span 2; width: 19px; align-self: center; color: #4b7187; }
.source-strip strong { font-size: 10px; }
.source-strip small { font-size: 8px; color: var(--muted); }

.stats-ribbon { display: grid; grid-template-columns: repeat(6, 1fr); background: white; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 13px; box-shadow: var(--shadow-sm); }
.stats-ribbon > div { display: flex; flex-direction: column; padding: 15px 17px; border-left: 1px solid var(--line-soft); }
.stats-ribbon > div:first-child { border-left: 0; }
.stats-ribbon strong { font-size: 17px; letter-spacing: -.02em; }
.stats-ribbon span { font-size: 8px; color: var(--muted-2); }
.table-card { overflow: hidden; }
.table-toolbar { min-height: 64px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.search-field { min-width: 260px; display: flex; align-items: center; gap: 8px; background: #f6f9fa; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; }
.search-field svg { width: 15px; color: var(--muted-2); }
.search-field input { height: 36px; width: 100%; border: 0; outline: none; background: transparent; font-size: 10px; color: var(--ink); }
.search-field input::placeholder { color: #92a2ad; }
.segmented { display: flex; align-items: center; background: #f3f6f8; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 7px 10px; font-size: 9px; white-space: nowrap; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 5px rgba(12,33,48,.09); font-weight: 750; }
.segmented b { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 8px; background: #e4eaee; font-size: 7px; margin-left: 3px; }
.segmented button.active b { background: #e8f6f3; color: var(--teal-dark); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { padding: 12px 16px; text-align: left; color: var(--muted-2); background: #fbfcfd; border-bottom: 1px solid var(--line-soft); font-size: 8px; text-transform: uppercase; letter-spacing: .045em; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: #fbfdfd; }
.site-cell { display: flex; align-items: center; gap: 10px; }
.site-cell > span { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #e8f3f6; color: #47778b; }
.site-cell > span svg { width: 15px; }
.site-cell > div { display: flex; flex-direction: column; }
.site-cell strong { color: var(--ink); font-size: 10px; }
.site-cell small { color: var(--muted-2); font-size: 8px; }
.energy-tags { display: flex; gap: 4px; }
.energy-tags span { display: inline-flex; padding: 3px 5px; border-radius: 5px; background: #edf3f5; color: #607886; font-size: 7px; font-weight: 700; }
.variance { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; }
.variance.up { color: #c45f4f; }
.variance.down { color: #168061; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 10px; font-size: 8px; font-weight: 750; white-space: nowrap; }
.status-pill.success { color: #117759; background: #e5f6ef; }
.status-pill.warning { color: #ae6819; background: #fff0da; }
.status-pill.critical { color: #b74e45; background: #ffebe8; }
.status-pill.neutral { color: #5c7180; background: #edf2f4; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.row-open { width: 29px; height: 29px; border-radius: 8px; border: 1px solid var(--line); background: white; color: var(--muted); display: grid; place-items: center; }
.row-open svg { width: 13px; }
.empty-state { text-align: center; padding: 40px !important; color: var(--muted); }

.twin-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .72fr); gap: 13px; }
.building-twin { padding: 18px; grid-row: span 2; }
.twin-topline { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 8px; }
.twin-topline span { display: flex; align-items: center; gap: 6px; color: #16805f; font-weight: 700; }
.twin-topline i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(43,169,127,.04); } }
.building-visual { min-height: 385px; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 50% 44%, #f9fcfd, #ecf3f5); border-radius: 13px; margin: 13px 0; overflow: hidden; }
.building-visual::before { content: ""; position: absolute; width: 74%; height: 70%; background-image: linear-gradient(#dce7eb 1px, transparent 1px), linear-gradient(90deg, #dce7eb 1px, transparent 1px); background-size: 26px 26px; opacity: .38; transform: perspective(400px) rotateX(62deg); bottom: -23%; }
.building-shell { position: relative; z-index: 2; width: 56%; max-width: 330px; filter: drop-shadow(0 22px 24px rgba(15,50,69,.12)); transform: perspective(600px) rotateY(-5deg); }
.roof { height: 36px; background: linear-gradient(110deg, #163e54, #286075); clip-path: polygon(8% 100%, 0 48%, 50% 0, 100% 48%, 92% 100%); }
.floor { height: 77px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px; position: relative; background: linear-gradient(100deg, rgba(255,255,255,.98), rgba(220,237,241,.95)); border-bottom: 2px solid #c5d7de; border-left: 6px solid #244e63; border-right: 6px solid #244e63; }
.floor div { display: flex; flex-direction: column; }
.floor span { font-size: 8px; color: var(--muted-2); }
.floor strong { font-size: 15px; }
.floor small { font-size: 7px; color: var(--muted); }
.heat { width: 22px; height: 22px; border-radius: 50%; }
.heat.high { background: rgba(237,106,94,.2); box-shadow: 0 0 0 10px rgba(237,106,94,.07), 0 0 0 22px rgba(237,106,94,.03); }
.heat.medium { background: rgba(233,154,45,.2); box-shadow: 0 0 0 10px rgba(233,154,45,.06); }
.weather-pill, .sensor-pill { position: absolute; z-index: 4; display: grid; grid-template-columns: 30px auto; column-gap: 8px; align-items: center; padding: 10px 13px; border: 1px solid white; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border-radius: 12px; box-shadow: 0 8px 25px rgba(15,50,69,.1); }
.weather-pill { top: 26px; left: 28px; }
.sensor-pill { bottom: 28px; right: 25px; }
.weather-pill svg, .sensor-pill svg { grid-row: 1 / span 2; width: 22px; color: #318bd4; }
.sensor-pill svg { color: var(--purple); }
.weather-pill strong, .sensor-pill strong { font-size: 12px; }
.weather-pill small, .sensor-pill small { font-size: 7px; color: var(--muted-2); }
.live-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; }
.live-metrics div { display: flex; flex-direction: column; padding: 12px 14px; border-left: 1px solid var(--line-soft); }
.live-metrics div:first-child { border-left: 0; }
.live-metrics span { font-size: 8px; color: var(--muted-2); }
.live-metrics strong { font-size: 14px; margin-top: 2px; }
.live-metrics strong.warning { color: #c87517; }
.scenario-panel, .evidence-card { padding: 18px; }
.scenario-panel > .card-header > svg { width: 18px; color: var(--muted); }
.range-control { padding: 15px 0 4px; border-bottom: 1px solid var(--line-soft); }
.range-control > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.range-control label { font-size: 9px; color: var(--muted); }
.range-control output { font-size: 10px; color: var(--ink); font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--teal); margin: 11px 0 0; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 7px; }
.simulation-result { margin: 16px 0 13px; padding: 13px; border-radius: 10px; background: #f1f8f7; display: flex; flex-direction: column; }
.simulation-result span { font-size: 8px; color: var(--muted); }
.simulation-result strong { font-size: 20px; letter-spacing: -.03em; }
.simulation-result p { margin: 2px 0 0; font-size: 8px; color: var(--muted); }
.simulation-result b { color: #168061; }
.score-ring { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; border: 4px solid #f1b867; border-left-color: #f8ead6; color: #bd6d11; font-weight: 850; }
.evidence-list { margin-top: 10px; }
.evidence-list > div { display: grid; grid-template-columns: 9px 1fr; gap: 9px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.evidence-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; }
.evidence-dot.critical { background: var(--coral); }
.evidence-dot.warning { background: var(--amber); }
.evidence-dot.positive { background: var(--green); }
.evidence-list p { margin: 0; display: flex; flex-direction: column; }
.evidence-list strong { font-size: 9px; }
.evidence-list small { color: var(--muted-2); font-size: 8px; margin-top: 2px; }
.method-note { display: grid; grid-template-columns: 16px 1fr; gap: 8px; padding: 10px; border-radius: 9px; background: #f2f6f8; color: var(--muted); }
.method-note svg { width: 14px; color: #53788b; }
.method-note p { margin: 0; font-size: 8px; }

.invoice-kpis { grid-template-columns: repeat(4, 1fr); }
.invoice-id { color: var(--ink); font-weight: 750; }
.invoice-provider { display: flex; flex-direction: column; }
.invoice-provider strong { color: var(--ink); font-size: 10px; }
.invoice-provider small { font-size: 8px; }
.match-cell { display: flex; align-items: center; gap: 7px; }
.match-bar { width: 48px; height: 5px; background: #e7edef; border-radius: 4px; overflow: hidden; }
.match-bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.match-cell.anomaly { color: #bd5b4e; font-weight: 700; }

.alert-workspace { display: grid; grid-template-columns: minmax(410px, .9fr) minmax(350px, 1.1fr); gap: 13px; align-items: start; }
.alert-list-card { overflow: hidden; }
.alert-toolbar { min-height: 58px; }
.all-alerts { max-height: 650px; overflow-y: auto; }
.alert-row { display: grid; grid-template-columns: 11px 1fr auto; gap: 11px; align-items: start; padding: 15px 16px; border-top: 1px solid var(--line-soft); cursor: pointer; transition: .15s; }
.alert-row:hover, .alert-row.selected { background: #f6fafb; }
.alert-row.selected { box-shadow: inset 3px 0 var(--teal); }
.alert-row > div { display: flex; flex-direction: column; min-width: 0; }
.alert-row strong { font-size: 10px; color: var(--ink); }
.alert-row p { margin: 3px 0; font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row small, .alert-row time { font-size: 8px; color: var(--muted-2); }
.alert-detail { padding: 22px; min-height: 430px; position: sticky; top: 98px; }
.alert-detail-header { display: flex; justify-content: space-between; gap: 15px; }
.alert-detail h3 { margin: 10px 0 4px; font-size: 19px; letter-spacing: -.025em; }
.alert-detail-header p { margin: 0; font-size: 10px; color: var(--muted); }
.alert-detail-chart { height: 125px; margin: 20px 0; padding: 10px; background: #f7fafb; border-radius: 10px; }
.alert-detail-chart svg { width: 100%; height: 100%; }
.alert-facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-soft); border-radius: 10px; }
.alert-facts div { display: flex; flex-direction: column; padding: 11px; border-left: 1px solid var(--line-soft); }
.alert-facts div:first-child { border-left: 0; }
.alert-facts span { font-size: 7px; color: var(--muted-2); text-transform: uppercase; }
.alert-facts strong { font-size: 10px; margin-top: 3px; }
.alert-analysis { margin: 17px 0; }
.alert-analysis h4 { font-size: 10px; margin: 0 0 8px; }
.alert-analysis p { margin: 0; color: var(--muted); font-size: 9px; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.forecast-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 13px; }
.forecast-main { padding: 19px; grid-row: span 2; }
.forecast-total { text-align: right; display: flex; flex-direction: column; }
.forecast-total span { font-size: 8px; color: var(--muted-2); }
.forecast-total strong { font-size: 19px; letter-spacing: -.03em; }
.forecast-total small { font-size: 8px; color: #b86617; }
.forecast-chart { min-height: 295px; }
.forecast-area { fill: url(#forecastGradient); }
.forecast-line { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.budget-line { stroke: #b5c2c9; stroke-width: 1.5; stroke-dasharray: 5 5; }
.uncertainty-area { fill: rgba(44,150,255,.09); }
.scenario-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.scenario-tabs button { display: grid; grid-template-columns: 8px 1fr; text-align: left; column-gap: 7px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.scenario-tabs button.active { border-color: var(--cyan); background: #f2f8ff; box-shadow: inset 0 0 0 1px var(--cyan); }
.scenario-tabs b { font-size: 9px; }
.scenario-tabs small { grid-column: 2; font-size: 7px; color: var(--muted-2); }
.scenario-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 3px; }
.scenario-dot.green { background: var(--green); }
.scenario-dot.blue { background: var(--cyan); }
.scenario-dot.coral { background: var(--coral); }
.assumptions-card { padding: 18px; }
.assumption-list { margin: 12px 0; }
.assumption-list div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.assumption-list span { font-size: 9px; color: var(--muted); }
.assumption-list strong { font-size: 9px; }
.trajectory-card { padding: 17px; }
.trajectory-card > div:first-child { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; column-gap: 10px; }
.trajectory-card p { margin: 0; font-size: 9px; color: var(--muted); }
.trajectory-card strong { font-size: 19px; }
.trajectory-card small { grid-column: 2; font-size: 7px; color: var(--muted-2); }
.trajectory-line { position: relative; height: 7px; margin: 16px 0 7px; background: #e9eef0; border-radius: 5px; }
.trajectory-line i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #58d79b); }
.trajectory-line span { position: absolute; top: -4px; width: 2px; height: 15px; background: var(--ink); }
.trajectory-caption { font-size: 8px !important; }

.assistant-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 13px; }
.chat-card { min-height: 625px; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: grid; grid-template-columns: 38px 1fr 37px; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.assistant-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(140deg, var(--teal), #2a8dea); box-shadow: 0 6px 16px rgba(12,188,168,.19); }
.assistant-avatar svg { width: 18px; }
.assistant-avatar.small { width: 28px; height: 28px; border-radius: 9px; flex: 0 0 28px; }
.assistant-avatar.small svg { width: 13px; }
.chat-header > div:nth-child(2) { display: flex; flex-direction: column; }
.chat-header strong { font-size: 11px; }
.chat-header span { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 8px; }
.chat-header span i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px 18px; background: linear-gradient(#fbfdfd, #f7fafb); }
.message { display: flex; gap: 9px; margin-bottom: 15px; }
.message > div:last-child { max-width: 78%; }
.message p { margin: 0; padding: 11px 13px; border-radius: 4px 12px 12px 12px; background: white; border: 1px solid var(--line); color: #425967; font-size: 10px; line-height: 1.55; box-shadow: var(--shadow-sm); }
.message span { display: block; margin: 4px 4px 0; font-size: 7px; color: var(--muted-2); }
.user-message { justify-content: flex-end; }
.user-message p { border-radius: 12px 4px 12px 12px; background: var(--navy-800); color: white; border-color: var(--navy-800); }
.user-message span { text-align: right; }
.typing p { min-width: 50px; }
.typing i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin: 0 2px; background: #9dafb9; animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-3px); } }
.prompt-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 18px 4px; background: #fff; }
.prompt-chips button { border: 1px solid var(--line); background: white; color: var(--muted); padding: 7px 9px; border-radius: 14px; font-size: 8px; white-space: nowrap; }
.prompt-chips button:hover { border-color: #8fcfc6; color: var(--teal-dark); }
.chat-input { margin: 8px 18px 10px; display: grid; grid-template-columns: 1fr 35px; gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; }
.chat-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12,188,168,.08); }
.chat-input input { border: 0; outline: 0; padding: 0 7px; min-width: 0; font-size: 10px; }
.primary-icon-button { width: 35px; height: 35px; border: 0; border-radius: 8px; display: grid; place-items: center; background: var(--teal); color: #05342f; }
.primary-icon-button svg { width: 15px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 18px 13px; color: var(--muted-2); font-size: 7px; }
.privacy-note svg { width: 11px; }
.learning-column { display: flex; flex-direction: column; gap: 13px; }
.learning-card { padding: 18px; }
.section-kicker { color: var(--teal-dark); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.progress-badge { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 50%; background: #e6f6f2; color: var(--teal-dark); font-size: 9px; font-weight: 800; }
.progress-track { height: 6px; border-radius: 4px; background: #e7edef; margin: 15px 0; overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #41cfe7); }
.module-list button { width: 100%; min-height: 54px; display: grid; grid-template-columns: 27px 1fr 17px; gap: 9px; align-items: center; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: transparent; text-align: left; color: var(--muted-2); }
.module-list button > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #eef2f4; font-size: 8px; }
.module-list button > span svg { width: 12px; }
.module-list button.completed > span { background: #e5f6ef; color: var(--green); }
.module-list button.current { color: var(--ink); }
.module-list button.current > span { background: var(--teal); color: #05342f; }
.module-list p { margin: 0; display: flex; flex-direction: column; }
.module-list strong { font-size: 9px; color: var(--ink); }
.module-list small { font-size: 7px; color: var(--muted-2); margin-top: 2px; }
.module-list button > i svg { width: 13px; }
.certificate-card { padding: 16px; display: grid; grid-template-columns: 45px 1fr; gap: 12px; align-items: start; background: linear-gradient(135deg, #fff, #f5f3ff); }
.certificate-icon { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: #ece9ff; color: var(--purple); }
.certificate-icon svg { width: 21px; }
.certificate-card strong { font-size: 10px; }
.certificate-card p { margin: 4px 0; font-size: 8px; color: var(--muted); }
.certificate-card small { font-size: 7px; color: var(--muted-2); }

.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 13px; }
.source-card { display: grid; grid-template-columns: 39px 1fr auto; gap: 10px; align-items: center; padding: 14px; }
.source-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 850; }
.source-logo.electric { color: #1b73c0; background: #e5f2ff; }
.source-logo.gas { color: #b56816; background: #fff0dc; }
.source-logo.water { color: #197bb2; background: #e3f5fc; }
.source-logo.operat { color: #16805f; background: #e3f6ef; }
.source-logo.orange { color: #c75e17; background: #fff0e4; }
.source-logo.sigfox { color: #6658c6; background: #efecff; }
.source-card > div { display: flex; flex-direction: column; min-width: 0; }
.source-card strong { font-size: 10px; }
.source-card small { font-size: 8px; color: var(--muted-2); }
.reversibility-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 13px; }
.export-card, .api-card { padding: 19px; }
.export-preview { margin: 15px 0 11px; overflow: hidden; border-radius: 10px; background: #0c2637; color: #a9c2cf; }
.code-toolbar { height: 35px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 8px; }
.code-toolbar small { color: #6f8b9a; }
.export-preview pre { margin: 0; padding: 14px; overflow-x: auto; font-size: 8px; line-height: 1.7; }
.export-preview code span { color: #42d7c0; }
.export-options { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.export-options span { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 8px; }
.export-options svg { width: 12px; color: var(--green); }
.api-method { padding: 4px 7px; border-radius: 6px; background: #e5f6ef; color: #167c5e; font-size: 8px; font-weight: 850; }
.endpoint { display: grid; grid-template-columns: 1fr 30px; align-items: center; margin: 16px 0; background: #0c2637; color: #b7d2dc; border-radius: 9px; padding: 7px 8px 7px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.endpoint button { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #9ab2bd; background: rgba(255,255,255,.07); }
.endpoint svg { width: 12px; }
.api-facts { margin-bottom: 14px; }
.api-facts div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.api-facts span { font-size: 9px; color: var(--muted); }
.api-facts strong { font-size: 9px; }

.security-hero { display: grid; grid-template-columns: 95px 1fr auto; gap: 23px; align-items: center; padding: 25px; margin-bottom: 13px; overflow: hidden; position: relative; background: linear-gradient(110deg, white 45%, #edf9f7); }
.security-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(12,188,168,.11); border-radius: 50%; right: -90px; top: -140px; }
.shield-visual { width: 85px; height: 85px; display: grid; place-items: center; position: relative; border-radius: 25px; color: white; background: linear-gradient(145deg, var(--teal), #258cf1); box-shadow: 0 16px 35px rgba(12,188,168,.2); }
.shield-visual svg { width: 37px; }
.shield-visual i { position: absolute; right: 9px; bottom: 9px; width: 13px; height: 13px; border-radius: 50%; background: #55df9f; border: 3px solid white; }
.security-hero h3 { margin: 3px 0 6px; font-size: 20px; letter-spacing: -.03em; }
.security-hero p { margin: 0; max-width: 650px; font-size: 10px; color: var(--muted); }
.availability { position: relative; z-index: 2; display: flex; flex-direction: column; text-align: right; }
.availability span { font-size: 8px; color: var(--muted-2); }
.availability strong { font-size: 29px; letter-spacing: -.04em; color: var(--teal-dark); }
.availability small { font-size: 7px; color: var(--muted); }
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 13px; }
.security-card { padding: 18px; min-height: 185px; display: flex; flex-direction: column; align-items: flex-start; }
.security-card > svg { width: 23px; height: 23px; color: var(--teal-dark); margin-bottom: 20px; }
.security-card h3 { margin: 0; font-size: 12px; }
.security-card p { margin: 6px 0 13px; color: var(--muted); font-size: 9px; flex: 1; }
.security-timeline { padding: 19px; }
.timeline-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 14px; }
.timeline-list > div { display: grid; grid-template-columns: 27px 1fr; gap: 8px; }
.timeline-list > div > svg { width: 24px; height: 24px; padding: 6px; border-radius: 50%; color: var(--green); background: #e5f6ef; }
.timeline-list p { margin: 0; display: flex; flex-direction: column; }
.timeline-list strong { font-size: 9px; }
.timeline-list small { font-size: 8px; color: var(--muted-2); margin-top: 3px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3,18,29,.44); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; z-index: 90; right: 0; top: 0; width: min(470px, 100%); height: 100vh; padding: 28px; background: white; box-shadow: var(--shadow-lg); transform: translateX(102%); transition: transform .27s ease; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-close { position: absolute; top: 19px; right: 19px; }
.drawer-kicker { font-size: 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--teal-dark); font-weight: 800; }
.drawer h2 { margin: 6px 45px 2px 0; font-size: 22px; letter-spacing: -.03em; }
.drawer > div > p { margin: 0; color: var(--muted); font-size: 10px; }
.drawer-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.drawer-summary div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.drawer-summary span { font-size: 7px; color: var(--muted-2); }
.drawer-summary strong { font-size: 12px; margin-top: 3px; }
.drawer-chart { height: 170px; padding: 12px; margin: 15px 0; border-radius: 11px; background: #f5f9fa; }
.drawer-chart svg { width: 100%; height: 100%; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { font-size: 11px; margin: 0 0 9px; }
.drawer-signal { display: grid; grid-template-columns: 9px 1fr; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.drawer-signal p { margin: 0; display: flex; flex-direction: column; }
.drawer-signal strong { font-size: 9px; }
.drawer-signal small { font-size: 8px; color: var(--muted); }
.drawer-actions { display: flex; gap: 8px; margin-top: 22px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3,18,29,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; position: relative; padding: 27px; background: white; border-radius: 18px; box-shadow: var(--shadow-lg); transform: translateY(8px) scale(.985); transition: transform .2s; }
.modal-backdrop.open .modal { transform: none; }
.modal-close { position: absolute; top: 17px; right: 17px; }
.modal h2 { margin: 0 43px 7px 0; font-size: 20px; letter-spacing: -.03em; }
.modal > div > p { color: var(--muted); font-size: 10px; }
.modal-highlight { margin: 17px 0; padding: 15px; border-radius: 11px; background: #f0f9f7; }
.modal-highlight strong { display: block; font-size: 17px; color: var(--teal-dark); }
.modal-highlight span { font-size: 8px; color: var(--muted); }
.modal-checklist { list-style: none; margin: 14px 0; padding: 0; }
.modal-checklist li { display: grid; grid-template-columns: 19px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 9px; color: var(--muted); }
.modal-checklist svg { width: 15px; color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.upload-zone { margin: 18px 0; padding: 30px 18px; border: 1.5px dashed #b9cbd3; border-radius: 12px; background: #f9fbfc; text-align: center; }
.upload-zone svg { width: 30px; color: var(--teal-dark); }
.upload-zone strong { display: block; margin-top: 8px; font-size: 11px; }
.upload-zone span { font-size: 8px; color: var(--muted-2); }

.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; }
.toast { min-width: 270px; max-width: 390px; display: grid; grid-template-columns: 27px 1fr 19px; align-items: center; gap: 9px; padding: 11px 12px; color: white; background: #0b2a3b; border-radius: 11px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; }
.toast > svg { width: 24px; height: 24px; padding: 5px; border-radius: 50%; color: #55ddb1; background: rgba(85,221,177,.12); }
.toast p { margin: 0; display: flex; flex-direction: column; font-size: 9px; }
.toast strong { font-size: 10px; }
.toast small { color: #99b1bd; font-size: 8px; margin-top: 1px; }
.toast button { border: 0; background: transparent; color: #87a3b2; padding: 0; }
.toast button svg { width: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

body.presentation .sidebar { transform: translateX(-100%); }
body.presentation main { margin-left: 0; }
body.presentation .topbar { padding-left: 38px; }
body.presentation .content { max-width: 1480px; }
.sidebar, main { transition: margin .25s ease, transform .25s ease; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 232px; }
  .content { padding-left: 22px; padding-right: 22px; }
  .dashboard-grid { grid-template-columns: 1.45fr .75fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-ribbon { grid-template-columns: repeat(3, 1fr); }
  .stats-ribbon > div:nth-child(4) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .stats-ribbon > div:nth-child(5), .stats-ribbon > div:nth-child(6) { border-top: 1px solid var(--line-soft); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .security-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .mobile-only { display: grid; }
  .sidebar { width: 264px; transform: translateX(-102%); box-shadow: var(--shadow-lg); }
  .sidebar.mobile-open { transform: none; }
  main, body.presentation main { margin-left: 0; }
  .topbar { padding: 0 20px; }
  .presentation-button { display: none; }
  .dashboard-grid, .twin-layout, .forecast-layout, .assistant-layout, .reversibility-layout { grid-template-columns: 1fr; }
  .building-twin, .forecast-main { grid-row: auto; }
  .priority-card, .alerts-card { min-height: 0; }
  .alert-workspace { grid-template-columns: 1fr; }
  .alert-detail { position: static; }
  .security-hero { grid-template-columns: 78px 1fr; }
  .availability { grid-column: 2; text-align: left; }
  .source-strip { grid-column: auto; }
}

@media (max-width: 660px) {
  .content { padding: 20px 14px 34px; }
  .topbar { height: 68px; padding: 0 14px; }
  .topbar h1 { font-size: 16px; }
  .eyebrow, .sync-status { display: none; }
  .prototype-badge { height: 29px; padding: 0 8px; font-size: 9px; }
  .view-heading { align-items: stretch; flex-direction: column; gap: 13px; }
  .view-heading h2 { font-size: 20px; }
  .filters { overflow-x: auto; }
  .filters label { min-width: 150px; }
  .filters select { width: 100%; }
  .standalone-select select { width: 100%; }
  .kpi-grid, .invoice-kpis { grid-template-columns: 1fr 1fr; }
  .kpi-card { padding: 14px; }
  .kpi-card h3 { font-size: 19px; }
  .dashboard-grid { display: flex; flex-direction: column; }
  .consumption-card { padding: 14px; }
  .chart-legend { display: none; }
  .chart-container { min-height: 210px; }
  .chart-insight { grid-template-columns: 20px 1fr; }
  .chart-insight button { grid-column: 2; text-align: left; padding: 0; }
  .recommendation-head { grid-template-columns: 35px 1fr; }
  .potential { grid-column: 2; width: max-content; }
  .source-strip { align-items: flex-start; gap: 12px; }
  .source-strip > div { grid-template-columns: 20px 1fr; }
  .source-strip .secondary-button { display: none; }
  .stats-ribbon { grid-template-columns: repeat(2, 1fr); }
  .stats-ribbon > div:nth-child(3), .stats-ribbon > div:nth-child(5) { border-left: 0; }
  .stats-ribbon > div:nth-child(3) { border-top: 1px solid var(--line-soft); }
  .stats-ribbon > div:nth-child(4) { border-left: 1px solid var(--line-soft); }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; width: 100%; }
  .segmented { overflow-x: auto; }
  .building-visual { min-height: 315px; }
  .building-shell { width: 73%; }
  .weather-pill { left: 10px; top: 10px; }
  .sensor-pill { right: 10px; bottom: 10px; }
  .live-metrics { grid-template-columns: 1fr; }
  .live-metrics div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .live-metrics div:first-child { border-top: 0; }
  .alert-workspace { display: block; }
  .alert-detail { margin-top: 13px; }
  .scenario-tabs { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card { grid-template-columns: 39px 1fr auto; }
  .security-hero { grid-template-columns: 60px 1fr; padding: 19px; gap: 14px; }
  .shield-visual { width: 58px; height: 58px; border-radius: 17px; }
  .shield-visual svg { width: 27px; }
  .security-grid, .timeline-list { grid-template-columns: 1fr; }
  .security-card { min-height: 150px; }
  .drawer { padding: 24px 18px; }
  .drawer-summary { grid-template-columns: 1fr 1fr; }
  .modal { padding: 24px 18px; }
}

@media (max-width: 420px) {
  .topbar-left { gap: 7px; min-width: 0; }
  .topbar-left > div { min-width: 0; }
  .topbar h1 { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .prototype-badge { padding: 0 7px; }
  .kpi-grid, .invoice-kpis { grid-template-columns: 1fr; }
  .top-actions .secondary-button { display: none; }
  .title-row { align-items: flex-start; flex-wrap: wrap; }
  .chart-insight { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
