:root {
  color-scheme: light;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #182321;
  --muted: #71807c;
  --line: #e3e9e6;
  --accent: #087d6c;
  --accent-dark: #066657;
  --accent-soft: #e6f4f0;
  --amber: #a36312;
  --amber-soft: #fff5e4;
  --red: #b33a36;
  --red-soft: #fff0ef;
  --shadow: 0 8px 28px rgba(18, 42, 36, 0.045);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 248px; flex: 0 0 248px; min-height: 100vh; display: flex; flex-direction: column;
  padding: 26px 17px 18px; background: #fbfcfb; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 43px 5px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 25px; height: 25px; display: flex; align-items: end; gap: 3px; padding: 4px; border-radius: 7px; background: var(--accent); }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: #e9fff8; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .75; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 10px; opacity: .86; }
.brand-name { font-size: 18px; font-weight: 760; letter-spacing: -.8px; }
.brand-name span { color: var(--accent); padding: 0 1px; }
.sidebar-label { padding: 0 9px; color: #87938f; font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.account-control { display: flex; align-items: center; gap: 9px; margin-top: 11px; padding: 10px 10px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px 6px rgba(16, 37, 31, .025); }
.account-icon { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.account-control select { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; font-weight: 650; text-overflow: ellipsis; }
.account-control select:disabled { opacity: .6; }
.account-meta { min-height: 19px; padding: 7px 9px 0; color: var(--muted); font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nav-label { margin: 35px 0 11px; }
.level-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: #5c6b66; text-align: left; font-size: 13px; cursor: pointer; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { background: #f0f5f3; color: var(--ink); }
.nav-item:active { transform: translateY(1px); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.nav-glyph { width: 18px; text-align: center; color: currentColor; font-size: 15px; }
.sidebar-spacer { flex: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 12px 8px 2px; color: var(--muted); font-size: 10px; border-top: 1px solid var(--line); }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: #37a77c; box-shadow: 0 0 0 3px #e3f5eb; }

.main-content { min-width: 0; flex: 1; padding: 0 34px 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 69px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #88948f; font-size: 11px; }
.breadcrumb strong { color: #42504b; font-weight: 650; }
.breadcrumb-separator { color: #bdc7c3; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.period-picker { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: #4b5955; }
.period-picker select { border: 0; outline: 0; appearance: none; padding-right: 2px; background: transparent; color: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.calendar-icon { color: var(--accent); font-size: 14px; }
.icon-button { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 19px; cursor: pointer; transition: background .16s ease, transform .22s ease; }
.icon-button:hover { background: var(--accent-soft); }
.icon-button.is-loading { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; padding: 30px 0 20px; }
.eyebrow { color: var(--accent); font: 700 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
h1 { margin: 6px 0 5px; font-size: clamp(23px, 2.7vw, 30px); line-height: 1.12; letter-spacing: -.055em; font-weight: 710; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.updated-label { padding-bottom: 3px; color: #8a9691; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.notice { display: flex; align-items: flex-start; gap: 11px; margin: 2px 0 18px; padding: 13px 15px; border: 1px solid #c5e4d9; border-radius: 9px; background: #edf8f3; color: #285c4d; font-size: 12px; line-height: 1.55; }
.notice::before { content: "i"; display: grid; place-items: center; flex: 0 0 17px; height: 17px; border-radius: 50%; background: #d2efe3; color: #176c56; font-size: 11px; font-weight: 800; }
.notice.error { border-color: #f1d1cc; background: #fff4f1; color: #873d36; }
.notice.error::before { content: "!"; background: #ffe1dc; color: var(--red); }
.notice[hidden] { display: none; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric-card { min-height: 106px; padding: 15px 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.metric-label { color: #74817c; font-size: 10px; font-weight: 650; }
.metric-value { overflow: hidden; margin-top: 10px; color: var(--ink); font-size: clamp(18px, 2vw, 23px); font-weight: 720; letter-spacing: -.055em; text-overflow: ellipsis; white-space: nowrap; }
.metric-foot { margin-top: 6px; color: #9aa49f; font-size: 9px; }

.data-section { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; }
.table-toolbar h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.table-caption { margin: 4px 0 0; color: #8b9692; font-size: 10px; }
.search-box { display: flex; align-items: center; gap: 7px; width: 190px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: #88948f; }
.search-box:focus-within { border-color: #93c9bb; box-shadow: 0 0 0 3px rgba(8, 125, 108, .08); }
.search-box > span { font-size: 18px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #a1aaa6; }
.table-filter-actions { display: flex; align-items: center; gap: 8px; }
.status-filter { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: #88948f; font-size: 9px; }
.status-filter select { border: 0; outline: 0; background: transparent; color: #52615b; font-size: 10px; font-weight: 650; cursor: pointer; }
.auto-refresh-picker { color: #71807c; }
.auto-refresh-picker > span { color: var(--accent); }
.table-frame { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 1050px; border-collapse: collapse; text-align: left; }
thead { background: #fafcfb; }
th { padding: 10px 12px; color: #7c8984; font-size: 9px; font-weight: 700; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td { padding: 12px; border-top: 1px solid #edf0ef; color: #384540; font-size: 10px; white-space: nowrap; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fbfdfc; }
.name-column { min-width: 210px; }
.actions-column { min-width: 190px; }
.entity-name { max-width: 280px; overflow: hidden; color: #24322e; font-size: 11px; font-weight: 650; text-overflow: ellipsis; }
.entity-id { margin-top: 4px; color: #99a39f; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.objective-label { display: block; margin-top: 3px; color: #8c9893; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 99px; background: #f0f3f2; color: #687570; font-size: 9px; font-weight: 650; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #a0aaa6; }
.status-pill.active { background: #e8f6ef; color: #22734f; }
.status-pill.active::before { background: #32a46f; }
.status-pill.paused { background: var(--amber-soft); color: #966011; }
.status-pill.paused::before { background: #d39835; }
.status-pill.issue { background: var(--red-soft); color: #a6443e; }
.status-pill.issue::before { background: #ce5b51; }
.currency-value, .numeric-value { font-variant-numeric: tabular-nums; }
.budget-sub { display: block; margin-top: 3px; color: #98a29e; font-size: 9px; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.small-button { padding: 6px 8px; border: 1px solid #dce5e1; border-radius: 6px; background: #fff; color: #52615b; font-size: 9px; font-weight: 650; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.small-button:hover:not(:disabled) { border-color: #99cfc0; background: #f2faf7; color: var(--accent-dark); }
.small-button.primary-action { border-color: #c1e0d7; background: #f1f9f6; color: var(--accent-dark); }
.small-button:disabled { opacity: .45; cursor: not-allowed; }
.table-state { height: 110px; color: #8d9893; text-align: center; }
.empty-state { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 35px 15px; color: #64716c; font-size: 11px; }
.empty-state[hidden] { display: none; }
.empty-state strong { color: #34423d; font-size: 12px; }
.empty-symbol { margin-bottom: 2px; color: #98beb1; font-size: 24px; }
.table-note { padding: 10px 16px; border-top: 1px solid #edf0ef; color: #909b96; font-size: 9px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 3px 0; color: #9aa49f; font-size: 9px; }

.meta-connect-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 0 0 17px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.meta-connect-copy { min-width: 0; flex: 1; }
.meta-connect-copy h2 { margin: 5px 0 4px; font-size: 13px; font-weight: 700; }
.meta-connect-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.meta-connect-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.connect-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 8px 12px; border: 1px solid #c1e0d7; border-radius: 7px; background: var(--accent); color: #fff; text-decoration: none; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.connect-button:hover:not(.is-disabled) { background: var(--accent-dark); }
.connect-button.is-disabled { border-color: var(--line); background: #eef1f0; color: #98a29e; pointer-events: none; }
.secondary-button { border-color: #dce5e1; background: #fff; color: #52615b; }
.secondary-button:hover { border-color: #99cfc0; background: #f2faf7; color: var(--accent-dark); }
.secondary-button[hidden], .meta-redirect-hint[hidden], .meta-pages-list[hidden] { display: none; }
.meta-permissions { margin-top: 8px; color: #71807c; font-size: 9px; line-height: 1.5; }
.meta-redirect-hint { overflow-wrap: anywhere; margin-top: 7px; color: #8a6a31; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.meta-pages-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.page-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; border: 1px solid #e1e9e5; border-radius: 6px; background: #fafcfb; color: #52615b; font-size: 9px; }
.page-chip strong { max-width: 220px; overflow: hidden; color: #34423d; text-overflow: ellipsis; }
.page-chip span { color: #87938f; }

@media (max-width: 1040px) {
  .sidebar { width: 218px; flex-basis: 218px; }
  .main-content { padding-right: 22px; padding-left: 22px; }
  .metric-strip { gap: 8px; }
  .metric-card { padding-right: 12px; padding-left: 12px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; padding: 14px 16px 11px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 14px 2px; }
  .sidebar-label { padding-left: 2px; }
  .account-control { margin-top: 7px; }
  .account-meta, .sidebar-foot { display: none; }
  .nav-label { margin: 16px 0 7px; }
  .level-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { justify-content: center; gap: 6px; padding: 9px 5px; font-size: 11px; }
  .sidebar-spacer { display: none; }
  .main-content { padding: 0 15px 20px; }
  .topbar { min-height: 56px; }
  .breadcrumb { font-size: 10px; }
  .period-picker { padding: 6px 7px; }
  .period-picker select { font-size: 10px; }
  .page-heading { padding-top: 23px; }
  .meta-connect-card { flex-direction: column; gap: 12px; padding: 14px; }
  .meta-connect-actions { justify-content: flex-start; }
  .updated-label { display: none; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 17px; }
  .metric-card { min-height: 94px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-filter-actions { width: 100%; }
  .status-filter { flex: 0 0 auto; }
  .search-box { width: 100%; }
  .page-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
