:root {
  --bg: #f5f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #1b9bd7;
  --primary-700: #0878ad;
  --sidebar: #0f263d;
  --sidebar-2: #173854;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --shadow: 0 10px 25px rgba(16, 24, 40, .08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: #fff;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  color: #fff;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0;
  background: #fff;
  border-radius: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: #bcd4e6;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  color: #d7e7f2;
  font-size: 14px;
  text-decoration: none;
  border-radius: 12px;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.nav small {
  color: #a8c8de;
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.public-report-mode {
  background: var(--bg);
}

.public-report-mode .app {
  display: block;
  width: min(100%, 1000px);
  min-height: 100vh;
  margin: 0 auto;
}

.public-report-mode .main {
  padding: 28px 18px 42px;
}

.report-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}

.report-header-agency {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.report-header-divider {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  background: var(--line);
}

.report-header-client {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
}

.report-header-logo {
  max-width: 160px;
  max-height: 48px;
  object-fit: contain;
}

.report-header-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: var(--primary);
  border-radius: 12px;
}

.report-header-meta {
  text-align: left;
}

.report-header-meta h1 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
}

.report-header-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.title h2,
.topbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.row-alert td {
  background: #fff1f0;
}

.pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  color: var(--muted);
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 999px;
}

.dot.orange {
  background: var(--orange);
}

.dot.red {
  background: var(--red);
}

