:root {
  --bg: #f7f4f2;
  --surface: #ffffff;
  --surface-soft: #fcfaf9;
  --ink: #271f22;
  --muted: #7f7277;
  --subtle: #aa9ca1;
  --line: #ece4e6;
  --brand: #8d5565;
  --brand-deep: #673746;
  --brand-soft: #f7e8ed;
  --pink: #e4a8b8;
  --green: #3f7c65;
  --green-soft: #e7f4ee;
  --amber: #a66a2c;
  --amber-soft: #fff3df;
  --red: #a9404d;
  --red-soft: #fae9eb;
  --blue: #466c91;
  --blue-soft: #eaf1f8;
  --shadow: 0 18px 55px rgba(79, 48, 59, 0.09);
  --shadow-soft: 0 8px 26px rgba(79, 48, 59, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-width: 1120px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(141, 85, 101, 0.18);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: rgba(255, 255, 255, 0.72);
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(560px, 1.1fr) minmax(480px, 0.9fr);
  background: var(--surface);
}

.login-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 720px;
  overflow: hidden;
  padding: 72px;
  background:
    radial-gradient(circle at 72% 24%, rgba(242, 183, 199, 0.38), transparent 27%),
    linear-gradient(145deg, #6e3e4d 0%, #8f5968 58%, #a86d7c 100%);
}

.login-art::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.login-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.orbit-one {
  top: 80px;
  right: -150px;
  width: 520px;
  height: 520px;
}

.orbit-two {
  top: 170px;
  right: -55px;
  width: 330px;
  height: 330px;
}

.login-heart {
  position: absolute;
  top: 180px;
  right: 118px;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 70px rgba(52, 21, 31, 0.24);
  backdrop-filter: blur(15px);
}

.login-heart svg {
  width: 66px;
  fill: none;
  stroke: #fff6f8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-art-copy {
  position: relative;
  z-index: 1;
  max-width: 590px;
  color: #fff;
}

.login-art-copy h1 {
  margin: 6px 0 22px;
  font-size: clamp(46px, 4.8vw, 72px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.login-art-copy p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 60px 80px;
}

.login-card {
  width: min(410px, 100%);
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-lockup {
  margin-bottom: 76px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(141, 85, 101, 0.23);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 19px;
}

.brand-lockup strong,
.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.brand-lockup span,
.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-heading {
  margin-bottom: 36px;
}

.login-heading h2 {
  margin: 0 0 10px;
  font-size: 36px;
  letter-spacing: -0.04em;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field > span {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.page-toolbar input,
.page-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input {
  height: 52px;
  padding: 0 16px;
}

.field textarea {
  min-height: 130px;
  padding: 14px 16px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.page-toolbar input:focus,
.page-toolbar select:focus {
  border-color: rgba(141, 85, 101, 0.52);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(141, 85, 101, 0.08);
  outline: none;
}

.form-error {
  margin: -5px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  line-height: 1.45;
}

.login-help-row {
  display: flex;
  justify-content: flex-end;
  margin: -10px 0 14px;
}

.login-help-button {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.login-help-button:hover,
.login-help-button:focus-visible {
  text-decoration: underline;
}

.login-help-button:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(141, 85, 101, 0.16);
  outline-offset: 3px;
}

.login-help-message {
  margin: -5px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(141, 85, 101, 0.2);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 28px rgba(141, 85, 101, 0.2);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 14px 34px rgba(141, 85, 101, 0.28);
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button-danger {
  background: var(--red);
  color: #fff;
}

.button-small {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}

.button-large {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  font-size: 15px;
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.6;
}

.security-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border: 2px solid var(--green);
  border-radius: 50%;
}

.login-icp {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.login-icp a {
  color: var(--subtle);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.login-icp a:hover {
  color: var(--brand) !important;
}

.login-icp .icp-sep {
  color: var(--border);
  user-select: none;
}

.login-icp .icp-badge {
  flex-shrink: 0;
}

/* app view footer needs to span full width */
#appView > .login-icp {
  grid-column: 1 / -1;
}

.app-view {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 244px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  height: 88px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 20px 14px;
}

.nav-group-title {
  margin: 18px 12px 7px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.nav-group-title:first-child {
  margin-top: 2px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nav-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: #f2ecee;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.nav-item.active .nav-icon {
  background: #fff;
  box-shadow: 0 4px 12px rgba(90, 54, 65, 0.08);
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.admin-profile-copy {
  min-width: 0;
  flex: 1;
}

.admin-profile-copy strong,
.admin-profile-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-copy strong {
  font-size: 13px;
}

.admin-profile-copy span {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.workspace {
  min-height: 100vh;
  margin-left: 244px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 88px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  background: rgba(247, 244, 242, 0.9);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backend-status {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.backend-status.ready .status-light {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.backend-status.blocked .status-light {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.platform-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 8px 34px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  background: var(--surface-soft);
}

.segment {
  height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.segment.active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 3px 10px rgba(65, 39, 48, 0.08);
}

.platform-hint {
  margin-left: auto;
  color: var(--subtle);
  font-size: 11px;
}

.content {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 30px 34px 60px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero-card {
  position: relative;
  display: flex;
  min-height: 240px;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  background:
    radial-gradient(circle at 78% 35%, rgba(247, 202, 214, 0.34), transparent 25%),
    linear-gradient(128deg, #693b49, #905a69 58%, #a76e7d);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  top: -92px;
  right: -75px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.hero-card h2 {
  margin: 4px 0 12px;
  font-size: 35px;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.hero-card p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.hero-side {
  position: relative;
  z-index: 1;
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.hero-side span,
.hero-side small {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
}

.hero-side strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 38px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-card::after {
  position: absolute;
  top: -22px;
  right: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: "";
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin: 17px 0 5px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: var(--subtle);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 0;
}

.panel-heading h3 {
  margin: 0;
  font-size: 18px;
}

.panel-note,
.panel-footnote {
  color: var(--subtle);
  font-size: 11px;
}

.panel-footnote {
  margin: 0;
  padding: 10px 24px 20px;
  line-height: 1.6;
}

.trend-chart {
  display: flex;
  height: 220px;
  align-items: flex-end;
  gap: 16px;
  padding: 30px 28px 24px;
}

.trend-column {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trend-value {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.trend-bar-track {
  display: flex;
  width: 100%;
  height: 135px;
  align-items: flex-end;
  border-radius: 10px;
  background: #faf7f7;
}

.trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 10px;
  background: linear-gradient(to top, var(--brand), var(--pink));
}

.trend-label {
  color: var(--subtle);
  font-size: 10px;
}

.platform-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 22px 24px 8px;
}

.platform-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}

.platform-card span,
.platform-card small {
  display: block;
}

.platform-card span {
  color: var(--muted);
  font-size: 11px;
}

.platform-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 22px;
}

.platform-card small {
  color: var(--subtle);
  font-size: 10px;
}

.activity-list,
.pending-list {
  display: grid;
  gap: 1px;
  padding: 14px 24px 22px;
}

.activity-row,
.pending-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid #f3edef;
}

.activity-row:last-child,
.pending-row:last-child {
  border-bottom: 0;
}

.activity-row span,
.pending-row span {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.activity-row strong,
.pending-row strong {
  font-size: 16px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.search-box input {
  min-width: 0;
  height: 44px;
  flex: 1;
  border: 0;
  padding: 0 15px;
  background: transparent;
  outline: none;
}

.search-box button {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 17px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.page-toolbar select {
  width: auto;
  min-width: 150px;
  height: 44px;
  padding: 0 34px 0 13px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.truth-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  border: 1px solid #dceae4;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}

.truth-banner strong {
  flex: 0 0 auto;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  min-height: 350px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #f1ebed;
  padding: 14px 16px;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #fdfafb;
}

.data-table td {
  color: #4f4549;
}

.data-table td strong {
  color: var(--ink);
}

.user-cell,
.relationship-pair {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-copy strong,
.user-cell-copy span {
  display: block;
}

.user-cell-copy span {
  max-width: 210px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #f2edef;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.badge + .badge {
  margin-left: 4px;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.red {
  background: var(--red-soft);
  color: var(--red);
}

.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.table-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.table-action-group {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.muted {
  color: var(--subtle);
}

.monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  min-height: 350px;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.state-stack {
  max-width: 420px;
}

.state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.state-stack strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.state-stack p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.skeleton-table {
  width: 100%;
  padding: 18px;
}

.skeleton-line {
  height: 44px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f4eef0 25%, #fbf8f9 50%, #f4eef0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.pagination {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
}

.pagination span {
  margin-right: auto;
  color: var(--subtle);
  font-size: 11px;
}

.pagination button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.mini-stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.mini-stat {
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--surface);
}

.mini-stat span {
  color: var(--muted);
  font-size: 10px;
}

.mini-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.resource-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.resource-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
}

.resource-overview-card span {
  color: var(--muted);
  font-size: 11px;
}

.resource-overview-card strong {
  display: block;
  margin-top: 9px;
  font-size: 18px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.resource-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.resource-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.resource-card h3 {
  margin: 0;
  font-size: 14px;
}

.resource-card p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(42, 29, 34, 0.28);
  backdrop-filter: blur(3px);
}

.detail-drawer {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(610px, 52vw);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(65, 39, 48, 0.14);
  transform: translateX(105%);
  transition: transform 0.25s ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header,
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 24px 26px;
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.drawer-header h2,
.modal-header h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.drawer-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.drawer-body {
  padding: 24px 26px 50px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  border-radius: 20px;
  padding: 20px;
  background: var(--brand-soft);
}

.detail-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
}

.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-section {
  margin-top: 24px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: var(--surface-soft);
}

.detail-item span,
.detail-item strong {
  display: block;
}

.detail-item span {
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 10px;
}

.detail-item strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-stat {
  border-radius: 13px;
  padding: 13px;
  background: var(--surface-soft);
  text-align: center;
}

.detail-stat strong,
.detail-stat span {
  display: block;
}

.detail-stat strong {
  font-size: 19px;
}

.detail-stat span {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 9px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list-row {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
}

.detail-list-row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.detail-list-row p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.drawer-truth {
  margin-top: 20px;
  border-radius: 14px;
  padding: 13px 14px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  line-height: 1.65;
}

.modal-backdrop {
  display: grid;
  z-index: 110;
  place-items: center;
  padding: 30px;
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 60px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-body {
  padding: 22px 26px;
}

.modal-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 16px 26px 20px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 45px rgba(35, 25, 29, 0.24);
  font-size: 12px;
  line-height: 1.55;
}

.toast.error {
  background: var(--red);
}

@media (max-width: 1240px) {
  body {
    min-width: 980px;
  }

  .sidebar {
    width: 218px;
  }

  .workspace {
    margin-left: 218px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .platform-hint {
    display: none;
  }
}
