:root {
  --ink: #2a1721;
  --muted: #7d6370;
  --line: #ead2dc;
  --panel: #ffffff;
  --soft: #fff5f8;
  --soft-2: #f8e6ee;
  --brand: #d96b9a;
  --brand-dark: #b84f7f;
  --warn: #b66a1c;
  --bad: #ba415f;
  --good: #a55278;
  --shadow: 0 16px 40px rgba(42, 23, 33, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #fff3f7;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #4a2033;
  color: #fff7fa;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3c0d4;
  color: #4a2033;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: #f3c5d7;
  font-size: 13px;
}

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

.nav button {
  color: #fff0f6;
  background: transparent;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-box {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  gap: 10px;
  color: #f8d4e2;
  font-size: 14px;
}

.content {
  padding: 28px;
  overflow: auto;
  min-width: 0;
}

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

.topbar.compact {
  margin-bottom: 12px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.page-note {
  color: var(--muted);
  margin: 6px 0 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.btn {
  background: var(--brand);
  color: white;
  padding: 11px 15px;
  border-radius: 8px;
  font-weight: 700;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn.secondary {
  background: #f7e1ea;
  color: var(--ink);
}

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

.btn.ghost {
  background: transparent;
  color: #fff7fa;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

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

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

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

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

.metric {
  padding: 18px;
}

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

.metric-value {
  font-size: 32px;
  font-weight: 800;
}

.panel {
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table th {
  color: var(--muted);
  font-weight: 700;
}

.compact-table {
  font-size: 13px;
}

.compact-table th,
.compact-table td {
  padding: 10px 8px;
}

.insight-list,
.hint-list {
  display: grid;
  gap: 10px;
}

.insight-item,
.hint {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.insight-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.insight-item p {
  margin: 4px 0 0;
}

.insight-meta {
  display: grid;
  gap: 6px;
  align-content: start;
  justify-items: end;
}

.hint {
  color: var(--ink);
  line-height: 1.45;
}

.filters-grid {
  display: grid;
  grid-template-columns: 180px 220px minmax(220px, 1fr);
  gap: 12px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-2);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #f7e1ea;
  color: #8c3f65;
}

.status.warn {
  background: #fff0dc;
  color: #87510f;
}

.status.bad {
  background: #ffe0e9;
  color: #8e2446;
}

.status.good {
  background: #f6d8e5;
  color: #8c3f65;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 196, 218, 0.46), transparent 30%),
    linear-gradient(135deg, #4a2033 0%, #d96b9a 48%, #fff3f7 100%);
}

.login-card {
  width: min(100%, 440px);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

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

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

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

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

.field textarea {
  resize: vertical;
  min-height: 82px;
}

.store-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.item-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.item-card h3 {
  margin: 0;
  font-size: 17px;
}

.store-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
}

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

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

.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

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

.question.unanswered {
  border-color: #d96b9a;
  background: #fff8fb;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.question-title {
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

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

.segmented button {
  padding: 10px 6px;
  border-radius: 8px;
  background: var(--soft-2);
  color: var(--ink);
  font-weight: 700;
}

.segmented button.active {
  background: var(--brand);
  color: white;
}

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

.attachment {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  margin: 0;
  width: 116px;
}

.attachment img,
.attachment video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #f4d7e3;
}

.attachment figcaption {
  margin-top: 6px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-chip {
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
}

.evidence {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.evidence-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.score-ring {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  margin: 8px auto 16px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) var(--score), #f7e1ea 0);
}

.score-ring > div {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  font-size: 30px;
  font-weight: 900;
}

.report {
  display: grid;
  gap: 18px;
}

.report-header {
  background: #4a2033;
  color: white;
  border-radius: 8px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.report-header h1 {
  margin: 0;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
    padding: 18px;
  }

  .audit-layout,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-box {
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--soft);
  }

  .shell {
    min-height: 100dvh;
  }

  .sidebar {
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 12px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.08);
  }

  .user-box {
    margin-top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 14px;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-note {
    font-size: 14px;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar input,
  .toolbar .btn,
  .toolbar button {
    width: 100%;
    min-width: 0;
  }

  .btn {
    min-height: 44px;
    padding: 11px 14px;
  }

  .btn.small {
    min-height: 36px;
  }

  .login-screen {
    align-items: start;
    padding: 18px;
  }

  .login-card {
    margin-top: 32px;
    padding: 22px;
  }

  .login-card h1 {
    font-size: 25px;
  }

  .store-list {
    grid-template-columns: 1fr;
  }

  .metric,
  .panel,
  .item-card,
  .question {
    box-shadow: 0 10px 24px rgba(42, 23, 33, 0.08);
  }

  .metric-value {
    font-size: 28px;
  }

  .panel,
  .item-card,
  .question {
    padding: 14px;
  }

  .question-head {
    display: grid;
    gap: 8px;
  }

  .segmented.binary {
    grid-template-columns: 1fr;
  }

  .segmented button {
    min-height: 44px;
  }

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

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

  .attachment {
    width: 100%;
  }

  .score-ring {
    width: 118px;
    height: 118px;
  }

  .score-ring > div {
    width: 90px;
    height: 90px;
    font-size: 26px;
  }

  .report-header {
    padding: 16px;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .table th,
  .table td {
    padding: 10px;
  }

  .table td {
    max-width: 260px;
    white-space: normal;
  }

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

  .insight-meta {
    justify-items: start;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 12px;
  }

  .sidebar {
    padding: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .page-title {
    font-size: 22px;
  }

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

  .store-card-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .sidebar,
  .topbar .toolbar,
  .no-print {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel,
  .metric,
  .item-card {
    box-shadow: none;
  }
}
