:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #20242c;
  --muted: #667085;
  --line: #e4e8f0;
  --brand: #ad5968;
  --brand-dark: #823343;
  --brand-soft: #f9eef1;
  --accent: #2f787a;
  --dark: #202631;
  --shadow: 0 18px 50px rgba(32, 38, 49, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(173, 89, 104, 0.18);
}

button.danger {
  background: #9f3e4d;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: var(--brand-soft);
  color: var(--brand);
}

select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 800;
}

h2 {
  font-size: 19px;
  font-weight: 800;
}

p {
  margin-top: 7px;
  color: var(--muted);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  overflow: auto;
  padding: 24px 18px;
  background: var(--dark);
  color: #fff;
}

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

.brand__logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 21px;
  line-height: 1.15;
}

.brand span {
  margin-top: 5px;
  color: #d8dde7;
  font-size: 13px;
}

.menu {
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.menu__item {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  text-align: left;
  background: transparent;
  color: #d8dde7;
  border-radius: 10px;
}

.menu__item.active,
.menu__item:hover {
  background: rgba(173, 89, 104, 0.22);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.workspace {
  min-height: 100vh;
  margin-left: 268px;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-identity {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.panel-view {
  display: none;
  margin-top: 24px;
}

.panel-view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 16px;
}

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

.metric {
  min-height: 124px;
  padding: 22px;
}

.metric strong {
  display: block;
  font-size: 28px;
  color: var(--brand);
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-workbench,
.dashboard-health-panel,
.dashboard-growth-panel {
  margin-top: 18px;
}

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

.health-card {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.health-card span,
.health-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.health-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.health-card--ok {
  border-color: rgba(44, 133, 89, 0.22);
  background: linear-gradient(180deg, #fff, #f6fffa);
}

.health-card--ok strong {
  color: #2c8559;
}

.health-card--warn {
  border-color: rgba(156, 103, 35, 0.22);
  background: linear-gradient(180deg, #fff, #fffaf2);
}

.health-card--warn strong {
  color: #9c6723;
}

.health-card--risk {
  border-color: rgba(173, 89, 104, 0.28);
  background: linear-gradient(180deg, #fff, #fff6f8);
}

.health-card--risk strong {
  color: var(--brand);
}

.growth-list {
  display: grid;
  gap: 12px;
}

.growth-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 78px;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.growth-item strong,
.growth-item small {
  display: block;
}

.growth-item strong {
  color: var(--ink);
  font-size: 15px;
}

.growth-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.priority {
  height: 34px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.priority--p0 {
  background: #fff1f3;
  color: var(--brand);
}

.priority--p1 {
  background: #fff7e8;
  color: #9c6723;
}

.priority--ok {
  background: #effaf4;
  color: #2c8559;
}

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

.ops-card {
  min-height: 146px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 14px;
}

.ops-card strong,
.ops-card span {
  display: block;
}

.ops-card strong {
  color: var(--ink);
  font-size: 15px;
}

.ops-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ops-card b {
  color: var(--brand);
  font-size: 30px;
  line-height: 1;
}

.ops-card--ok b {
  color: #2c8559;
}

.ops-card--warn {
  border-color: rgba(173, 89, 104, 0.24);
  background: linear-gradient(180deg, #fff, #fff7f8);
}

.ops-card--muted b {
  color: var(--muted);
}

.panel {
  padding: 24px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.note {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

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

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.filters input,
.filters select {
  width: 100%;
}

.table-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.table-summary span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.insight-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.insight-card strong {
  color: var(--ink);
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.scenario {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.diff {
  margin-top: 8px;
}

.diff summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.diff pre {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input,
.login-card input,
.modal-field input,
.modal-field textarea,
.modal-field select {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.form-grid input,
.login-card input,
.modal-field input,
.modal-field select {
  height: 42px;
}

.modal-field textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

.table,
.list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.data-table .actions {
  min-width: 180px;
}

.muted-cell {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wrap-cell {
  display: block;
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}

.table-swatch {
  width: 54px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.trend-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.period-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.period-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.period-card span,
.period-card small {
  color: var(--muted);
}

.trend-row {
  display: grid;
  grid-template-columns: 58px minmax(120px, 1fr) 2fr;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

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

.trend-row__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.trend-row__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.45fr 0.45fr 1.25fr;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

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

.account-row {
  grid-template-columns: 1fr 0.9fr 0.55fr 0.55fr 1fr 1.35fr;
}

.user-row {
  grid-template-columns: 0.9fr 1.6fr 0.45fr 0.55fr 1fr 0.8fr;
}

.banner-row {
  cursor: grab;
}

.banner-row.dragging {
  opacity: 0.55;
}

.item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 128px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fbf8f7);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 15px;
}

.empty-state span {
  font-size: 13px;
}

.item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  min-width: 58px;
  justify-content: center;
  margin-top: 0 !important;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(114, 121, 133, 0.1);
  color: #596170 !important;
  font-size: 12px !important;
  font-weight: 700;
}

.status-pill--new {
  background: rgba(185, 105, 124, 0.13);
  color: var(--brand) !important;
}

.status-pill--processing {
  background: rgba(47, 111, 163, 0.12);
  color: #2f6fa3 !important;
}

.status-pill--resolved {
  background: rgba(44, 133, 89, 0.13);
  color: #2c8559 !important;
}

.status-pill--closed {
  background: rgba(74, 76, 84, 0.1);
  color: #4a4c54 !important;
}

.material-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: start;
}

.color-card-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: start;
}

.color-card-item__swatch {
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.scene-tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mini-swatches {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.mini-swatches i {
  display: block;
  width: 34px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-review {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
}

.upload-review .thumb {
  width: 120px;
  height: 96px;
}

.thumb {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--brand-soft);
}

.thumb--table {
  width: 64px;
  height: 52px;
  border-radius: 8px;
}

.thumb--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.item strong,
.item span {
  display: block;
}

.item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.actions button {
  height: 32px;
  padding: 0 12px;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}

.actions button:hover {
  box-shadow: none;
}

.actions button.danger {
  color: #9f3e4d;
  background: rgba(159, 62, 77, 0.09);
}

.danger-text {
  color: #9f3e4d !important;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 38, 49, 0.48);
  z-index: 20;
}

.modal-mask[hidden] {
  display: none;
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(32, 38, 49, 0.24);
}

.modal-card__head,
.modal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-card__footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-card__head strong {
  font-size: 18px;
}

.modal-card__close {
  height: 32px;
}

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

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

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 14px 40px rgba(32, 38, 49, 0.22);
  z-index: 30;
}

.toast[hidden] {
  display: none;
}

.admin-login {
  background: #f3f6fb;
}

.login-page {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(420px, 1fr);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 24px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background: var(--dark);
  color: #fff;
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-brand img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 24px;
}

.login-brand span {
  margin-top: 5px;
  color: #d8dde7;
  font-size: 14px;
}

.login-hero__copy {
  max-width: 460px;
}

.login-hero__copy h1 {
  font-size: 42px;
  line-height: 1.18;
  color: #fff;
}

.login-hero__copy p {
  margin-top: 18px;
  color: #d8dde7;
  font-size: 16px;
  line-height: 1.8;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(430px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(32, 38, 49, 0.12);
}

.login-card strong {
  display: block;
  font-size: 24px;
}

.login-card button {
  width: 100%;
  height: 44px;
  margin-top: 2px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-hint {
  min-height: 20px;
  color: var(--brand-dark);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .metrics,
  .health-grid,
  .ops-board,
  .insights,
  .period-list,
  .scenario-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .row {
    grid-template-columns: 1fr;
  }

  .trend-row {
    grid-template-columns: 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .workspace {
    margin-left: 0;
    padding: 16px;
  }

  .topbar,
  .panel__header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .health-grid,
  .ops-board,
  .insights,
  .period-list,
  .scenario-list,
  .form-grid,
  .filters,
  .material-item {
    grid-template-columns: 1fr;
  }

  .growth-item {
    grid-template-columns: 1fr;
  }

  .login-hero,
  .login-panel {
    padding: 24px;
  }

  .login-hero__copy h1 {
    font-size: 30px;
  }

  .login-card {
    padding: 24px;
  }
}
