:root {
  --pvk-orange: #e39a12;
  --pvk-orange-dark: #875000;
  --ink: #1e1e1e;
  --ink-soft: #484846;
  --muted: #62625e;
  --line: #e4e4df;
  --line-strong: #d4d4cd;
  --surface: #ffffff;
  --surface-soft: #f6f6f3;
  --canvas: #f1f2ef;
  --success: #2c7a54;
  --blue: #3976a8;
  --sidebar-width: 248px;
  --sidebar-collapsed: 82px;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(23 23 21 / 4%), 0 8px 28px rgb(23 23 21 / 4%);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #875000; outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-shell.is-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-x: hidden;
  overflow-y: auto;
}

.brand-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px 20px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; min-width: 0; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand img { display: block; width: 132px; height: auto; }
.brand-product {
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border-left: 1px solid var(--line-strong);
  color: var(--pvk-orange-dark);
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
}
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }

.workspace-label {
  padding: 25px 24px 10px;
  color: #6f6f69;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-list { display: grid; gap: 4px; padding: 0 12px; }
.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  font-weight: 600;
}
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.is-active { background: #fff6e5; color: #84560a; box-shadow: inset 3px 0 var(--pvk-orange); }
.nav-icon { width: 24px; text-align: center; color: #75756e; font-size: 18px; font-weight: 400; }
.nav-item.is-active .nav-icon { color: var(--pvk-orange-dark); }
.sidebar-spacer { flex: 1; }

.sidebar-status {
  margin: 12px;
  padding: 13px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #f0d8aa;
  border-radius: var(--radius);
  background: #fffaf0;
}
.status-dot, .sync-mark { display: block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--pvk-orange); box-shadow: 0 0 0 4px rgb(227 154 18 / 13%); }
.sidebar-status div { min-width: 0; display: grid; gap: 3px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status span:last-child { color: var(--muted); font-size: 11px; white-space: nowrap; }

.profile-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 7px; background: var(--ink); color: white; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.profile-copy { min-width: 0; display: grid; gap: 2px; }
.profile-copy strong { font-size: 12px; }
.profile-copy span { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { border: 0; background: transparent; color: var(--muted); }

.app-shell.is-collapsed .brand img,
.app-shell.is-collapsed .brand-product,
.app-shell.is-collapsed .workspace-label,
.app-shell.is-collapsed .nav-label,
.app-shell.is-collapsed .sidebar-status div,
.app-shell.is-collapsed .profile-copy,
.app-shell.is-collapsed .profile-menu { display: none; }
.app-shell.is-collapsed .brand-row { justify-content: center; padding-inline: 12px; }
.app-shell.is-collapsed .sidebar-toggle { transform: rotate(180deg); }
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 0; }
.app-shell.is-collapsed .sidebar-status { justify-content: center; padding-inline: 0; }
.app-shell.is-collapsed .profile-row { display: flex; justify-content: center; padding-inline: 0; }

.page-column { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(20px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.mobile-menu { display: none; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: #6f6f69; font-size: 12px; }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }

.context-select select {
  min-width: 178px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 36px 0 12px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}
.sync-state { display: flex; align-items: center; gap: 11px; border: 0; padding: 4px 2px; background: transparent; text-align: left; }
.sync-state > span:last-child { display: grid; gap: 2px; }
.sync-state strong { font-size: 11px; }
.sync-state small { color: var(--muted); font-size: 9px; }
.sync-state.is-connected .sync-mark { background: var(--success); box-shadow: 0 0 0 4px rgb(44 122 84 / 13%); }
.sync-state.is-stale .sync-mark { background: var(--pvk-orange); box-shadow: 0 0 0 4px rgb(227 154 18 / 13%); }
.sync-state.is-error .sync-mark { background: #a83d31; box-shadow: 0 0 0 4px rgb(168 61 49 / 13%); }

.content { width: min(100%, 1540px); margin: 0 auto; padding: 34px clamp(20px, 3vw, 44px) 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow, .panel-kicker { margin: 0 0 6px; color: var(--pvk-orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { font-family: "Exo 2", "Segoe UI", sans-serif; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; letter-spacing: -.035em; }
.page-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; padding: 0 15px; font-size: 12px; font-weight: 700; }
.button-primary { border: 1px solid var(--pvk-orange); background: var(--pvk-orange); color: #241801; box-shadow: 0 5px 14px rgb(227 154 18 / 20%); }
.button-primary:hover { background: #eca51f; }
.button-secondary { border: 1px solid var(--line-strong); background: var(--surface); }
.button-secondary:hover, .button-ghost:hover { background: var(--surface-soft); }
.button-dark { border: 1px solid var(--ink); background: var(--ink); color: white; }
.button-ghost { border: 1px solid transparent; background: transparent; color: var(--muted); }
.button-light { border: 1px solid rgb(255 255 255 / 30%); background: white; color: var(--ink); }
.button-light:hover { background: #fff8e9; }
.button:disabled { cursor: wait; opacity: .65; }

.filter-panel {
  margin: -8px 0 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.filter-panel[hidden] { display: none; }
.filter-panel label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.filter-panel select { width: 100%; height: 39px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 0 10px; color: var(--ink); font-size: 12px; text-transform: none; letter-spacing: 0; }
.filter-actions { display: flex; gap: 6px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.kpi-card { position: relative; min-height: 142px; padding: 18px 19px 16px; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; right: -24px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: rgb(30 30 30 / 2.5%); }
.kpi-accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pvk-orange); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--pvk-orange-dark); background: var(--surface-soft); font-size: 14px; }
.kpi-value { margin-top: 14px; font-family: "Exo 2", "Segoe UI", sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.kpi-value small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.kpi-card p { margin: 7px 0 0; color: #6f6f69; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(300px, .8fr); gap: 14px; margin-bottom: 14px; }
.panel { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.segment-control { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.segment-control button { min-width: 58px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.segment-control button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgb(30 30 30 / 9%); }

.chart-placeholder { position: relative; min-height: 312px; display: grid; grid-template-columns: 38px 1fr; gap: 10px; margin-top: 24px; }
.chart-y-labels { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 19px; color: #6f6f69; font-size: 9px; text-align: right; }
.chart-stage { position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: clamp(5px, 1vw, 13px); padding: 18px 18px 20px; border-bottom: 1px solid var(--line-strong); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--line) 25%); overflow: hidden; }
.chart-stage i { flex: 1; max-width: 28px; min-width: 8px; border-radius: 4px 4px 1px 1px; background: linear-gradient(to top, rgb(227 154 18 / 13%), rgb(227 154 18 / 42%)); filter: saturate(.75); }
.chart-stage i:nth-child(1) { height: 22%; }
.chart-stage i:nth-child(2) { height: 31%; }
.chart-stage i:nth-child(3) { height: 28%; }
.chart-stage i:nth-child(4) { height: 46%; }
.chart-stage i:nth-child(5) { height: 57%; }
.chart-stage i:nth-child(6) { height: 68%; }
.chart-stage i:nth-child(7) { height: 63%; }
.chart-stage i:nth-child(8) { height: 76%; }
.chart-stage i:nth-child(9) { height: 71%; }
.chart-stage i:nth-child(10) { height: 82%; }
.chart-stage i:nth-child(11) { height: 74%; }
.chart-stage i:nth-child(12) { height: 48%; }
.chart-stage::after { content: ""; position: absolute; inset: 0; background: rgb(255 255 255 / 45%); backdrop-filter: blur(1.5px); }
.chart-message { position: absolute; z-index: 2; left: 54%; top: 51%; width: min(330px, 70%); display: grid; justify-items: center; gap: 6px; transform: translate(-50%, -50%); padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: rgb(255 255 255 / 94%); box-shadow: 0 10px 30px rgb(30 30 30 / 8%); text-align: center; }
.chart-message-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 2px; border-radius: 7px; background: #fff3dc; color: var(--pvk-orange-dark); font-size: 18px; }
.chart-message strong { font-size: 12px; }
.chart-message span:last-child { color: var(--muted); font-size: 10px; line-height: 1.45; }

.tag { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 9px; font-style: normal; font-weight: 700; white-space: nowrap; }
.tag-progress { border-color: #f0d8aa; background: #fff8e9; color: #8b5a09; }
.readiness-summary { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 15px; margin: 24px 0; }
.progress-ring { display: grid; width: 82px; height: 82px; place-items: center; border-radius: 50%; background: conic-gradient(var(--pvk-orange) 0 50%, #efefe9 50% 100%); position: relative; }
.progress-ring::after { content: ""; position: absolute; width: 64px; height: 64px; border-radius: 50%; background: white; }
.progress-ring span { position: relative; z-index: 1; font-family: "Exo 2", "Segoe UI", sans-serif; font-size: 22px; font-weight: 800; }
.progress-ring small { font-size: 10px; }
.readiness-summary strong { font-size: 12px; }
.readiness-summary p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.milestone-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.milestone-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 53px; border-top: 1px solid var(--line); }
.milestone-list li > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 9px; font-weight: 800; }
.milestone-list li.is-done > span { border-color: var(--success); background: var(--success); color: white; }
.milestone-list div { display: grid; gap: 3px; }
.milestone-list strong { font-size: 10px; }
.milestone-list small { color: var(--muted); font-size: 9px; }
.milestone-list b { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.milestone-list .is-done b { color: var(--success); }

.modules-panel { padding-bottom: 8px; }
.text-button { border: 0; background: transparent; color: var(--pvk-orange-dark); font-size: 10px; font-weight: 800; }
.module-table { margin-top: 18px; }
.module-row { display: grid; grid-template-columns: minmax(210px, 1.15fr) minmax(240px, 1.4fr) 120px 32px; align-items: center; min-height: 58px; gap: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.module-row > span:first-child { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.module-glyph { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: var(--surface-soft); color: var(--pvk-orange-dark); font-size: 14px; font-style: normal; }
.module-row button { width: 28px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.module-row button:hover { background: var(--surface-soft); color: var(--ink); }
.module-header { min-height: 34px; border: 0; color: #6f6f69; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.module-header > span:first-child { color: #6f6f69; }

.dashboard-content { display: block; }
.dashboard-content[hidden], .connection-content[hidden], .heading-actions[hidden] { display: none; }
.connection-content { display: grid; gap: 14px; }
.connection-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  overflow: hidden;
  border-color: #2f2f2c;
  background: var(--ink);
  color: white;
}
.connection-hero::after { content: ""; position: absolute; right: -70px; top: -110px; width: 280px; height: 280px; border-radius: 50%; background: rgb(227 154 18 / 11%); }
.connection-hero-copy, .connection-hero > button, .connection-route { position: relative; z-index: 1; }
.connection-hero h2 { max-width: 650px; margin: 0; font-size: clamp(19px, 2vw, 25px); letter-spacing: -.025em; }
.connection-hero p { max-width: 720px; margin: 10px 0 0; color: #c9c9c2; font-size: 11px; line-height: 1.6; }
.connection-hero > button { align-self: start; }
.connection-route { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr) auto minmax(120px, 1fr); align-items: center; gap: 16px; margin-top: 8px; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 12%); }
.connection-route > div { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; }
.connection-route span { grid-row: 1 / span 2; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgb(227 154 18 / 55%); border-radius: 50%; color: #ffd27d; font-size: 10px; font-weight: 800; }
.connection-route strong { font-size: 11px; }
.connection-route small { color: #aaa9a2; font-size: 9px; }
.connection-route > i { color: #8a8a84; font-style: normal; }
.connection-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.connection-kpi-value { min-height: 38px; display: flex; align-items: flex-end; margin-top: 14px; font-family: "Exo 2", "Segoe UI", sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -.025em; }
.connection-kpi-time { font-size: 15px; line-height: 1.25; }
.connection-detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 14px; }
.connection-pill.is-connected { border-color: #b9dfca; background: #eef9f2; color: #216842; }
.connection-pill.is-stale { border-color: #ead39e; background: #fff8e9; color: #714700; }
.connection-pill.is-error, .connection-pill.is-failed { border-color: #ebc0ba; background: #fff2f0; color: #9b3025; }
.connection-message { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.connection-message.is-connected { border-color: #b9dfca; background: #f1faf5; }
.connection-message.is-stale { border-color: #ead39e; background: #fffaf0; }
.connection-message.is-error, .connection-message.is-failed { border-color: #ebc0ba; background: #fff5f3; }
.connection-message-icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: white; color: var(--pvk-orange-dark); font-size: 20px; box-shadow: 0 1px 5px rgb(30 30 30 / 8%); }
.connection-message.is-connected .connection-message-icon { color: var(--success); }
.connection-message strong { font-size: 12px; }
.connection-message p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.connection-meta { display: grid; margin: 18px 0 0; }
.connection-meta > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.connection-meta dt { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.connection-meta dd { margin: 0; overflow: hidden; color: var(--ink); font-family: Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 40px)); padding: 13px 16px; border: 1px solid #4b4b47; border-radius: 7px; background: var(--ink); color: white; box-shadow: 0 14px 40px rgb(0 0 0 / 18%); font-size: 11px; line-height: 1.45; }
.toast[hidden], .mobile-overlay[hidden] { display: none; }
.mobile-overlay { position: fixed; z-index: 19; inset: 0; background: rgb(20 20 18 / 38%); backdrop-filter: blur(2px); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .readiness-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .readiness-panel .panel-heading { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .app-shell, .app-shell.is-collapsed { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 44px));
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, visibility 0s linear 180ms;
    box-shadow: 18px 0 50px rgb(0 0 0 / 13%);
  }
  .app-shell.is-mobile-open .sidebar { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .app-shell.is-collapsed .brand img { display: block; }
  .app-shell.is-collapsed .brand-product,
  .app-shell.is-collapsed .workspace-label,
  .app-shell.is-collapsed .nav-label,
  .app-shell.is-collapsed .sidebar-status div,
  .app-shell.is-collapsed .profile-copy,
  .app-shell.is-collapsed .profile-menu { display: initial; }
  .app-shell.is-collapsed .brand-row { justify-content: space-between; padding: 16px 18px 14px 20px; }
  .app-shell.is-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .app-shell.is-collapsed .sidebar-status { justify-content: flex-start; padding: 13px 12px; }
  .app-shell.is-collapsed .profile-row { display: grid; justify-content: initial; padding: 12px 16px; }
  .sidebar-toggle { display: none; }
  .mobile-menu { display: grid; }
  .topbar { padding-inline: 20px; }
  .sync-state small { display: none; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .filter-actions { justify-content: flex-end; }
  .module-row { grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) 100px 30px; }
  .connection-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .topbar { min-height: 66px; }
  .topbar-actions { gap: 8px; }
  .context-select select { min-width: 0; width: 142px; }
  .sync-state { display: none; }
  .content { padding: 24px 15px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .filter-panel, .kpi-grid { grid-template-columns: 1fr; }
  .connection-kpis { grid-template-columns: 1fr; }
  .connection-hero { grid-template-columns: 1fr; }
  .connection-hero > button { width: 100%; }
  .connection-route { grid-template-columns: 1fr; gap: 10px; }
  .connection-route > i { display: none; }
  .filter-actions { grid-column: 1; }
  .kpi-card { min-height: 126px; }
  .panel { padding: 16px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .segment-control { align-self: flex-start; }
  .chart-placeholder { min-height: 278px; grid-template-columns: 31px 1fr; }
  .chart-message { left: 55%; width: 82%; }
  .readiness-panel { display: block; }
  .module-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; }
  .module-row > span:nth-child(2) { grid-column: 1; padding-left: 38px; }
  .module-row > span:nth-child(3) { grid-column: 1; padding-left: 38px; }
  .module-row > button { grid-column: 2; grid-row: 1 / span 3; }
  .module-header { display: none; }
  .toast { right: 15px; bottom: 15px; }
}

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