:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --panel-2: #eef4f2;
  --ink: #16201d;
  --muted: #64716d;
  --line: #dbe5e1;
  --line-strong: #cbd8d3;
  --accent: #2e7d68;
  --accent-strong: #18634f;
  --accent-soft: #e0f1ec;
  --blue: #3d6fa8;
  --amber: #9c6b1c;
  --danger: #b64c4c;
  --danger-soft: #fdeaea;
  --success: #237a55;
  --success-soft: #e4f4ec;
  --neutral-soft: #eef1f0;
  --shadow: 0 18px 48px rgba(26, 43, 37, 0.12);
  --radius: 8px;
  --sidebar: 220px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 247, 246, 0.96)),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #18231f;
  color: #f6faf8;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 4px 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12)),
    var(--accent);
  box-shadow: inset 0 -12px 22px rgba(24, 99, 79, 0.55);
}

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

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand span {
  margin-top: 3px;
  color: rgba(246, 250, 248, 0.62);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  color: rgba(246, 250, 248, 0.74);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item span:last-child {
  color: rgba(246, 250, 248, 0.55);
  font-variant-numeric: tabular-nums;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.nav-dot.all {
  background: #8fd2bd;
}

.nav-dot.image {
  background: #88aee4;
}

.nav-dot.design {
  background: #e4ba74;
}

.nav-dot.requirement {
  background: #c0d96d;
}

.storage-card {
  position: absolute;
  right: 16px;
  bottom: 18px;
  left: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.storage-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(246, 250, 248, 0.66);
  font-size: 13px;
}

.storage-row strong {
  color: #fff;
}

.meter {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: #8fd2bd;
  transition: width 180ms ease;
}

.workspace {
  min-width: 0;
  padding: 16px 22px 24px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

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

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 32vw);
  min-width: 220px;
  height: 36px;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(24, 35, 31, 0.03);
}

.search-field svg,
.upload-button svg,
.icon-button svg,
.small-icon svg,
.drop-icon svg,
.drawer-head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-field svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.search-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field input::placeholder {
  color: #8a9692;
}

.view-switch {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-button,
.small-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.icon-button.active,
.icon-button:hover,
.small-icon:hover {
  color: var(--ink);
  background: var(--panel-2);
}

.upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(46, 125, 104, 0.22);
  white-space: nowrap;
  cursor: pointer;
}

.upload-button:hover {
  background: var(--accent-strong);
}

.upload-button input {
  display: none;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: nowrap;
}

.secondary-button:hover {
  background: var(--panel-2);
  border-color: var(--line-strong);
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background:
    linear-gradient(135deg, rgba(224, 241, 236, 0.86), rgba(255, 255, 255, 0.95)),
    var(--panel);
  border: 1px dashed #abc8bf;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(24, 35, 31, 0.06);
}

.drop-template {
  display: grid;
  gap: 4px;
  width: min(210px, 22vw);
  margin-left: auto;
}

.drop-template + .drop-template {
  margin-left: 0;
}

.drop-template span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drop-template select {
  width: 100%;
  height: 32px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(190, 225, 215, 0.98), rgba(255, 255, 255, 0.98)),
    var(--panel);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone strong {
  font-size: 15px;
}

.drop-zone span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-bar label,
.form-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.filter-bar span,
.form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
}

.form-grid textarea {
  min-height: 76px;
  padding-top: 8px;
  resize: vertical;
}

.filter-bar input:focus,
.filter-bar select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 104, 0.12);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.summary-strip > div {
  min-height: 46px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.asset-panel {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(24, 35, 31, 0.06);
}

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

.panel-head h2 {
  font-size: 16px;
}

.panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.panel-head select {
  height: 32px;
  min-width: 174px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.asset-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.requirement-table {
  min-width: 1180px;
}

.asset-table th {
  height: 30px;
  padding: 0 7px;
  color: var(--muted);
  background: #f8faf9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.asset-table td {
  height: 38px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--line);
  color: #26322e;
  font-size: 13px;
  vertical-align: middle;
}

.asset-table tr:hover td {
  background: #fbfdfc;
}

.asset-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 230px;
}

.thumb,
.card-preview {
  position: relative;
  overflow: hidden;
  background: #e8efec;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.thumb {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

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

.thumb.file-icon::before,
.card-preview.file-icon::before {
  content: attr(data-type);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.thumb.design-icon::before,
.card-preview.design-icon::before {
  background: var(--amber);
}

.file-name {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.file-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 20px;
  padding: 0 7px;
  color: #215f50;
  background: var(--accent-soft);
  border: 1px solid #c6e3da;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.type-pill.design {
  color: #79510e;
  background: #fff4dd;
  border-color: #ead4a2;
}

.inline-input {
  width: 110px;
  height: 26px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
}

.inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 104, 0.12);
}

