:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --ink: #142832;
  --muted: #58707d;
  --line: #cfdae1;
  --nav: #12323c;
  --nav2: #1e4f5d;
  --red: #e84d43;
  --green: #168a68;
  --amber: #d88918;
  --blue: #247aa8;
  --soft-red: #fff0ef;
  --soft-green: #e8f7f1;
  --soft-amber: #fff5df;
  --shadow: 0 7px 20px rgba(28, 61, 76, .08);
  --radius: 7px;
}

html,
body {
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

.main {
  background: var(--bg);
}

.sidebar {
  background: var(--nav);
  box-shadow: 5px 0 18px rgba(15, 47, 57, .12);
}

.brand {
  min-height: 64px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--red);
  box-shadow: 0 5px 14px rgba(232, 77, 67, .28);
  font-size: 13px;
}

.brand strong {
  font-size: 15px;
}

.brand span,
.storage-status {
  font-size: 11px;
}

.nav-section-label {
  color: #8fb2bd;
  font-size: 10px;
}

.nav-item {
  min-height: 44px;
  color: #bfd1d7;
  font-size: 14px;
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .09);
}

.nav-item.active {
  background: #2b5866;
  box-shadow: inset 4px 0 var(--red), 0 4px 12px rgba(4, 27, 34, .15);
}

.nav-item b {
  background: #3f6975;
  color: #fff;
  font-size: 11px;
}

.topbar {
  min-height: 80px;
  background: #fff;
  border-bottom-color: #cbd8e0;
  box-shadow: 0 4px 16px rgba(37, 68, 82, .06);
}

.page-heading h1 {
  font-size: 22px;
}

.page-heading span,
.eyebrow {
  color: #577381;
  font-size: 11px;
}

.view {
  padding-top: 25px;
}

.panel,
.metric,
.mini-metric,
.result-card,
.score-decision-box {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.panel-head {
  background: #fbfdff;
}

.panel h2,
.panel-head h2 {
  font-size: 17px;
}

.search,
select,
input,
textarea {
  border-color: #c7d5dd;
  color: var(--ink);
}

.search {
  min-height: 40px;
  background: #f7fafc;
}

.search input,
input,
select,
textarea {
  font-size: 13px;
}

input:focus,
select:focus,
textarea:focus,
.search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 122, 168, .12);
  outline: 0;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn {
  min-height: 40px;
  font-size: 13px;
}

.primary-btn {
  background: var(--red);
  box-shadow: 0 5px 13px rgba(232, 77, 67, .22);
}

.primary-btn:hover {
  background: #d93d35;
}

.secondary-btn:hover,
.icon-btn:hover {
  border-color: #8fb1c1;
  background: #f0f7fa;
  color: var(--blue);
}

.segmented {
  background: #e5edf2;
}

.segmented button {
  min-height: 33px;
  color: #526b78;
  font-size: 12px;
}

.segmented button.active {
  color: #126b93;
  box-shadow: 0 2px 7px rgba(33, 90, 118, .12);
}

.sycm-time-options button {
  min-width: 52px;
  white-space: nowrap;
}

.metric,
.role-kpi,
.market-auto-summary article,
.category-auto-summary article {
  position: relative;
  background: #fff;
}

.metric:nth-child(4n+1),
.role-kpi:nth-child(4n+1),
.market-auto-summary article:nth-child(4n+1),
.category-auto-summary article:nth-child(4n+1) {
  box-shadow: inset 0 3px var(--red);
}

.metric:nth-child(4n+2),
.role-kpi:nth-child(4n+2),
.market-auto-summary article:nth-child(4n+2),
.category-auto-summary article:nth-child(4n+2) {
  box-shadow: inset 0 3px var(--blue);
}

.metric:nth-child(4n+3),
.role-kpi:nth-child(4n+3),
.market-auto-summary article:nth-child(4n+3),
.category-auto-summary article:nth-child(4n+3) {
  box-shadow: inset 0 3px var(--green);
}

.metric:nth-child(4n),
.role-kpi:nth-child(4n),
.market-auto-summary article:nth-child(4n),
.category-auto-summary article:nth-child(4n) {
  box-shadow: inset 0 3px var(--amber);
}

.metric-label,
.role-kpi span,
.market-auto-summary span,
.category-auto-summary span,
.mini-metric span,
.result-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric > strong {
  font-size: 28px;
}

.role-kpi strong,
.market-auto-summary strong,
.category-auto-summary strong {
  font-size: 25px;
}

small,
.role-kpi small,
.market-auto-summary small,
.category-auto-summary small,
.date-chip,
.status-chip,
.badge,
.category-role,
.legend {
  font-size: 11px !important;
}

table {
  font-size: 12px;
}

.global-search {
  position: relative;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(440px, 78vw);
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #cdd9e3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(21, 55, 72, .18);
  z-index: 120;
}

.global-search-results button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #18313d;
  text-align: left;
  cursor: pointer;
}

.global-search-results button:hover,
.global-search-results button:focus-visible {
  background: #eaf6f3;
  outline: none;
}

.global-search-results button strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.global-search-results button span,
.global-search-empty {
  color: #627985;
  font-size: 12px;
}

.global-search-empty {
  padding: 16px 12px;
}

th {
  padding: 13px 14px;
  background: #edf4f7;
  color: #4f6875;
  font-size: 12px;
}

td {
  padding: 14px;
  font-size: 12px;
}

tbody tr:hover {
  background: #f1f8fa;
}

.attention-bar {
  background: #fff7e7;
  border-color: #edcc8d;
}

.role-data-status,
.dashboard-auto-strip,
.market-source-band,
.category-source-band {
  font-size: 12px;
}

.role-data-status[data-state="real"],
.dashboard-auto-strip {
  border-color: #77c7aa;
  background: #eaf8f2;
}

.market-auto-state.success,
.category-auto-state.success,
.competition-state.success {
  background: var(--soft-green);
  color: var(--green);
}

.market-keywords span,
.market-filter-options button.active {
  background: #e9f4fb;
  color: #126b93;
}

.category-bubble,
.role-category-bubble,
.bubble {
  box-shadow: 0 5px 14px rgba(26, 59, 73, .2);
}

.category-bubble {
  overflow: hidden;
  padding: 5px;
  font-size: 9px !important;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
}

.bubble {
  width: 34px;
  height: 34px;
  overflow: hidden;
  padding: 0;
  font-size: 9px !important;
  line-height: 1;
}

.modal {
  border: 1px solid #c7d5dd;
  box-shadow: 0 24px 64px rgba(21, 48, 60, .26);
}

.modal-head h2 {
  font-size: 19px;
}

.toast {
  background: #153c48;
  font-size: 13px;
  box-shadow: 0 9px 26px rgba(18, 50, 60, .25);
}

@media (max-width: 760px) {
  .topbar {
    min-height: 70px;
  }

  .page-heading h1 {
    font-size: 18px;
  }

  .view {
    padding: 16px;
  }

  .sycm-time-options button {
    flex: 0 0 auto;
    min-width: 54px;
  }

  .sycm-time-options .sycm-shift {
    min-width: 36px;
  }

  .panel h2,
  .panel-head h2 {
    font-size: 16px;
  }

  .role-kpi strong,
  .market-auto-summary strong,
  .category-auto-summary strong {
    font-size: 21px;
  }
}
