/* ============================================================
   Power AI Platform — styles
   ============================================================ */
:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e8f0;
  --primary: #4f46e5;
  --primary-2: #2563eb;
  --accent: #7c3aed;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;
  --sky: #38bdf8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  --sidebar-w: clamp(212px, 16vw, 248px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  align-items: stretch;
}

/* ---- language visibility ---- */
.lang-both .en + .zh { margin-left: .35em; }
.lang-en .zh { display: none !important; }
.lang-zh .en { display: none !important; }

/* ============================ Sidebar ============================ */
.sidebar {
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #3730a3 100%);
  color: #c7d2fe;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: relative;
  min-height: 100vh;
  height: auto;
  align-self: stretch;
  overflow: visible;
  overflow-x: hidden;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 2px 0 22px;
  flex: 0 0 auto;
}
.brand-logo {
  display: block;
  width: min(100%, 210px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; flex: 0 0 auto; min-height: auto; }
.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: #818cf8; margin: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  color: #c7d2fe; font-size: 13.5px; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item .ic { width: 18px; text-align: center; opacity: .85; font-style: normal; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, .14);
  color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 #a855f7;
}

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; margin-top: auto; flex: 0 0 auto; }
.src-pill {
  font-size: 12px; color: #fde68a; display: flex; align-items: center; gap: 6px;
}
.src-pill.live { color: #6ee7b7; }
.sidebar-foot .muted { color: #818cf8; font-size: 11px; margin-top: 4px; }

/* ============================ Main ============================ */
.main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px; padding: 12px 22px;
}
.title-block { flex: 1 1 170px; min-width: 140px; }
.report-title { font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.report-sub { font-size: 19px; font-weight: 700; line-height: 1.1; }

.controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; flex: 999 1 640px; min-width: 0; flex-wrap: wrap; }
.ctrl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ctrl-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ctrl select, .ctrl input {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px;
  font-size: 13px; background: #fff; color: var(--ink); min-width: 120px; width: 100%;
}
#projectSelect { min-width: 180px; }
.ctrl select:focus, .ctrl input:focus { outline: 2px solid #c7d2fe; border-color: var(--primary); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button {
  border: 0; background: #fff; padding: 7px 10px; cursor: pointer; font-size: 12px; color: var(--muted);
}
.seg button.active { background: var(--primary); color: #fff; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 15px;
}
.btn:hover { background: #f8f8ff; }
.logo-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px;
  min-width: 134px;
  background: #fff;
}
.logo-chip img { display: block; width: 118px; max-width: 100%; height: 20px; object-fit: contain; }

/* ============================ View / cards ============================ */
/* The report canvas grows the page height so the left blue sidebar can stretch
   to match the dashboard instead of ending at the viewport. */
.view { padding: clamp(12px, 1.35vw, 22px); display: grid; gap: 16px; flex: 1; min-height: 0; overflow-y: visible; align-content: start; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  min-width: 0;
}
.card h3 {
  margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.card h3 .badge { font-size: 10px; font-weight: 600; color: var(--accent); background: #f3e8ff; padding: 2px 7px; border-radius: 20px; }
.card .chart-wrap { position: relative; width: 100%; }
.card canvas { width: 100% !important; }

/* KPI cards */
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); }
.kpi.gauge { align-items: center; }
.kpi.gauge .gauge-wrap { position: relative; width: 100%; max-width: 190px; }
.kpi.gauge .k-label { align-self: flex-start; }

.muted { color: var(--muted); }
.note {
  font-size: 12.5px; color: var(--muted); background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: 9px 12px;
}
.note.err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.ilm-frame-shell {
  height: calc(100vh - 112px);
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f4f7f2;
  box-shadow: var(--shadow);
}
.ilm-report-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f7f2;
}

