:root {
  --ink: #17202a;
  --muted: #687385;
  --line: #dfe4ea;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --nav: #111821;
  --blue: #2866d6;
  --green: #11845b;
  --amber: #bb6b00;
  --red: #be3d35;
  --cyan: #0f7896;
  --shadow: 0 18px 48px rgba(20, 29, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 24, 33, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 24, 33, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Avenir Next", "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover,
select:hover,
.nav-link:hover {
  border-color: rgba(40, 102, 214, 0.45);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #ecf2f8;
  background: var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #101820;
  background: #f1c84b;
  font-weight: 800;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.brand strong,
.brand small,
.release-card strong,
.release-card small {
  display: block;
}

.brand small,
.release-card small {
  color: #9ba9b9;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 34px;
}

.nav-link {
  color: #c9d4df;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
}

.nav-link.active,
.nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.release-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4fd08b;
  box-shadow: 0 0 0 5px rgba(79, 208, 139, 0.13);
}

.workspace {
  padding: 28px;
  min-width: 0;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  font-size: 20px;
}

.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 21px;
}

.metrics-grid,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.metric-card {
  min-height: 126px;
  padding: 18px;
  border-top: 5px solid var(--blue);
}

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

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 34px;
  line-height: 1;
}

.accent-green {
  border-top-color: var(--green);
}

.accent-amber {
  border-top-color: var(--amber);
}

.accent-red {
  border-top-color: var(--red);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  align-items: start;
  margin-bottom: 16px;
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact {
  padding-bottom: 12px;
}

select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
}

.level-chart {
  display: grid;
  grid-template-columns: repeat(20, minmax(8px, 1fr));
  align-items: end;
  gap: 5px;
  height: 104px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.chart-bar {
  position: relative;
  min-height: 24px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #2d7adf, #0d8d7c);
}

.chart-bar:nth-child(5n) {
  background: linear-gradient(180deg, #d99a1a, #be5f43);
}

.table-wrap {
  max-height: 472px;
  overflow: auto;
}

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

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #edf4ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #244065;
  background: #e9f1ff;
  font-size: 12px;
  font-weight: 800;
}

.pill.success {
  color: #115f43;
  background: #e5f7ef;
}

.pill.danger {
  color: #92312d;
  background: #ffe8e5;
}

.phone-preview {
  position: relative;
  width: min(100%, 258px);
  aspect-ratio: 9 / 16;
  margin: 18px auto;
  overflow: hidden;
  border: 6px solid #101820;
  border-radius: 24px;
  background: #7fc8dd;
}

.phone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 30px 18px 20px;
  color: white;
  background: linear-gradient(180deg, rgba(9, 39, 56, 0.18), rgba(9, 39, 56, 0.06));
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.28);
}

.phone-overlay > span {
  font-size: 22px;
  font-weight: 900;
}

.preview-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 78%;
  margin-top: 74px;
}

.preview-tiles img {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 8px;
  background: #fff8df;
  border: 2px solid rgba(117, 89, 37, 0.2);
  padding: 4px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16);
}

.slot-preview {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  width: 86%;
  margin-top: 56px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(17, 24, 33, 0.72);
}

.slot-preview i {
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
}

.detail-list {
  display: grid;
  gap: 9px;
  padding: 0 18px 18px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.status-list,
.asset-grid,
.prop-grid {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.status-item,
.asset-item,
.prop-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.status-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.status-item strong,
.asset-item strong,
.prop-item strong {
  display: block;
  margin-bottom: 4px;
}

.status-item small,
.asset-item small,
.prop-item small {
  color: var(--muted);
}

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

.asset-item {
  padding: 14px;
}

.asset-strip {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.asset-strip img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

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

.prop-item {
  padding: 16px;
  border-left: 5px solid var(--cyan);
}

.prop-item:nth-child(2) {
  border-left-color: var(--amber);
}

.prop-item:nth-child(3) {
  border-left-color: var(--red);
}

.prop-value {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
}

textarea {
  width: calc(100% - 36px);
  min-height: 184px;
  margin: 18px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfd;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 102, 214, 0.12);
}

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

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

  .release-card {
    position: static;
    margin-top: 22px;
  }

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

  .dashboard-grid,
  .dashboard-grid.secondary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .workspace {
    padding: 18px;
  }

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

  .top-actions,
  .toolbar {
    width: 100%;
  }

  .search-box {
    min-width: 0;
    flex: 1;
  }

  .metrics-grid,
  .asset-grid,
  .prop-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }
}
