* {
  box-sizing: border-box;
}

:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #182235;
  --border: #2b3954;
  --text: #e8eefc;
  --muted: #9fb0d1;
  --primary: #4f8cff;
  --primary-hover: #3c78e8;
  --success: #18b26b;
  --danger: #d9534f;
  --warning: #d9a441;
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #09101d 0%, #0e1627 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  min-height: 100%;
}

body {
  padding: 24px;
}

#app {
  max-width: 1450px;
  margin: 0 auto;
}

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

.topbar-left h1 {
  margin: 0;
  font-size: 2rem;
}

.subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.status-card {
  grid-column: span 2;
  background: rgba(18, 26, 43, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.status-card.wide {
  grid-column: span 4;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.inline-copy {
  display: flex;
  gap: 8px;
}

.inline-copy input {
  flex: 1;
  background: #0c1422;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.search-wrap,
.filter-wrap {
  background: rgba(18, 26, 43, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.search-wrap {
  flex: 1;
}

.search-wrap input,
.filter-wrap select {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
}

.disc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.disc-card {
  background: rgba(18, 26, 43, 0.98);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.disc-card:hover {
  transform: translateY(-4px);
  border-color: #46618b;
}

.disc-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.disc-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.disc-title-wrap h3 {
  margin: 0;
  font-size: 1.1rem;
}

.disc-id {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.disc-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.meta-row .label {
  color: var(--muted);
  font-size: 0.86rem;
  flex-shrink: 0;
}

.meta-row .value {
  text-align: right;
  font-size: 0.9rem;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-empty {
  background: rgba(255, 255, 255, 0.08);
  color: #c3cee4;
}

.badge-ready {
  background: rgba(24, 178, 107, 0.18);
  color: #7dffbe;
}

.badge-failed {
  background: rgba(217, 83, 79, 0.18);
  color: #ffaaa7;
}

.badge-processing {
  background: rgba(79, 140, 255, 0.2);
  color: #a8c7ff;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
}

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

.btn-secondary {
  background: #25344f;
}

.btn-secondary:hover {
  background: #304466;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #c84844;
}

.btn.full {
  width: 100%;
}

.message {
  margin-bottom: 16px;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 600;
}

.message.success {
  background: rgba(24, 178, 107, 0.16);
  border: 1px solid rgba(24, 178, 107, 0.35);
  color: #8bffca;
}

.message.error {
  background: rgba(217, 83, 79, 0.16);
  border: 1px solid rgba(217, 83, 79, 0.35);
  color: #ffb0ae;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 15, 0.72);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 560px;
  background: #121a2b;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
}

.modal-header p {
  margin: 6px 0 0 0;
  color: var(--muted);
}

.icon-btn {
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

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

.disc-form label {
  display: grid;
  gap: 8px;
}

.disc-form span {
  font-size: 0.9rem;
  color: var(--muted);
}

.disc-form input {
  width: 100%;
  background: #0c1422;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.disc-form small {
  color: var(--muted);
  font-size: 0.8rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 1100px) {
  .status-card {
    grid-column: span 6;
  }

  .status-card.wide {
    grid-column: span 6;
  }
}

@media (max-width: 700px) {
  body {
    padding: 14px;
  }

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

  .toolbar {
    flex-direction: column;
  }

  .status-card,
  .status-card.wide {
    grid-column: span 12;
  }

  .modal-actions {
    flex-direction: column;
  }
}