@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap");

:root {
  --vus-red: #f6042e;
  --vus-red-dark: #d00228;
  --vus-blue: #1a31b7;
  --vus-kryptonite: #a6fe5a;
  --vus-green: #00af84;
  --vus-indigo: #5250f9;
  --vus-deep-green: #085e55;
  --ink: #050505;
  --muted: #5f6470;
  --line: #e4e7ee;
  --line-strong: #d3d8e3;
  --panel: #ffffff;
  --bg: #ffffff;
  --blue: #1a31b7;
  --green: #00af84;
  --amber: #b7791f;
  --orange: #d65f1f;
  --danger: #c22828;
  --soft-red: #fff1f2;
  --soft-blue: #eef5ff;
  --soft-green: #eaf8f1;
  --soft-amber: #fff7e6;
  --shadow: 0 10px 28px rgba(5, 5, 5, 0.06);
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: #fff;
  color: #050505;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand strong {
  display: block;
  font-size: 16px;
  color: #050505;
}

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

.vus-logo {
  display: block;
  width: 190px;
  height: auto;
  object-fit: contain;
}

.report-hero .vus-logo {
  width: 260px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  border: 0;
  color: #050505;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav button:hover,
.nav button.active {
  background: var(--vus-red);
  color: #fff;
}

.role-switcher {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.role-switcher label,
.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.role-switcher label {
  color: #050505;
}

.role-switcher select,
.field input,
.field select,
.field textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
  color: var(--ink);
}

.role-switcher select {
  border-color: var(--line-strong);
  background: #fff;
  color: #050505;
}

.content {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar > .actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
  white-space: nowrap;
}

.topbar > .actions .sync-pill {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.page {
  padding: 14px 26px 48px;
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.card {
  padding: 16px;
}

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

.section-title h2 {
  margin: 0;
  font-size: 17px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.kpi {
  display: grid;
  gap: 8px;
  min-height: 114px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  font-size: 28px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.red {
  color: var(--danger);
  background: var(--soft-red);
}

.badge.green {
  color: var(--green);
  background: var(--soft-green);
}

.badge.blue {
  color: var(--blue);
  background: var(--soft-blue);
}

.badge.amber {
  color: var(--amber);
  background: var(--soft-amber);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
}

.btn:hover {
  border-color: #b9c5d8;
}

.btn.primary {
  background: var(--vus-red);
  border-color: var(--vus-red);
  color: #fff;
}

.brand-filter-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.brand-filter-band.compact {
  display: flex;
}

.date-filter-band {
  position: relative;
}

.dashboard-filter-row,
.workspace-filter-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.1fr) minmax(360px, 2fr);
  gap: 12px;
  align-items: end;
}

.dashboard-filter-row .brand-filter-band,
.workspace-filter-row .brand-filter-band,
.metric-history-filter-row .brand-filter-band {
  box-shadow: none;
  padding: 0;
  border: 0;
  align-items: end;
}

.dashboard-filter-row .date-range-picker,
.dashboard-filter-row .preset-select,
.workspace-filter-row .date-range-picker,
.workspace-filter-row .preset-select,
.metric-history-filter-row .date-range-picker,
.metric-history-filter-row .preset-select {
  flex: 1 1 0;
  min-width: 0;
}

.dashboard-filter-row .date-range-picker summary,
.dashboard-filter-row .preset-select select,
.workspace-filter-row .date-range-picker summary,
.workspace-filter-row .preset-select select,
.metric-history-filter-row .date-range-picker summary,
.metric-history-filter-row .preset-select select {
  width: 100%;
  min-width: 0;
}

.workspace-filter-row {
  margin-bottom: 14px;
}

.metric-history-filter-row {
  display: grid;
  grid-template-columns: minmax(360px, 2fr) minmax(220px, 1fr);
  align-items: end;
}

.filter-kicker {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.date-range-picker {
  position: relative;
}

.date-range-picker summary,
.preset-select select {
  min-width: 280px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--vus-blue);
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 700;
  list-style: none;
}

.date-range-picker summary::-webkit-details-marker {
  display: none;
}

.date-range-picker summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 12px;
}

.preset-select select {
  appearance: none;
  border-radius: 8px;
  min-width: 220px;
  background-image: linear-gradient(45deg, transparent 50%, var(--vus-blue) 50%), linear-gradient(135deg, var(--vus-blue) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.date-range-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 0;
  width: min(620px, calc(100vw - 72px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  padding: 22px;
}

.include-today {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 700;
}

.include-today input {
  width: 22px;
  height: 22px;
}

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

.date-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.filter-field {
  display: grid;
  gap: 7px;
}

.filter-field span {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
  color: #050505;
}

.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 10px;
  background: #fff;
  color: #050505;
  font-weight: 800;
}

.clickable-project {
  border: 0;
  background: transparent;
  color: var(--vus-blue);
  padding: 0;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.62);
  display: grid;
  place-items: center;
  padding: 24px;
}

.brief-modal {
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}

.brief-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.brief-modal-head h2 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
}

.modal-close {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-weight: 900;
}

.brief-modal-body {
  padding: 22px;
  display: grid;
  gap: 16px;
}

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

.brief-summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.brief-summary-item.full {
  grid-column: 1 / -1;
}

.brief-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.brief-summary-item strong,
.brief-summary-item p {
  margin: 0;
}

.btn.primary:hover {
  background: var(--vus-red-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa7bb;
}

.sync-pill.online .sync-dot {
  background: var(--green);
}

.sync-pill.error .sync-dot {
  background: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.metric-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.bar {
  height: 10px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar span.warn {
  background: var(--amber);
}

.bar span.danger {
  background: var(--danger);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

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

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

.deliverables-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.line-item {
  display: grid;
  grid-template-columns: 108px 150px 148px 108px 72px 104px 132px 38px;
  gap: 8px;
  align-items: end;
  min-width: 880px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
}

.line-item .field {
  min-width: 0;
}

.line-item .field label {
  font-size: 10px;
  white-space: nowrap;
}

.line-item input,
.line-item select {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 12px;
  line-height: 1.2;
}

.readonly-field input {
  color: var(--muted);
  background: #f8fafc;
}

.upload-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-panel p {
  margin: 4px 0 0;
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.summary-box {
  position: sticky;
  top: 88px;
}

.summary-number {
  font-size: 28px;
  font-weight: 900;
  margin: 8px 0;
}

.alert {
  border-left: 4px solid var(--amber);
  background: var(--soft-amber);
  padding: 12px;
  border-radius: 8px;
  color: #5f420d;
  margin-top: 12px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.lane {
  background: #eef2f7;
  border-radius: 8px;
  padding: 10px;
  min-height: 330px;
}

.lane h3 {
  font-size: 13px;
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
}

.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
}

.task-card strong {
  line-height: 1.25;
}

.suggestion {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.score-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #dce3ed 0);
  position: relative;
  font-weight: 900;
}

.score-ring::before {
  content: "";
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
}

.score-ring span {
  position: relative;
  color: var(--ink);
}

.heatmap {
  display: grid;
  grid-template-columns: 140px repeat(4, minmax(72px, 1fr));
  gap: 8px;
  align-items: center;
}

.heat-cell {
  border-radius: 8px;
  min-height: 42px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #122032;
}

.heat-cell.cool {
  background: #dff5ea;
}

.heat-cell.ok {
  background: #cde6ff;
}

.heat-cell.warm {
  background: #ffe2a8;
}

.heat-cell.hot {
  background: #ffc8c8;
}

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

.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 800;
}

.tabs button.active {
  background: var(--ink);
  color: #fff;
}

.empty {
  border: 1px dashed #bdc7d7;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.report-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  display: grid;
  gap: 22px;
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.07);
}

.report-hero {
  display: block;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.report-eyebrow,
.report-section-head span,
.axis-label,
.report-field span {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.report-eyebrow {
  color: var(--vus-blue);
  font-size: 13px;
  margin-bottom: 8px;
}

.report-hero h2 {
  margin: 0;
  max-width: none;
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
  color: #050505;
  white-space: nowrap;
}

.vus-lockup {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  min-width: 292px;
}

.vus-word {
  color: var(--vus-blue);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 76px;
  font-style: italic;
  line-height: 0.82;
  letter-spacing: 0;
  position: relative;
}

.vus-word::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -9px;
  width: 115px;
  height: 14px;
  background: var(--vus-red);
  border-radius: 50%;
  transform: skewX(-24deg);
}

.vus-name {
  display: grid;
  align-content: center;
  gap: 4px;
}

.vus-name b {
  display: block;
  background: var(--vus-red);
  color: #fff;
  font-size: 22px;
  line-height: 1.05;
  padding: 4px 10px;
  font-weight: 900;
}

.report-filter-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.campaign-filter-box {
  display: grid;
  grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
}

.campaign-filter-box .filter-kicker {
  grid-column: 1 / -1;
}

.campaign-filter-date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.78fr);
  gap: 10px;
  min-width: 0;
}

.campaign-filter-date .date-range-picker summary,
.campaign-filter-date .preset-select select {
  width: 100%;
  min-width: 0;
}

.report-date-filter {
  display: flex;
  flex: 2 1 460px;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.report-field {
  display: grid;
  flex: 1 1 150px;
  gap: 7px;
  min-width: 0;
}

.report-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-field input,
.report-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.report-date-filter .date-range-picker,
.report-date-filter .preset-select {
  flex: 1 1 220px;
  min-width: 0;
}

.report-date-filter .date-range-picker summary,
.report-date-filter .preset-select select {
  width: 100%;
  min-width: 0;
}

.report-reset {
  flex: 0 0 110px;
}

.revision-comment-field {
  display: grid;
  gap: 7px;
}

.revision-comment-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-comment {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

.revision-targets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 13px;
}

.revision-targets > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.revision-targets label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-editor {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.campaign-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.campaign-metric-row span {
  display: grid;
  gap: 3px;
  font-size: 13px;
}

.campaign-metric-row b,
.campaign-metric-row small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.campaign-metric-row input,
.table-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
}

.campaign-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
}

.campaign-submit-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.campaign-performance-grid,
.campaign-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.campaign-performance-card,
.campaign-review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

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

.campaign-performance-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.campaign-performance-head span:not(.badge) {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.campaign-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.campaign-meta-grid span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 9px 10px;
}

.campaign-meta-grid b {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.kpi-preview-list,
.campaign-kpi-set-list {
  display: grid;
  gap: 8px;
}

.kpi-preview-list div,
.campaign-kpi-set-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 0;
}

.kpi-preview-list span,
.campaign-kpi-set-list span {
  color: var(--muted);
  font-size: 12px;
}

.campaign-review-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

.empty.compact {
  padding: 12px;
}

.campaign-kpi-modal {
  width: min(1080px, 96vw);
}

.campaign-kpi-grid-modal {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.campaign-kpi-grid-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.campaign-kpi-grid-cell > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.campaign-kpi-grid-cell > strong {
  line-height: 1.35;
}

.campaign-kpi-values {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
}

.campaign-kpi-values small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.metric-change-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}

.metric-adjust-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.metric-edit-filter {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric-change-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.metric-current-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.metric-current-grid span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: #f8fafc;
}

.metric-current-grid b {
  color: var(--ink);
  font-size: 20px;
}

.metric-change-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-change-grid input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 13px;
}

.metric-delta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.report-reset {
  min-height: 42px;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.report-kpi {
  min-height: 164px;
  border-radius: 8px;
  padding: 20px;
  display: grid;
  align-content: space-between;
  color: #fff;
}

.report-kpi span,
.report-kpi small {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
}

.report-kpi span {
  font-size: 13px;
}

.report-kpi strong {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

.report-kpi small {
  font-size: 13px;
}

.report-kpi.red {
  background: var(--vus-red);
}

.report-kpi.blue {
  background: var(--vus-blue);
}

.report-kpi.green {
  background: var(--vus-kryptonite);
  color: var(--vus-deep-green);
}

.report-kpi.indigo {
  background: var(--vus-indigo);
}

.report-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 16px;
}

.report-section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.report-section-head span {
  color: var(--vus-red);
  font-size: 12px;
}

.report-section-head h3 {
  margin: 4px 0 0;
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
  color: #060606;
}

.report-section-head strong {
  background: var(--vus-blue);
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
}

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

.axis-panel {
  border-radius: 8px;
  padding: 18px;
  min-height: 280px;
  display: grid;
  align-content: space-between;
  gap: 14px;
}

.axis-panel.performance {
  background: var(--vus-red);
  color: #fff;
}

.axis-panel.productivity {
  background: var(--vus-blue);
  color: #fff;
}

.axis-panel.workload {
  background: var(--vus-kryptonite);
  color: var(--vus-deep-green);
}

.axis-panel strong {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 76px;
  line-height: 0.9;
}

.axis-label {
  font-size: 13px;
}

.axis-meter {
  height: 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid currentColor;
  border-radius: 999px;
  overflow: hidden;
}

.axis-meter span {
  display: block;
  height: 100%;
  background: currentColor;
}

.axis-line,
.mini-axis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  font-weight: 900;
}

.axis-line span {
  opacity: 0.86;
}

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

.stage-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.stage-bar {
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.stage-bar span {
  display: block;
  height: 100%;
}

.stage-bar .green {
  background: var(--vus-kryptonite);
}

.stage-bar .blue {
  background: var(--vus-blue);
}

.stage-bar .amber {
  background: #fedb00;
}

.stage-bar .red {
  background: var(--vus-red);
}

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

.member-report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fff;
}

.member-report-card h4 {
  margin: 3px 0 0;
  font-size: 17px;
}

.member-report-card > strong {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 48px;
  color: var(--vus-red);
}

.member-report-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-axis {
  grid-template-columns: 96px minmax(0, 1fr) 32px;
  font-size: 12px;
}

.mini-axis div {
  height: 8px;
  background: #eef1f6;
  border-radius: 999px;
  overflow: hidden;
}

.mini-axis i {
  display: block;
  height: 100%;
  background: var(--vus-blue);
}

.report-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table th {
  background: #f7f8fb;
  color: var(--muted);
}

.report-table td {
  border-bottom-color: var(--line);
}

.report-admin-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.report-subnav {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  background: #f4f6fa;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.report-subnav button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  min-height: 36px;
  padding: 8px 16px;
  color: var(--muted);
  font-weight: 800;
}

.report-subnav button.active {
  background: #fff;
  color: var(--vus-blue);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

/* ============================================================
   Product multi-select — dropdown trigger + panel
   ============================================================ */
.product-multi-field {
  position: relative;
}
.product-multi-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  margin-top: 7px;
  transition: border-color 0.15s;
  user-select: none;
}
.product-multi-trigger:hover {
  border-color: var(--vus-red);
}
.product-multi-trigger.is-open {
  border-color: var(--vus-red);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.product-multi-summary {
  font-weight: 600;
  color: var(--ink);
}
.product-multi-caret {
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.15s;
}
.product-multi-trigger.is-open .product-multi-caret {
  transform: rotate(180deg);
}
.product-multi-panel {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--vus-red);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.product-multi-panel-head {
  padding: 4px 10px;
  background: #fff7e6;
  border-bottom: 1px solid var(--line);
}
.product-multi-panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px;
  gap: 2px;
}
.product-multi-panel-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  text-align: right;
  background: #fafafa;
}
.product-multi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
  user-select: none;
}
.product-multi-row:hover:not(.is-disabled) {
  background: #f5f7fa;
}
.product-multi-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.product-multi-row-all {
  font-weight: 700;
  padding: 6px 10px;
}
.product-multi-row input[type=checkbox] {
  display: none;
}
.product-multi-check {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.product-multi-row input[type=checkbox]:checked + .product-multi-check {
  background: var(--vus-red);
  border-color: var(--vus-red);
}
.product-multi-row input[type=checkbox]:checked + .product-multi-check::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.product-multi-label {
  flex: 1;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   AI features — banner, AI cards, fallback styling
   ============================================================ */
.ai-banner-global {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 16px;
  margin: 12px 24px 0;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ai-banner-global.over {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.ai-banner-global a {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}

.ai-suggest-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.ai-suggest-banner.warn {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.ai-card {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}
.ai-card .ai-section {
  margin: 8px 0;
  font-size: 12.5px;
  color: #374151;
  line-height: 1.5;
}
.ai-card .ai-section strong {
  display: block;
  color: var(--vus-red);
  font-size: 11.5px;
  margin-bottom: 3px;
}

.ai-summary-card {
  background: linear-gradient(135deg, #fafbff 0%, #ecfdf5 100%);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ai-summary-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--vus-red);
  letter-spacing: 0.4px;
}
.ai-summary-card .ai-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.ai-summary-card ul {
  margin: 6px 0 12px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}
.ai-summary-card .ai-section-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-top: 8px;
  display: block;
}
.ai-summary-card .ai-section-label.green { color: var(--green); }
.ai-summary-card .ai-section-label.amber { color: var(--amber); }
.ai-summary-card .ai-section-label.red { color: var(--vus-red); }
.ai-summary-card .ai-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}

/* ============================================================
   Compact layout cho laptop 13"-14" (1024 - 1440px)
   Mục tiêu: hiển thị full UI mà không cần zoom 80% trên MacBook 13"
   ============================================================ */
@media (min-width: 1021px) and (max-width: 1440px) {
  /* Sidebar gọn lại */
  .app {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .sidebar {
    padding: 16px 12px;
  }
  .brand {
    gap: 9px;
    margin-bottom: 18px;
  }
  .brand strong { font-size: 14px; }
  .brand span { font-size: 11px; }
  .vus-logo { width: 150px; }

  .nav {
    gap: 5px;
  }
  .nav button {
    padding: 8px 10px;
    font-size: 13px;
  }
  .role-switcher {
    margin-top: 18px;
    padding-top: 14px;
  }
  .role-switcher label,
  .field label { font-size: 11px; }
  .role-switcher select,
  .field input,
  .field select,
  .field textarea {
    margin-top: 5px;
    padding: 7px 9px;
    font-size: 13px;
  }

  /* Top bar */
  .topbar {
    padding: 12px 18px;
    gap: 12px;
  }
  .topbar h1 { font-size: 18px; }
  .topbar p { font-size: 12px; margin-top: 2px; }

  /* Page */
  .page {
    padding: 16px 18px 32px;
    gap: 14px;
  }
  .grid { gap: 12px; }

  /* Panel + card */
  .panel { padding: 14px; }
  .card { padding: 12px; }
  .section-title {
    margin-bottom: 10px;
    gap: 10px;
  }
  .section-title h2 { font-size: 15px; }
  .section-title span { font-size: 12px; }

  /* KPI */
  .kpi {
    gap: 6px;
    min-height: 92px;
  }
  .kpi span { font-size: 12px; }
  .kpi strong { font-size: 22px; }

  /* Buttons */
  .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
  }

  /* Badge */
  .badge {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 11px;
  }

  /* Filter bands */
  .brand-filter-band,
  .date-filter-band {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Form grid */
  .form-grid { gap: 10px; }

  /* Tables (workspace, reports, etc) */
  .table-wrap table { font-size: 12px; }
  .table-wrap th,
  .table-wrap td { padding: 8px 10px; }

  /* Modal brief */
  .brief-modal-head,
  .brief-modal-body { padding: 16px 18px; }
  .brief-modal-head h2 { font-size: 17px; }

  /* Section h3, h4 etc. — đa số font-size 16-22 trong các view khác */
  .vus-word { font-size: 40px !important; }
  .vus-name b { font-size: 14px !important; }
  .report-hero .vus-logo { width: 180px; }
  .report-kpi strong,
  .member-report-card > strong { font-size: 26px !important; }
  .axis-panel strong { font-size: 36px !important; }
}

/* Extra-compact cho < 1280px (MacBook 13" thực sự) */
@media (min-width: 1021px) and (max-width: 1280px) {
  .app {
    grid-template-columns: 208px minmax(0, 1fr);
  }
  .vus-logo { width: 130px; }
  .nav button { padding: 7px 9px; font-size: 12.5px; }
  .topbar h1 { font-size: 16px; }
  .topbar { padding: 10px 14px; }
  .page { padding: 14px 14px 28px; gap: 12px; }
  .panel { padding: 12px; }
  .section-title h2 { font-size: 14px; }
  .kpi strong { font-size: 20px; }
}

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

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

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

  .form-layout,
  .metric-adjust-layout,
  .metric-edit-filter,
  .metric-current-grid,
  .metric-change-grid,
  .report-hero,
  .report-main-grid,
  .report-kpi-grid,
  .report-member-grid,
  .campaign-performance-grid,
  .campaign-review-grid,
  .campaign-kpi-grid-modal,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .report-filter-band,
  .campaign-filter-box,
  .campaign-filter-date,
  .dashboard-filter-row,
  .workspace-filter-row,
  .metric-history-filter-row,
  .brand-filter-band,
  .axis-grid,
  .report-admin-row {
    grid-template-columns: 1fr;
  }

  .report-date-filter,
  .date-range-grid {
    grid-template-columns: 1fr;
  }

  .report-date-filter {
    flex-direction: column;
    align-items: stretch;
    flex-basis: 100%;
  }

  .report-field,
  .report-reset {
    flex: 1 1 100%;
  }

  .date-range-picker summary,
  .preset-select select {
    width: 100%;
    min-width: 0;
  }

  .vus-lockup {
    justify-self: start;
  }

  .summary-box {
    position: relative;
    top: auto;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .sidebar {
    padding: 16px 14px;
  }

  .brand {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .vus-logo {
    width: 142px;
  }

  .nav {
    grid-template-columns: 1fr;
    max-height: 40vh;
    overflow: auto;
    padding-right: 2px;
  }

  .nav button {
    min-height: 42px;
    padding: 9px 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 14px;
    position: relative;
  }

  .topbar h1 {
    font-size: 19px;
    line-height: 1.18;
  }

  .topbar .actions {
    width: 100%;
  }

  .topbar .actions .btn,
  .topbar .actions .sync-pill {
    flex: 1 1 auto;
    justify-content: center;
  }

  .page {
    padding: 18px 14px 36px;
    gap: 14px;
  }

  .panel,
  .card {
    padding: 14px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title .actions,
  .actions {
    width: 100%;
  }

  .actions select,
  .actions .btn {
    flex: 1 1 100%;
  }

  .kpi {
    min-height: auto;
  }

  .kpi strong {
    font-size: 24px;
  }

  .form-grid,
  .line-item {
    grid-template-columns: 1fr;
  }

  .deliverables-scroll .line-item {
    min-width: 0;
  }

  .line-item .btn {
    width: 100%;
  }

  .upload-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metric-row strong {
    justify-self: start;
  }

  .brand-filter-band,
  .report-filter-band,
  .campaign-filter-box,
  .dashboard-filter-row,
  .workspace-filter-row,
  .metric-history-filter-row {
    padding: 12px;
    gap: 10px;
  }

  .dashboard-filter-row,
  .workspace-filter-row,
  .metric-history-filter-row {
    padding: 0;
  }

  .date-range-picker,
  .preset-select,
  .report-field,
  .campaign-filter-date {
    width: 100%;
  }

  .date-range-picker summary,
  .preset-select select,
  .report-field input,
  .report-field select {
    min-height: 44px;
    min-width: 0;
    width: 100%;
  }

  .date-range-popover {
    left: 0;
    right: auto;
    width: min(92vw, 360px);
    padding: 16px;
  }

  .table-wrap {
    margin: 0 -2px;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .campaign-result-card {
    padding: 12px;
  }

  .campaign-performance-head {
    flex-direction: column;
  }

  .campaign-meta-grid,
  .kpi-preview-list div,
  .campaign-kpi-set-list div {
    grid-template-columns: 1fr;
  }

  .report-subnav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .heatmap {
    grid-template-columns: 112px repeat(4, 72px);
    overflow-x: auto;
  }

  .report-page {
    padding: 14px;
    border-width: 1px;
  }

  .report-hero h2 {
    font-size: 26px;
    white-space: normal;
  }

  .report-eyebrow {
    font-size: 12px;
  }

  .vus-word {
    font-size: 54px;
  }

  .vus-word::after {
    width: 82px;
  }

  .vus-name b {
    font-size: 16px;
  }

  .report-hero .vus-logo {
    width: 180px;
  }

  .report-kpi {
    min-height: 132px;
  }

  .report-kpi strong,
  .member-report-card > strong {
    font-size: 38px;
  }

  .axis-panel strong {
    font-size: 56px;
  }

  .brief-modal {
    width: 96vw;
  }

  .brief-modal-head,
  .brief-modal-body {
    padding: 16px;
  }

  .brief-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel,
  .card,
  .report-page {
    padding: 12px;
  }

  .date-range-popover {
    width: calc(100vw - 28px);
  }

  .btn,
  .role-switcher select,
  .field input,
  .field select,
  .field textarea {
    min-height: 42px;
  }
}

/* === Revision UX (Phase 3) === */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
.row-revision {
  background-color: #fef2f2 !important;
  border-left: 4px solid #dc2626;
}
.row-revision td {
  border-top: 1px solid #fecaca;
  border-bottom: 1px solid #fecaca;
}
.kpi.kpi-alert {
  transition: transform 0.2s;
}
.kpi.kpi-alert:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* === Toast levels (Tier 1 polish) === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  animation: toast-in 0.2s ease-out;
  max-width: 90vw;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-loading { background: #2563eb; }
.toast-info { background: #1f2937; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Disabled button khi đang xử lý */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
}

/* === Tier 2: Row flash khi realtime update === */
@keyframes flash-update {
  0% { background-color: #fef9c3; box-shadow: inset 0 0 0 2px #facc15; }
  100% { background-color: transparent; box-shadow: none; }
}
.row-flash {
  animation: flash-update 2s ease-out;
}
tr.row-flash td:first-child { position: relative; }
tr.row-flash td:first-child::before {
  content: "✨ mới cập nhật";
  position: absolute;
  top: 4px;
  right: 8px;
  background: #facc15;
  color: #78350f;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  animation: flash-update 2s ease-out;
}

/* === Tier 2: Notification bell === */
.notif-wrap { position: relative; }
.notif-bell {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  position: relative;
  transition: all 0.2s;
}
.notif-bell:hover { background: #f3f4f6; }
.notif-bell.has-new {
  animation: bell-shake 1s ease-in-out;
}
@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(-12deg); }
  20%, 40%, 60% { transform: rotate(12deg); }
  70% { transform: rotate(0); }
}
.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  animation: pulse 1.5s infinite;
}
.notif-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  z-index: 1000;
  padding: 12px;
}
.notif-panel-head {
  font-weight: 700;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 8px;
}
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  margin-bottom: 6px;
}
.notif-item.unread {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.notif-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
}

/* === Tier 2: Loading skeleton === */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton-bar, .skeleton-card {
  background: linear-gradient(90deg, #f3f4f6 0px, #e5e7eb 100px, #f3f4f6 200px);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite linear;
  border-radius: 6px;
}
.skeleton-bar {
  height: 16px;
  margin: 10px 0;
}
.skeleton-bar-lg {
  height: 28px;
  width: 40%;
  margin-bottom: 20px;
}
.skeleton-card {
  height: 100px;
  border-radius: 12px;
}

/* === Tier 3: Presence indicator === */
.presence-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 13px;
  cursor: default;
}
.presence-count {
  font-weight: 600;
  color: #166534;
  margin-right: 4px;
}
.presence-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  font-size: 11px;
  font-weight: 700;
  margin-left: -6px;
  border: 2px solid white;
  position: relative;
}
.presence-extra {
  background: #d1d5db;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: -2px;
}

/* ============================================================
   COMPACT DENSITY — Cảm giác như zoom 80% mặc định
   Giảm font + spacing + width cho mọi màn hình
   ============================================================ */

html {
  font-size: 14px; /* Base 16 → 14, kéo theo mọi em/rem giảm */
}

body {
  font-size: 13px;
  line-height: 1.45;
}

/* === Sidebar gọn hơn === */
.app {
  grid-template-columns: 220px minmax(0, 1fr);
}
.sidebar {
  padding: 16px 12px;
}
.vus-logo {
  width: 150px;
}
.brand strong { font-size: 14px; }
.brand span { font-size: 11px; }
.nav { gap: 4px; }
.nav a, .nav button {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* === Topbar gọn === */
.topbar {
  padding: 12px 20px !important;
}
.topbar h1 {
  font-size: 20px !important;
}
.topbar p {
  font-size: 12px !important;
  margin: 2px 0 0 !important;
}

/* === Panel padding nhỏ lại === */
.panel {
  padding: 16px !important;
  margin-bottom: 14px !important;
  border-radius: 10px !important;
}
.section-title h2 {
  font-size: 16px !important;
  margin: 0 0 4px !important;
}
.section-title span {
  font-size: 12px !important;
}

/* === KPI cards gọn === */
.kpi {
  padding: 12px 14px !important;
}
.kpi .label { font-size: 11px !important; }
.kpi .value { font-size: 22px !important; }
.kpi .trend { font-size: 11px !important; }

/* === Buttons + inputs gọn === */
.btn {
  padding: 8px 14px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}
.btn.small {
  padding: 5px 10px !important;
  font-size: 12px !important;
}
.field input, .field select, .field textarea {
  padding: 7px 10px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
}
.field label {
  font-size: 12px !important;
  margin-bottom: 4px !important;
}

/* === Table dense === */
table {
  font-size: 12px !important;
}
table th, table td {
  padding: 8px 10px !important;
}

/* === Badge nhỏ === */
.badge {
  font-size: 10px !important;
  padding: 2px 6px !important;
}

/* === Grid gap nhỏ === */
.grid {
  gap: 12px !important;
}

/* ============================================================
   DELIVERABLE LINE-ITEM — Cột nhỏ/lớn theo nội dung
   Thứ tự: Channel | Campaign | Product | Complexity | Qty | Size | Angle | X
   Field text dài (Campaign, Product, Angle) → rộng
   Field ngắn (Complexity, Qty, Size, X) → hẹp
   Nếu tổng vượt khung → scroll NGANG, không wrap xuống dòng
   ============================================================ */
.deliverables-scroll {
  overflow-x: auto !important;
  padding-bottom: 6px;
}
.line-item {
  grid-template-columns: 130px minmax(160px, 1.4fr) minmax(140px, 1.2fr) 100px 70px 90px minmax(160px, 1.6fr) 36px !important;
  min-width: 980px !important;
  gap: 8px !important;
  padding: 10px !important;
  align-items: end;
}
.line-item .field {
  min-width: 0;
}
.line-item .field label {
  font-size: 10px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-bottom: 3px !important;
}
.line-item input,
.line-item select {
  font-size: 12px !important;
  padding: 6px 8px !important;
  height: 32px;
  width: 100%;
}
.line-item .btn {
  padding: 0 !important;
  font-size: 13px !important;
  height: 32px;
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
}
.line-item .btn:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

/* Scrollbar style cho thanh ngang */
.deliverables-scroll::-webkit-scrollbar {
  height: 8px;
}
.deliverables-scroll::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}
.deliverables-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
.deliverables-scroll::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ============================================================
   PHASE 2 — Items Modal (Per-Item Delivery)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal-panel.items-modal {
  background: white;
  width: 92vw;
  max-width: 1280px;
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.items-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.items-modal .modal-head h2 {
  font-size: 18px !important;
}
.items-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}
.items-summary .badge {
  font-size: 12px !important;
  padding: 4px 10px !important;
}
.items-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0;
}
.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.items-table thead {
  position: sticky;
  top: 0;
  background: #f3f4f6;
  z-index: 10;
}
.items-table th {
  text-align: left;
  padding: 12px 14px !important;
  font-weight: 700;
  font-size: 12px !important;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}
.items-table td {
  padding: 12px 14px !important;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.items-table tr:hover td {
  background: #fafafa;
}
.items-table tr.row-revision td {
  background: #fef2f2;
  border-left: 3px solid #dc2626;
}
.items-progress {
  display: inline-block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

/* Responsive: màn hẹp scroll ngang */
@media (max-width: 900px) {
  .modal-panel.items-modal {
    width: 96vw;
    max-height: 92vh;
  }
  .items-table {
    min-width: 800px;
  }
}

/* === Phase 3 — Bulk approve bar + selected row === */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 13px;
  color: #1e40af;
}
.bulk-bar strong {
  font-weight: 700;
}
.bulk-actions {
  display: flex;
  gap: 8px;
}
.items-table tr.row-selected td {
  background: #dbeafe !important;
}
.items-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================================
   PHASE 3.5 — Feedback Modal + Thread
   ============================================================ */
.modal-panel.feedback-modal,
.modal-panel.thread-modal {
  background: white;
  width: 92vw;
  max-width: 680px;
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.feedback-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

/* Read-only thread bên trong feedback modal */
.feedback-thread-readonly {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}
.feedback-thread-readonly .thread-head {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

/* Thread entry */
.thread-entry {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: white;
  border-left: 3px solid #d1d5db;
}
.thread-entry.kind-revision {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.thread-entry.kind-reply {
  border-left-color: #2563eb;
  background: #eff6ff;
}
.thread-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.thread-meta strong {
  font-size: 12px;
  color: #111827;
}
.thread-meta .thread-kind {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
}
.thread-text {
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Snippet in items table cell */
.feedback-snippet {
  display: inline-block;
  color: #dc2626 !important;
  font-size: 11px;
  line-height: 1.4;
  max-width: 280px;
  word-break: break-word;
}
.thread-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: all 0.15s;
}
.thread-chip:hover {
  background: #c7d2fe;
  transform: translateY(-1px);
}

/* Textarea trong feedback modal */
.feedback-modal textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  resize: vertical;
  min-height: 120px;
}
.feedback-modal textarea:focus {
  outline: 2px solid #2563eb;
  outline-offset: -1px;
}

/* === Phase 5 — SLA badges + workspace alert === */
.badge.red {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.badge.amber {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge.green {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.badge.blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.badge.gray {
  background: #f9fafb;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Workspace alert KPI pulse */
.kpi.kpi-alert {
  animation: pulse 2s infinite;
}

/* === Phase 6 — Notification grouping === */
.notif-item.notif-group {
  border: 1px solid #c7d2fe;
  background: #eff6ff;
  cursor: pointer;
}
.notif-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.notif-count-pill {
  background: #3730a3;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.notif-sublist {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #c7d2fe;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notif-subitem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: white;
  border-radius: 6px;
  font-size: 12px;
}
.notif-subitem strong {
  font-size: 12px;
}

/* === Phase 7C — Deep link highlight === */
@keyframes deep-link-highlight {
  0%, 100% { background-color: #fef3c7; }
  50% { background-color: #fde68a; }
}
.items-table tr.row-highlight {
  animation: deep-link-highlight 1s ease-in-out 3;
  box-shadow: inset 4px 0 0 #f59e0b;
}

/* === Benchmark CMS table === */
.benchmarks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.benchmarks-table th,
.benchmarks-table td {
  padding: 8px 10px !important;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}
.benchmarks-table th {
  background: #f3f4f6;
  font-weight: 700;
  text-align: left;
}
.benchmarks-table tr:hover td {
  background: #fafafa;
}
.benchmarks-table input[type="text"],
.benchmarks-table input[type="number"],
.benchmarks-table select {
  padding: 4px 6px !important;
  font-size: 12px !important;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  height: 28px !important;
}
.benchmarks-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
