:root {
  --bg: #f4f1ea;
  --bg-accent: radial-gradient(circle at top, #fff4d8 0%, #f4f1ea 42%, #ebe5da 100%);
  --surface: rgba(255, 252, 245, 0.9);
  --surface-strong: #fffdf7;
  --border: #d7cbb6;
  --accent: #0a6c74;
  --accent-hover: #095961;
  --text: #221f1a;
  --muted: #70665b;
  --danger: #bc3a2d;
  --success: #1e8a4b;
  --shadow: 0 16px 42px rgba(72, 53, 23, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg-accent);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(34, 31, 26, 0.1);
  background: rgba(255, 251, 242, 0.72);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  border-color: rgba(10, 108, 116, 0.25);
  background: rgba(10, 108, 116, 0.08);
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.25rem;
}

.hero,
.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero {
  padding: 2.25rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1;
}

.hero-copy {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  max-width: 62ch;
  color: var(--muted);
}

.panel {
  padding: 1.4rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.button {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font: inherit;
  transition: 0.18s ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.dropzone {
  border: 2px dashed rgba(10, 108, 116, 0.32);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.68), rgba(255,247,231,0.88));
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  transition: 0.18s ease;
}

.dropzone.dragover {
  transform: scale(0.995);
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(240,253,253,0.95), rgba(252,243,221,0.94));
}

.dropzone-inner {
  text-align: center;
  max-width: 32rem;
}

.drop-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 28px rgba(10, 108, 116, 0.12);
}

.dropzone-inner h3 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.dropzone-inner p {
  margin: 0;
  color: var(--muted);
}

.queue-summary {
  align-self: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(10, 108, 116, 0.08);
  color: var(--accent);
  font-size: 0.92rem;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.45);
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.pdf-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  background: var(--surface-strong);
  border: 1px solid rgba(34, 31, 26, 0.08);
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(66, 51, 28, 0.08);
  cursor: grab;
}

.pdf-card.dragging {
  opacity: 0.45;
  transform: rotate(1deg);
}

.pdf-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  background: #fff5d9;
  color: #7a5c08;
  font-weight: 700;
}

.pdf-preview {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6f6f6, #ece7df);
  border: 1px solid rgba(34, 31, 26, 0.08);
  display: grid;
  place-items: center;
}

.pdf-preview canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pdf-preview-fallback {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 1rem;
  text-align: center;
}

.pdf-meta {
  display: grid;
  gap: 0.25rem;
}

.pdf-name {
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.pdf-details {
  color: var(--muted);
  font-size: 0.92rem;
}

.pdf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.drag-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.remove-button {
  appearance: none;
  border: 1px solid rgba(188, 58, 45, 0.18);
  background: rgba(188, 58, 45, 0.08);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.action-form label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
}

.action-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  color: var(--text);
}

.action-form input:focus {
  outline: 2px solid rgba(10, 108, 116, 0.18);
  border-color: var(--accent);
}

.status {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-size: 0.96rem;
}

.status.loading {
  background: rgba(10, 108, 116, 0.08);
  color: var(--accent);
}

.status.success {
  background: rgba(30, 138, 75, 0.1);
  color: var(--success);
}

.status.error {
  background: rgba(188, 58, 45, 0.1);
  color: var(--danger);
}

@media (max-width: 760px) {
  .main-nav,
  .panel-head,
  .action-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-head {
    justify-content: stretch;
  }

  .button-secondary,
  .button-primary {
    width: 100%;
    text-align: center;
  }

  .page-shell {
    width: min(100% - 1rem, 1180px);
    margin-top: 1rem;
  }

  .hero,
  .panel {
    padding: 1rem;
  }
}
