/* ============================================================
   AGO Transfer Spec — industrial job-ticket aesthetic
   safety yellow #FDD51A on shop-floor charcoal
   ============================================================ */

:root {
  --yellow: #FDD51A;
  --yellow-dim: #d9b613;
  --ink: #141517;
  --ink-2: #1d1f22;
  --ink-3: #26282c;
  --line: #34373c;
  --text: #eceae4;
  --text-dim: #9ba0a1;
  --orange: #F15E27;
  --danger: #e5533a;
  --radius: 10px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(253, 213, 26, 0.05), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,0.014) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,0.014) 39px 40px);
}

/* ---------------- top bar ---------------- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); box-shadow: 0 6px 24px rgba(0,0,0,.5); }

.topbar-stripe {
  height: 7px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, var(--ink) 16px 32px);
}

.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-logo { height: 44px; width: auto; flex: none; align-self: center; }

.app-title {
  font-family: "Archivo Black", var(--font);
  font-size: 21px; margin: 0; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.title-dot { color: var(--yellow); }

/* ---------------- layout ---------------- */

.workbench {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 26px;
  padding: 26px 22px 60px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

/* ---------------- rail / panels ---------------- */

.rail { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
}

.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.panel-head h2 {
  margin: 0; font-size: 13.5px; font-weight: 800;
  letter-spacing: 1.6px; text-transform: uppercase;
}
.step-no {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: var(--yellow); color: var(--ink);
  font-family: "Archivo Black", var(--font); font-size: 13px;
  border-radius: 6px;
}

.panel-hint { font-size: 12.5px; color: var(--text-dim); margin: -6px 0 12px; line-height: 1.45; }

/* ---------------- dropzone ---------------- */

.dropzone {
  border: 2px dashed #4a4e55;
  border-radius: var(--radius);
  background: var(--ink-3);
  min-height: 132px;
  display: grid; place-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  padding: 16px;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--yellow); outline: none; }
.dropzone.dragover {
  border-color: var(--yellow);
  background: rgba(253, 213, 26, 0.07);
  transform: scale(1.01);
}