/* Data source form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 13px; font-family: inherit;
}
.method-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbff;
  padding: 14px;
  margin: 12px 0 14px;
}
.primary-method {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.method-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.method-copy { font-size: 13px; margin: 6px 0 0; }
.method-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.advanced-auth {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.advanced-auth summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.disabled-link {
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
}
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; }
.actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-primary { background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; cursor: pointer; font-weight: 600; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor: pointer; font-size: 13.5px; }
.steps { font-size: 13px; line-height: 1.7; color: var(--muted); }
.steps code { background: #f1f1fb; padding: 1px 6px; border-radius: 5px; color: var(--ink); font-size: 12px; }
.kbd-list { margin: 0; padding-left: 18px; }

/* table fallback for degraded charts */
table.fallback { width: 100%; border-collapse: collapse; font-size: 12px; }
table.fallback th, table.fallback td { border: 1px solid var(--line); padding: 5px 8px; text-align: right; }
table.fallback th:first-child, table.fallback td:first-child { text-align: left; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Wifi Collection additions ---- */
.kpi-row-6 { grid-template-columns: repeat(6, 1fr); }
.kpi-row-6 .kpi { padding: 12px 14px; }
.kpi-row-6 .kpi .k-value { font-size: 24px; }
.muted.sub, .sub { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data-table th, table.data-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.data-table th { font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; background: #fafbff; position: sticky; top: 0; }
table.data-table td.num, table.data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-table tbody tr:hover { background: #f7f8fe; }
table.data-table th, table.data-table td { overflow-wrap: anywhere; }

/* ---- Power BI template mode ---- */
.view.powerbi-report {
  padding: 10px;
  gap: 0;
  background: #f2f5f1;
}
.pbi-report-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 14px;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.pbi-body { display: grid; gap: 14px; min-width: 0; }
.pbi-body .card, .pbi-body .kpi {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  background: #fff;
}
.pbi-body .card { padding: 0; overflow: hidden; }
.pbi-body .card h3 {
  min-height: 32px;
  margin: 0;
  padding: 5px 9px;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.15;
}
.pbi-body .chart-wrap { padding: 8px 10px 10px; }
.pbi-body .kpi::after { display: none; }
.pbi-footer {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  background: #f3f3f3;
  border-top: 1px solid #d6d6d6;
  color: #111827;
  font-size: 11px;
}
.pbi-footer span:first-child { color: #0078d4; text-decoration: underline; font-weight: 600; }
.lw-logo { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-width: 0; }
.lw-logo img { display: block; width: auto; max-width: 100%; height: 30px; object-fit: contain; }

/* Jokbo blue Power BI template */
.pbi-jokbo-shell {
  background: #14239a;
  padding: 16px;
}
.pbi-jokbo-header {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(300px, 1fr) minmax(460px, 660px);
  gap: 20px;
}
.pbi-stack { display: grid; gap: 10px; }
.pbi-logo-card, .pbi-date-card, .pbi-title-card, .pbi-timeline-card, .pbi-page-title {
  background: #fff;
  color: #111;
  border: 1px solid #13208c;
}
.pbi-logo-card { min-height: 38px; display: grid; place-items: center; }
.pbi-date-card { min-height: 92px; display: grid; place-items: center; text-align: center; padding: 12px; }
.pbi-date-card strong { font-size: 20px; }
.pbi-date-card span { font-size: 16px; }
.pbi-title-card { min-height: 140px; display: grid; place-items: center; align-content: center; text-align: center; }
.pbi-title-card h1 { font-size: 30px; margin: 0 0 12px; line-height: 1.05; }
.pbi-title-card h2 { font-size: 34px; margin: 0; line-height: 1.05; }
.pbi-timeline-card { padding: 14px 18px; min-height: 140px; }
.pbi-timeline-scale { display: flex; gap: 28px; justify-content: flex-start; margin-left: 18px; font-size: 12px; }
.pbi-timeline-scale span { min-width: 10px; text-align: center; border-bottom: 2px solid #111; }
.pbi-timeline-scale .active { border: 1px solid #888; border-radius: 5px; padding: 0 6px; line-height: 1.05; }
.pbi-timeline-title { text-align: center; color: #666; margin: 8px 0 10px; font-size: 13px; }
.pbi-months { display: grid; grid-template-columns: repeat(13, 1fr); color: #666; font-size: 13px; text-align: center; }
.pbi-slider { height: 24px; background: #9db8f3; border: 1px solid #6d7fae; border-radius: 2px; position: relative; overflow: hidden; }
.pbi-slider i { position: absolute; inset: 0 auto 0 12%; width: 2px; background: #263a89; box-shadow: 50px 0 #263a89, 100px 0 #263a89, 150px 0 #263a89, 200px 0 #263a89, 250px 0 #263a89, 300px 0 #263a89, 350px 0 #263a89, 400px 0 #263a89, 450px 0 #263a89; }
.pbi-page-title {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  padding: 8px 12px;
}
.pbi-jokbo-shell .pbi-body .card h3 { background: #cfe0fb; color: #050505; }
.pbi-jokbo-shell .pbi-body .kpi {
  min-height: 110px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
}
.pbi-jokbo-shell .pbi-body .kpi .k-label { color: #111; font-size: 15px; font-weight: 600; }
.pbi-jokbo-shell .pbi-body .kpi .k-value { font-size: 34px; font-weight: 400; color: #2d2d2d; }
.pbi-jokbo-shell .pbi-body .kpi-row { gap: 16px; }
.pbi-jokbo-shell .pbi-body .grid-3,
.pbi-jokbo-shell .pbi-body .grid-2 { gap: 16px; }

/* Wifi green Power BI template */
.pbi-wifi-shell {
  background: #edf3ef;
  padding: 0 6px 10px;
  color: #2f3137;
  container-type: inline-size;
}
.pbi-wifi-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .72fr) minmax(0, .44fr) minmax(0, .48fr) minmax(0, .68fr);
  grid-template-areas: "summary title teams review date";
  gap: 12px;
  align-items: start;
}
.pbi-wifi-summary { grid-area: summary; min-width: 0; }
.pbi-wifi-title {
  grid-area: title;
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}
.pbi-wifi-title h1 {
  margin: 0;
  max-width: 100%;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
  color: #202124;
  overflow-wrap: anywhere;
}
.pbi-wifi-logo {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
}
.pbi-wifi-title .lw-logo { width: min(220px, 100%); justify-content: flex-start; }
.pbi-wifi-title .lw-logo img { height: clamp(24px, 2.2vw, 34px); }
.pbi-region-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(13px, 1.08vw, 18px);
  background: #fff;
}
.pbi-region-table th {
  background: #006050;
  color: #fff;
  padding: 7px 8px;
  text-align: right;
  font-size: clamp(13px, 1.08vw, 18px);
  line-height: 1.15;
  font-weight: 700;
}
.pbi-region-table th:first-child, .pbi-region-table td:first-child { text-align: left; }
.pbi-region-table td { padding: 4px 8px; text-align: right; border-bottom: 1px solid #7fc8e8; }
.pbi-region-table th, .pbi-region-table td { overflow-wrap: anywhere; }
.pbi-region-table .total td { font-weight: 800; border-bottom: 0; }
.pbi-filter {
  min-width: 0;
  min-height: 110px;
  background: #fff;
  padding: 12px 14px;
}
.pbi-team-filter { grid-area: teams; }
.pbi-review-filter { grid-area: review; }
.pbi-date-filter { grid-area: date; }
.pbi-filter label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.pbi-filter div {
  min-height: 32px;
  border: 1px solid #e4e4e4;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  min-width: 0;
  width: 100%;
  background: #fff;
  overflow-wrap: anywhere;
}
.pbi-date-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pbi-date-filter label { grid-column: 1 / -1; margin-bottom: 0; }
.pbi-wifi-shell .pbi-body .card h3 {
  background: #006050;
  color: #fff;
  font-size: 17px;
  min-height: 32px;
}
.wifi-overall-template {
  display: grid;
  grid-template-columns: minmax(160px, .46fr) minmax(0, 1.45fr) minmax(150px, .42fr) minmax(230px, .74fr);
  grid-template-areas:
    "target statuses statuses statuses"
    "active poi side city"
    "active poi side covered";
  gap: 18px;
  align-items: stretch;
}
.wifi-target-card, .wifi-status-card, .wifi-simple-card, .wifi-covered-card {
  background: #fff;
  min-width: 0;
}
.wifi-target-card { grid-area: target; min-height: 244px; text-align: center; display: grid; grid-template-rows: 34px 1fr auto; }
.wifi-card-title, .wifi-status-title {
  background: #006050;
  color: #fff;
  font-weight: 800;
  font-size: clamp(13px, 1.05vw, 16px);
  text-align: center;
  padding: 5px 8px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
}
.wifi-target-icon { align-self: end; font-size: 54px; color: #050505; }
.wifi-target-value { font-size: clamp(32px, 3.1vw, 44px); font-weight: 700; padding: 0 10px 30px; overflow-wrap: anywhere; }
.wifi-status-grid { grid-area: statuses; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px; min-width: 0; }
.wifi-status-card { display: grid; grid-template-rows: minmax(34px, auto) minmax(54px, 1fr) auto; min-height: clamp(168px, 15vw, 244px); text-align: center; min-width: 0; }
.wifi-status-value { font-size: clamp(24px, 2.15vw, 34px); align-self: center; font-weight: 400; overflow-wrap: anywhere; }
.wifi-status-sub { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; color: #a1a1a1; font-size: clamp(13px, 1.2vw, 18px); padding: 0 8px 16px; min-width: 0; }
.wifi-status-sub strong { color: #333; font-size: clamp(20px, 1.9vw, 29px); font-weight: 700; overflow-wrap: anywhere; }
.wifi-status-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: #57c993;
}
.wifi-status-card.approved .wifi-status-icon { background: #1ea39a; }
.wifi-status-card.rejected .wifi-status-icon { background: #e23c43; }
.wifi-status-card.pending-qa .wifi-status-icon { background: #f1a80a; }
.wifi-status-card.pending-collection .wifi-status-icon { background: #e9791b; border-radius: 12px; }
.wifi-active-card { grid-area: active; min-height: 410px; display: grid; grid-template-rows: auto 1fr; }
.wifi-active-card .wifi-big-number { min-height: 0; display: grid; place-items: center; font-size: clamp(34px, 3vw, 44px); }
.wifi-poi-card { grid-area: poi; min-height: 410px; }
.wifi-poi-card .chart-wrap { min-height: 360px; }
.wifi-side-metrics { grid-area: side; display: grid; gap: 40px; align-content: start; }
.wifi-simple-card { min-height: 118px; display: grid; grid-template-rows: auto 1fr; text-align: center; }
.wifi-simple-card .wifi-card-title { font-size: 17px; }
.wifi-simple-card.accent .wifi-card-title { background: #64cdaa; color: #071d18; }
.wifi-simple-card strong { align-self: center; font-size: clamp(30px, 2.8vw, 40px); font-weight: 400; overflow-wrap: anywhere; }
.wifi-city-card { grid-area: city; min-height: 176px; }
.wifi-city-card .chart-wrap { min-height: 126px; }
.wifi-covered-card { grid-area: covered; min-height: 192px; display: grid; grid-template-columns: 140px 1fr; align-items: center; }
.wifi-covered-card > div:last-child { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.wifi-covered-card > div:last-child > div { background: #006050; color: #fff; font-size: 28px; font-weight: 800; padding: 6px 8px; align-self: start; }
.wifi-covered-card strong { align-self: center; font-size: clamp(34px, 3.5vw, 52px); font-weight: 700; overflow-wrap: anywhere; }
.wifi-covered-icon {
  width: 68px;
  height: 68px;
  margin-left: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dff4ec;
  color: #32856f;
  font-size: 34px;
}

@media (max-width: 1500px) and (min-width: 1101px) {
  .pbi-wifi-header {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .7fr);
    grid-template-areas:
      "summary title date"
      "summary teams review";
    gap: 10px;
  }
  .pbi-wifi-title { min-height: 96px; }
  .pbi-wifi-title h1 { font-size: 31px; }
  .pbi-wifi-title .lw-logo { width: min(178px, 100%); }
  .pbi-wifi-title .lw-logo img { height: 27px; }
  .pbi-region-table, .pbi-region-table th { font-size: clamp(12px, 1vw, 15px); }
  .pbi-filter { min-height: 86px; padding: 10px 12px; }
  .pbi-date-filter { min-height: 96px; }
  .pbi-filter div { padding: 6px 8px; font-size: 13px; }
  .wifi-overall-template {
    grid-template-columns: minmax(160px, .42fr) minmax(0, 1fr) minmax(240px, .7fr);
    grid-template-areas:
      "target statuses statuses"
      "active poi city"
      "active poi covered"
      "side side side";
    gap: 14px;
  }
  .wifi-status-grid { grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 8px; }
  .wifi-card-title, .wifi-status-title { font-size: 14px; }
  .wifi-status-value { font-size: 28px; }
  .wifi-status-sub { gap: 6px; font-size: 14px; }
  .wifi-status-sub strong { font-size: 23px; }
  .wifi-status-icon { width: 34px; height: 34px; }
  .wifi-target-value { font-size: 38px; }
  .wifi-side-metrics { grid-template-columns: 1fr 1fr; gap: 14px; }
  .wifi-covered-card { grid-template-columns: 92px 1fr; }
  .wifi-covered-card > div:last-child > div { font-size: 22px; }
  .wifi-covered-card strong { font-size: 42px; }
  .wifi-covered-icon { margin-left: 18px; }
}

@media (max-width: 1368px) and (min-width: 1101px) {
  :root { --sidebar-w: 220px; }
  .sidebar { padding: 16px 12px; }
  .brand { margin-bottom: 16px; }
  .brand-logo { width: min(100%, 184px); }
  .nav-item { gap: 8px; padding: 8px 9px; font-size: 13px; }
  .nav-section { margin: 14px 9px 5px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .controls { gap: 10px; flex-basis: 560px; }
  .ctrl select, .ctrl input { min-width: 112px; }
  #projectSelect { min-width: 170px; }
  .view.powerbi-report { padding: 8px; }
  .pbi-report-shell, .pbi-body { gap: 10px; }
  .pbi-wifi-header, .wifi-overall-template { gap: 10px; }
}

@media (max-width: 1300px) and (min-width: 1101px) {
  .pbi-jokbo-header {
    grid-template-columns: minmax(220px, .78fr) minmax(0, 1fr);
    gap: 12px;
  }
  .pbi-timeline-card { grid-column: 1 / -1; min-height: 118px; }
  .pbi-title-card { min-height: 118px; }
}

@media (max-width: 1250px) and (min-width: 1101px) {
  :root { --sidebar-w: 206px; }
  .controls { flex-basis: 480px; }
  .wifi-overall-template {
    grid-template-columns: 170px minmax(0, 1fr);
    grid-template-areas:
      "target statuses"
      "active poi"
      "side side"
      "city city"
      "covered covered";
  }
  .wifi-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wifi-status-card { min-height: 188px; }
  .wifi-side-metrics { grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* responsive */
@media (max-width: 1100px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; height: 100vh; min-height: 100vh; overflow-y: auto; background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #3730a3 100%); }
  .topbar { position: static; padding: 12px 16px; }
  .title-block { flex-basis: 100%; }
  .controls { justify-content: flex-start; flex-basis: 100%; }
  .ctrl { flex: 1 1 170px; }
  #projectSelect { min-width: 0; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-row-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-3, .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr; }
  .primary-method { grid-template-columns: 1fr; }
  .method-actions { justify-content: flex-start; }
  .pbi-jokbo-header, .pbi-wifi-header { grid-template-columns: 1fr; }
  .pbi-wifi-header {
    grid-template-areas:
      "summary"
      "title"
      "teams"
      "review"
      "date";
  }
  .pbi-wifi-title { min-height: 82px; }
  .pbi-wifi-title h1 { font-size: 30px; }
  .pbi-wifi-title .lw-logo { width: min(170px, 100%); }
  .pbi-wifi-title .lw-logo img { height: 26px; }
  .pbi-region-table, .pbi-region-table th { font-size: 12px; }
  .pbi-region-table th, .pbi-region-table td { padding: 4px 5px; }
  .pbi-title-card h1 { font-size: 26px; }
  .pbi-title-card h2 { font-size: 28px; }
  .pbi-timeline-card { overflow: hidden; padding: 12px; }
  .pbi-timeline-scale { gap: clamp(8px, 4vw, 24px); margin-left: 0; }
  .pbi-timeline-title { font-size: 12px; }
  .pbi-months { overflow: hidden; grid-template-columns: repeat(13, minmax(0, 1fr)); font-size: 10px; }
  .wifi-overall-template {
    grid-template-columns: 1fr;
    grid-template-areas:
      "target"
      "statuses"
      "active"
      "poi"
      "side"
      "city"
      "covered";
  }
  .wifi-status-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 14px; }
  .wifi-covered-card { grid-template-columns: 96px 1fr; }
  .wifi-covered-icon { margin-left: 18px; }
}

@media (max-width: 760px) {
  .view { padding: 10px; }
  .topbar { gap: 12px; }
  .controls > .ctrl { flex-basis: 100%; }
  .seg { flex: 1 1 160px; }
  .seg button { flex: 1; }
  .btn { flex: 0 0 44px; }
  .logo-chip { flex: 1 1 130px; justify-content: center; }
  .logo-chip img { width: 112px; height: 19px; }
  .kpi-row, .kpi-row-6, .wifi-status-grid { grid-template-columns: 1fr; }
  .pbi-date-filter { grid-template-columns: 1fr; }
  .pbi-date-filter label { grid-column: auto; }
  .wifi-covered-card { grid-template-columns: 74px 1fr; }
  .wifi-covered-icon { margin-left: 12px; width: 56px; height: 56px; }
}