.card {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stack {
  display: grid;
  gap: 14px;
}

.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric .label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric .value {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.metric .delta {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 500;
}

.metric .hint {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric .hint-sub {
  margin-top: 3px;
  font-size: 11px;
}

.metric-group {
  margin-bottom: 18px;
}

.metric-group-head {
  margin: 0 0 10px;
}

.metric-group-head h3 {
  margin: 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
}

.exec-card {
  border-left: 4px solid var(--line);
}

.exec-card.exec-green {
  border-left-color: var(--green);
}

.exec-card.exec-orange {
  border-left-color: var(--orange);
}

.exec-card.exec-red {
  border-left-color: var(--red);
}

.rank-distribution {
  display: flex;
  flex-wrap: wrap;
}

.rank-distribution-item {
  flex: 1 1 0;
  min-width: 100px;
  text-align: center;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
}

.rank-distribution-item:first-child {
  border-left: none;
}

.rank-distribution-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
}

.rank-distribution-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.rank-distribution-delta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
}

.rank-distribution-alert {
  background: #fff1f0;
  border-radius: var(--radius);
}

.rank-distribution-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.rank-distribution-secondary {
  background: var(--bg);
}

.rank-distribution-group-start {
  border-left: 2px solid var(--line);
}

.rank-distribution-alert .rank-distribution-value,
.rank-distribution-alert .rank-distribution-label {
  color: var(--red);
}

.risk-alert {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.risk-alert-level {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
}

.risk-alert-level.risk-critical {
  background: #fef8f8;
  border-left-color: var(--red);
}

.risk-alert-level.risk-warning {
  background: #fffaf3;
  border-left-color: var(--orange);
}

.risk-alert-level-head {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.risk-alert-level-head .hint {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.risk-alert-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.risk-alert-list li {
  margin-bottom: 4px;
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.flat {
  color: var(--muted);
}

.orange {
  color: var(--orange);
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: var(--primary);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(27, 155, 215, .24);
}

.btn:hover {
  color: #fff;
  background: var(--primary-700);
}

.btn.secondary,
.btn.btn-secondary {
  color: var(--primary-700);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.secondary:hover,
.btn.btn-secondary:hover {
  color: var(--primary-700);
  background: #edf7fc;
}

.btn.dark {
  background: var(--sidebar);
  box-shadow: none;
}

.btn.danger,
.btn.btn-danger {
  color: var(--red);
  background: #fff;
  border: 1px solid #fecaca;
  box-shadow: none;
}

.btn.small,
.btn-sm {
  padding: 7px 10px;
  font-size: 12px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
}

.pagination-info,
.pagination-gap {
  color: var(--muted);
  font-size: 12px;
}

.table-pagination .btn.active {
  color: #fff;
  background: var(--sidebar);
  border-color: var(--sidebar);
}

.action-form-panel {
  margin-bottom: 14px;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.page-monitor-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  margin: 0 0 12px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.page-monitor-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.page-monitor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  overflow: hidden;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: #475467;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #f2f6fa;
}

.num {
  width: 1%;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th.sort-col-active {
  color: var(--primary-700);
  font-weight: 700;
  background: #e7f3fa;
}

.delta-col {
  width: 1%;
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

.rank-delta-up {
  color: #087443;
  background: #ecfdf3;
  font-weight: 700;
}

.rank-delta-down {
  color: #b91c1c;
  background: #fef2f2;
  font-weight: 700;
}

.rank-delta-flat {
  color: var(--muted);
  background: transparent;
}

.rank-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.rank-filter-btn.active {
  color: #fff;
  background: var(--sidebar);
  border-color: var(--sidebar);
}

.delta-head {
  display: inline-block;
  color: inherit;
  font-size: 13px;
  line-height: 1;
}

.tag,
.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  background: #eef6fb;
  border-radius: 999px;
}

.tag.green {
  color: #087443;
  background: #ecfdf3;
}

.tag.orange {
  color: #b45309;
  background: #fff7ed;
}

.tag.red {
  color: #b91c1c;
  background: #fef2f2;
}

.tag.blue {
  color: var(--primary-700);
  background: #eef6fb;
}

.tag.purple {
  color: #6b21a8;
  background: #f5f3ff;
}

.tag.teal {
  color: #0f766e;
  background: #f0fdfa;
}

.tag.yellow {
  color: #a16207;
  background: #fefce8;
}

.tag.gray {
  color: #374151;
  background: #f3f4f6;
}

.tag.dark {
  color: #fff;
  background: var(--sidebar);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.tab-btn {
  padding: 10px 12px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tab-btn.active {
  color: #fff;
  background: var(--sidebar);
  border-color: var(--sidebar);
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.report-section {
  margin-top: 28px;
}

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
}

.report-section-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.report-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.full-table-card {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea,
.form-control,
.form-select {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

textarea {
  min-height: 100px;
  line-height: 1.45;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 155, 215, .12);
}

.input-group .form-control {
  min-width: 0;
}

.input-group .input-group-text {
  color: var(--muted);
  background: #f8fbfe;
  border-color: var(--line);
  border-radius: 12px;
}

.notice,
.alert {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  font-size: 14px;
}

.notice {
  color: #175cd3;
  background: #eff8ff;
  border: 1px solid #b9e6fe;
}

.alert.success {
  color: #087443;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.alert.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.alert.warning {
  color: #a16207;
  background: #fefce8;
  border: 1px solid #fde68a;
}

.btn.ghost {
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.btn.ghost:hover {
  color: var(--text);
  background: #f2f4f7;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: #f2f4f7;
}

.icon-btn.danger {
  color: var(--red);
}

.icon-btn.danger:hover {
  background: #fef2f2;
}

.icon-btn[disabled] {
  cursor: not-allowed;
  opacity: .4;
}

.icon-btn[disabled]:hover {
  background: transparent;
}

.compact-list {
  display: flex;
  flex-direction: column;
}

.compact-list-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.compact-list-row:last-child {
  border-bottom: 0;
}

.compact-list-row-form {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.compact-row-view {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compact-row-view .drag-handle {
  color: var(--muted);
  cursor: grab;
}

.compact-row-view .compact-col-color {
  min-width: 70px;
}

.compact-row-view .compact-col-label {
  flex: 1;
  min-width: 0;
}

.compact-row-view .url-truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.compact-row-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.compact-row-edit,
.compact-row-delete-confirm {
  margin-top: 10px;
}

.compact-row-delete-confirm {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inline-row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-row-form .row-actions {
  display: flex;
  gap: 8px;
}

.inline-row-form details {
  flex-basis: 100%;
}

.inline-row-form summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.inline-row-form textarea {
  width: 100%;
  margin-top: 6px;
}

.compact-list-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  color: #fff;
  background: var(--sidebar);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}

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

.toast.success {
  background: #087443;
}

.toast.error {
  background: #b91c1c;
}

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

.section-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-box {
  height: 300px;
}

.summary-device-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.summary-device-card .label {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.device-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 92px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 132px;
}

.device-pie {
  width: 100%;
  height: 100%;
  min-width: 0;
}

.device-pie canvas {
  max-width: 100%;
  max-height: 100%;
}

.device-legend {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.device-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.device-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.device-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ga4-device-card {
  min-width: 0;
  overflow: hidden;
}

.device-chart-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  height: 132px;
}

.device-chart-flex .device-pie {
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  min-width: 0;
}

.device-chart-flex .device-legend {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.insight-editor {
  min-width: 0;
  padding: 16px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.insight-note {
  margin-top: 14px;
  padding-top: 12px;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.insight-note p {
  margin: 0;
}

.insight-note p + p {
  margin-top: 6px;
}

.insight-inline-form {
  display: grid;
  gap: 10px;
}

/* Situasi Bulan Ini only: the insight box is the sole content of its own
   card directly under the Critical/Warning block, so the generic
   .insight-note top border/spacing (meant to separate it from other
   content stacked above it in the same card) would just read as a second,
   disconnected block. A subtle left border ties it to the narrative above
   without looking like a third alert level. */
.insight-note-card .insight-note {
  margin-top: 0;
  padding-top: 0;
  padding-left: 12px;
  border-top: 0;
  border-left: 2px solid var(--line);
}

.insight-inline-form .section-head {
  margin-bottom: 0;
}

.insight-inline-form textarea {
  min-height: 76px;
}

.url {
  color: var(--primary-700);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar .control {
  min-width: 180px;
}

.report-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
}

.report-toolbar-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.report-toolbar-actions {
  display: grid;
  gap: 12px;
  align-content: end;
  min-width: 330px;
}

.action-group {
  display: grid;
  gap: 7px;
}

.action-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.btns.compact {
  gap: 8px;
}

.btn.small {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .report-toolbar-actions {
    min-width: 0;
  }
}

@media (max-width: 780px) {
  .report-toolbar-fields {
    grid-template-columns: 1fr;
  }
}

.footer-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-top: 18px;
  background: rgba(245, 248, 251, .96);
  border-top: 1px solid var(--line);
}

.small {
  color: var(--muted);
  font-size: 12px;
}

.auth-wrap {
  display: grid;
  min-height: 100vh;
  padding: 22px;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(27, 155, 215, .16), transparent 28%),
    linear-gradient(135deg, #eef8ff, #f7fbff 48%, #eef5fb);
}

.login-box.auth-card,
.auth-card {
  width: min(430px, 100%);
}

.login-logo {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--sidebar);
  font-size: 28px;
}

.login-box .card {
  padding: 0;
  overflow: hidden;
}

.login-card-body {
  padding: 22px;
}

.auth-hint {
  margin: 14px 0 0;
  font-size: 12px;
}

.pdf-only {
  display: none;
}

@media print {
  .sidebar,
  .topbar,
  .footer-actions,
  .tabs,
  .btn,
  .no-print,
  .skip-links,
  .skip-link {
    display: none !important;
  }

  .pdf-only {
    display: block;
  }

  .app,
  .app-wrapper {
    display: block !important;
    height: auto !important;
  }

  .main,
  .app-main {
    display: block !important;
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }

  .card:has(table) {
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 18px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    break-inside: avoid;
  }

  .report-section-head,
  .metric-group-head,
  .section-head {
    break-after: avoid;
  }

  .tab,
  .report-section,
  .metric-group {
    display: block !important;
    margin-bottom: 18px;
  }

  /* Jangan pecah baris tabel di tengah halaman */
  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Sub-section (Winners, Losers, Kondisi Halaman Prioritas) tidak pecah
     jika masih muat di satu halaman */
  .report-subsection {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Untuk sub-section yang terlalu panjang (lebih dari ~20 baris), izinkan
     break tapi hanya antar baris, bukan di tengah header + baris pertama */
  .report-subsection-long {
    break-inside: auto;
  }

  .report-subsection-long thead {
    break-after: avoid;
  }

  /* Section besar dimulai di halaman baru; Kondisi Halaman Prioritas &
     Situasi Bulan Ini sengaja tidak masuk sini — biarkan mengalir dari
     Executive Summary. */
  .report-section-major {
    break-before: page;
  }

  body,
  .public-report-mode {
    background: #fff !important;
  }
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .form-grid,
  .page-monitor-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .footer-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-row {
    justify-content: flex-start;
  }

  .main {
    padding: 16px;
  }
}