.dz-icon { width: 34px; height: 34px; color: var(--yellow); margin-bottom: 4px; }
.dz-main { margin: 2px 0; font-size: 15px; font-weight: 700; }
.dz-sub { margin: 0; font-size: 12.5px; color: var(--text-dim); }
.dz-formats { margin: 8px 0 0; font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; color: #6a6e75; }

.dz-spinner {
  width: 30px; height: 30px; margin: 0 auto 10px;
  border: 3px solid #3a3d43; border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dz-done { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; }
.dz-thumb {
  width: 84px; height: 64px; flex: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23eee'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23eee'/%3E%3C/svg%3E");
  border-radius: 6px;
  display: grid; place-items: center; overflow: hidden;
  padding: 5px;
}
.dz-thumb svg { max-width: 100%; max-height: 100%; }
.dz-donetext { min-width: 0; }
.dz-donetext .dz-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn {
  background: none; border: none; padding: 0; margin-top: 5px;
  color: var(--yellow); font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

.field-note { font-size: 12px; color: var(--text-dim); margin: 10px 2px 0; line-height: 1.45; }
.field-note.warn { color: #e8b64a; }

/* ---------------- fields ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label, .field-row label {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-dim);
}
.field input {
  background: var(--ink-3);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--yellow); }

.field-pair { display: flex; align-items: flex-end; gap: 10px; }
.field-pair .field { flex: 1; margin-bottom: 12px; }

.lockbtn {
  flex: none; width: 34px; height: 42px; margin-bottom: 12px;
  display: grid; place-items: center;
  background: var(--ink-3); border: 1.5px solid var(--line); border-radius: 8px;
  color: #6a6e75; cursor: pointer; transition: color .15s, border-color .15s;
}
.lockbtn.locked { color: var(--yellow); border-color: rgba(253,213,26,.4); }
.lockbtn:not(.locked) .lock-shackle { transform: translateX(3px) rotate(12deg); transform-origin: 14px 9px; }

.checkline {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 2px;
}
.checkline small { color: var(--text-dim); font-weight: 500; }
.checkline input { display: none; }
.checkbox-ui {
  width: 20px; height: 20px; flex: none;
  border: 2px solid #4a4e55; border-radius: 5px;
  background: var(--ink-3);
  display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.checkline input:checked + .checkbox-ui { background: var(--yellow); border-color: var(--yellow); }
.checkline input:checked + .checkbox-ui::after {
  content: ""; width: 5px; height: 10px;
  border: solid var(--ink); border-width: 0 3px 3px 0;
  transform: rotate(45deg) translateY(-1px);
}

.field-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--ink-3); border: 1.5px solid var(--line); border-radius: 8px; }
.step-btn {
  width: 34px; height: 34px; border: none; background: none;
  color: var(--yellow); font-size: 19px; font-weight: 800; cursor: pointer;
  border-radius: 6px;
}
.step-btn:hover { background: rgba(253,213,26,.1); }
.stepper output { min-width: 46px; text-align: center; font-size: 13.5px; font-weight: 700; }

/* ---------------- colour list ---------------- */

.colour-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.colour-list:empty::after {
  content: "No logo yet — colours appear here.";
  display: block; font-size: 12.5px; color: #6a6e75;
  padding: 14px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 8px;
}

.colour-row {
  display: flex; align-items: stretch; gap: 0;
  background: var(--ink-3);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s;
  width: 100%;
}
.colour-row:hover { border-color: var(--yellow); }
.cr-main {
  display: flex; align-items: center; gap: 11px;
  flex: 1; min-width: 0;
  background: none; border: none;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left; font: inherit; color: inherit;
}
.cr-x {
  flex: none; width: 38px;
  background: none;
  border: none; border-left: 1.5px solid var(--line);
  color: #6a6e75; font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.cr-x:hover:not(:disabled) { color: var(--danger); background: rgba(229,83,58,.1); }
.cr-x:disabled { opacity: .3; cursor: not-allowed; }

.cr-swatches { display: flex; align-items: center; gap: 5px; flex: none; }
.cr-orig, .cr-pms {
  width: 26px; height: 26px; border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.cr-arrow { color: #6a6e75; font-size: 12px; }
.cr-text { min-width: 0; flex: 1; }
.cr-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-pct { font-size: 11.5px; color: var(--text-dim); }
.cr-edit { flex: none; color: #6a6e75; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.cr-main:hover .cr-edit { color: var(--yellow); }

.reg-row { margin-top: 10px; padding: 10px 12px; border: 1.5px dashed rgba(253,213,26,.45); border-radius: 8px; }
.reg-row .field-note { margin: 0 0 8px; }
.reg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-btn {
  background: var(--ink-3); border: 1.5px solid var(--line); border-radius: 7px;
  color: var(--text); font: inherit; font-size: 12px; font-weight: 700;
  padding: 7px 10px; cursor: pointer; transition: border-color .12s, color .12s;
}
.mini-btn:hover { border-color: var(--yellow); color: var(--yellow); }

.ghost-btn {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ghost-btn:hover:not(:disabled) { color: var(--yellow); border-color: rgba(253,213,26,.5); }
.ghost-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- download button ---------------- */

.download-btn {
  position: relative;
  border: none; border-radius: var(--radius);
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  padding: 16px 18px 15px;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: transform .1s, filter .15s;
}
.download-btn:not(:disabled):hover { filter: brightness(1.06); transform: translateY(-1px); }
.download-btn:not(:disabled):active { transform: translateY(0); }
.download-btn:disabled { background: #3a3d42; color: #7c8087; cursor: not-allowed; }

.dl-stripe {
  position: absolute; inset: auto 0 0 0; height: 6px;
  background: repeating-linear-gradient(-45deg, rgba(20,21,23,.85) 0 10px, transparent 10px 20px);
  opacity: .25;
}
.download-btn:disabled .dl-stripe { display: none; }
.dl-label {
  display: block;
  font-family: "Archivo Black", var(--font);
  font-size: 18px; letter-spacing: 1px; text-transform: uppercase;
}
.dl-sub { display: block; font-size: 11.5px; font-weight: 700; margin-top: 3px; opacity: .75; }

/* ---------------- sheet preview ---------------- */

.deck { position: sticky; top: 92px; }
.deck-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 2.2px;
  color: #6a6e75; margin-bottom: 10px;
}
.sheet-wrap { position: relative; }
.sheet {
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 24px 70px rgba(0,0,0,.55);
  aspect-ratio: 612 / 792;
  width: 100%;
  max-width: 660px;
  overflow: hidden;
}
.sheet svg { display: block; width: 100%; height: 100%; }
.sheet:empty {
  display: grid; place-items: center;
}
.sheet:empty::after {
  content: "Sheet preview";
  color: #c9c9c9; font-size: 14px; font-weight: 600; letter-spacing: 1px;
}

/* ---------------- pantone dialog ---------------- */

dialog#pantoneDialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink-2);
  color: var(--text);
  padding: 18px;
  width: min(430px, calc(100vw - 32px));
  max-height: min(640px, 86vh);
}
dialog#pantoneDialog::backdrop { background: rgba(8,8,10,.7); backdrop-filter: blur(3px); }

.pd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pd-current { display: flex; align-items: center; gap: 12px; }
.pd-swatch { width: 40px; height: 40px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.pd-title { margin: 0; font-size: 15px; font-weight: 800; }
.pd-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }
.pd-close {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); width: 34px; height: 34px; cursor: pointer; font-size: 14px;
}

#pdSearch {
  width: 100%;
  background: var(--ink-3);
  border: 1.5px solid var(--line); border-radius: 9px;
  color: var(--text); font: inherit; font-size: 15px;
  padding: 11px 13px;
}
#pdSearch:focus { outline: none; border-color: var(--yellow); }

.pd-section { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #6a6e75; margin: 14px 2px 8px; }

.pd-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.pd-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--ink-3); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 8px 11px; cursor: pointer;
}
.pd-item:hover { border-color: var(--yellow); }
.pd-item .sw { width: 26px; height: 26px; border-radius: 6px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.pd-item .nm { font-size: 14px; font-weight: 700; flex: 1; }
.pd-item .de { font-size: 11px; color: var(--text-dim); }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; padding: 18px 14px 90px; }
  .deck { position: static; order: -1; }
  .sheet { max-width: 520px; margin: 0 auto; }
  .app-title { font-size: 17px; }
  .topbar-inner { padding: 11px 14px 10px; }
  .download-btn {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 30;
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
  }
}