.placement {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.status-pill.pending {
  color: #6b5a21;
  background: #fbf0cd;
  border-color: #ecd99c;
}

.status-pill.done,
.status-pill.compressed {
  color: #245f7b;
  background: #e2f0f7;
  border-color: #b7d8e7;
}

.status-pill.submitted {
  color: #215f50;
  background: var(--accent-soft);
  border-color: #c6e3da;
}

.status-pill.rejected {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc4c4;
}

.status-pill.approved,
.status-pill.requirement-matched {
  color: var(--success);
  background: var(--success-soft);
  border-color: #bfe4d0;
}

.status-pill.requirement-missing {
  color: var(--muted);
  background: var(--neutral-soft);
  border-color: var(--line);
}

.status-pill.requirement-invalid {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc4c4;
}

.status-pill.requirement-approved {
  color: #215f50;
  background: var(--accent-soft);
  border-color: #c6e3da;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.small-icon.danger,
.text-button.danger {
  color: var(--danger);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.detail-drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 17, 0.28);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(540px, 100vw);
  height: 100%;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 44px rgba(24, 35, 31, 0.16);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 20px;
}

.drawer-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-preview strong,
.drawer-preview span {
  display: block;
}

.drawer-preview strong {
  max-width: 390px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.drawer-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #e8efec;
}

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

.drawer-thumb.file-icon::before {
  content: attr(data-type);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-thumb.file-icon {
  position: relative;
}

.drawer-thumb.design-icon::before {
  background: var(--amber);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 8px;
}

.full-field,
.check-field {
  grid-column: 1 / -1;
}

.check-field {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.check-field input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.check-field span {
  color: var(--ink);
  font-weight: 600;
}

.validation-card {
  margin: 10px 20px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--neutral-soft);
}

.validation-card.pass {
  color: var(--success);
  background: var(--success-soft);
  border-color: #bfe4d0;
}

.validation-card.fail {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc4c4;
}

.validation-card.none {
  color: var(--muted);
}

.validation-card strong {
  display: block;
  margin-bottom: 6px;
}

.validation-card p,
.validation-card li {
  font-size: 13px;
  line-height: 1.5;
}

.validation-card ul {
  margin: 0;
  padding-left: 18px;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
}

.import-body {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}

.import-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-body textarea {
  width: 100%;
  min-height: 320px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  resize: vertical;
}

.import-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 104, 0.12);
}

.asset-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.asset-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(24, 35, 31, 0.08);
}

.card-preview {
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 0;
}

.card-body {
  padding: 12px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.asset-card dl {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.asset-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.asset-card dt,
.asset-card dd {
  margin: 0;
  font-size: 12px;
}

.asset-card dt {
  color: var(--muted);
}

.asset-card dd {
  min-width: 0;
  overflow: hidden;
  color: #25312d;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.text-button {
  height: 30px;
  padding: 0 10px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.text-button:hover {
  background: var(--panel-2);
}

.empty-state {
  display: none;
  place-items: center;
  min-height: 320px;
  padding: 42px 20px;
  text-align: center;
}

.empty-state.visible {
  display: grid;
}

.empty-visual {
  width: 92px;
  height: 66px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, 0.85) 46% 54%, transparent 54%),
    linear-gradient(135deg, #dbe9e4, #f8fbfa);
  box-shadow: 0 16px 28px rgba(24, 35, 31, 0.08);
}

.empty-state h3 {
  font-size: 18px;
}

.empty-state p {
  max-width: 420px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.hidden {
  display: none;
}

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 320px;
  padding: 12px 14px;
  color: #fff;
  background: #17231f;
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(24, 35, 31, 0.18);
  font-size: 14px;
}

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

  .sidebar {
    position: relative;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
  }

  .storage-card {
    position: static;
    margin-top: 16px;
  }

  .workspace {
    padding: 20px;
  }

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

  .toolbar {
    justify-content: flex-start;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

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

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

@media (max-width: 620px) {
  .workspace {
    padding: 16px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .search-field,
  .upload-button {
    grid-column: 1 / -1;
  }

  .upload-button {
    width: 100%;
  }

  .drop-zone {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .drop-template {
    width: 100%;
    margin-left: 0;
  }

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

  .filter-bar,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-head select {
    width: 100%;
  }
}
