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

/* ── Login screen ─────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadein .3s ease;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 44px 44px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 32px rgba(0,0,0,.1);
  text-align: center;
  animation: slideup .35s cubic-bezier(.22,1,.36,1);
}

.login-icon { font-size: 2.8rem; margin-bottom: 16px; display: block; }
.login-title { font-size: 1.75rem; font-weight: 700; color: #1d1d1f; margin-bottom: 8px; letter-spacing: -.02em; }
.login-subtitle { font-size: .9rem; color: #6e6e73; margin-bottom: 36px; }

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  font-family: inherit;
}
.google-btn:hover { background: #f8f9fa; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.google-btn:active { transform: scale(.98); }
.google-logo { width: 18px; height: 18px; flex-shrink: 0; }

/* ── App layout ───────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: #f5f5f7;
  color: #1d1d1f;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-btn {
  background: transparent;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  color: #0071e3;
  font-size: .8125rem;
  padding: 6px 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.hub-btn:hover { background: #f2f2f7; }

.signout-btn {
  background: transparent;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  color: #6e6e73;
  font-size: .8125rem;
  padding: 6px 12px;
  cursor: pointer;
  width: auto;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.signout-btn:hover { background: #f2f2f7; color: #3a3a3c; }

/* ── Board ────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 24px 28px;
  flex: 1;
  /* Backlog / In Progress / Done stretch to a shared row height; the Print
     column opts out below so its form stays content-sized. */
  align-items: stretch;
}

@media (max-width: 768px) {
  .board { grid-template-columns: 1fr; }
  .app-header { padding: 12px 16px; }
  .board { padding: 16px; }
}

/* ── Column ───────────────────────────────────── */
.column {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.column.print-column { align-self: start; }

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f2f2f7;
}

.col-title {
  font-size: .875rem;
  font-weight: 700;
  color: #3a3a3c;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.col-count {
  background: #e8f0fe;
  color: #0071e3;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.col-count.backlog-count {
  background: #fff3cd;
  color: #946200;
}

.col-count.done-count {
  background: #d1f4e0;
  color: #1a7f4b;
}

.col-body {
  padding: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.print-column .col-body { display: block; flex: none; }

/* ── Print column inputs ──────────────────────── */
.print-col input {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #d2d2d7;
  border-radius: 10px;
  font-size: .9375rem;
  color: #1d1d1f;
  background: #fafafa;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 10px;
  font-family: inherit;
}
.print-col input:focus { border-color: #0071e3; background: #fff; }

.print-col button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px;
  background: #0071e3;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.print-col button:hover { background: #0077ed; }
.print-col button:active { transform: scale(.98); }
.print-col button:disabled { background: #a1a1a6; cursor: not-allowed; transform: none; }

/* ── Toast ────────────────────────────────────── */
.toast {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: .875rem;
  display: none;
  animation: fadein .2s ease;
}
.toast.success { background: #d1f4e0; color: #1a7f4b; display: block; }
.toast.error   { background: #fee2e2; color: #b91c1c; display: block; }

/* ── Job list ─────────────────────────────────── */
.job-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* flex:1 fills the stretched column so short lists match the tallest one and
     the empty space stays a valid drag drop target. The 60vh cap only applies
     to the stacked mobile layout; desktop lifts it above. */
  flex: 1;
  min-height: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.job-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f9f9fb;
  border-radius: 10px;
  animation: fadein .2s ease;
}

#backlog-list .job-item {
  background: hsl(45, 52%, 94%);
}

#progress-list .job-item {
  background: hsl(145, 22%, 93%);
}

#done-list .job-item {
  background: #f9f9fb;
}

#backlog-list .job-item,
#progress-list .job-item,
#done-list .job-item {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
/* Color by Jira issue type: task = print-icon blue, subtask = green */
#backlog-list .job-item.type-task,
#progress-list .job-item.type-task    { background: hsl(218, 48%, 95%); }
#backlog-list .job-item.type-subtask,
#progress-list .job-item.type-subtask { background: hsl(145, 24%, 90%); }
#backlog-list .job-item:active,
#progress-list .job-item:active,
#done-list .job-item:active { cursor: grabbing; }
#backlog-list .job-item *,
#progress-list .job-item *,
#done-list .job-item * { cursor: inherit; }

#backlog-list.drop-target,
#progress-list.drop-target,
#done-list.drop-target {
  outline: 2px dashed #0071e3;
  outline-offset: 6px;
  border-radius: 10px;
}

.job-title {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  color: #1d1d1f;
  word-break: break-word;
}

.job-time {
  font-size: .75rem;
  color: #aeaeb2;
  white-space: nowrap;
  flex-shrink: 0;
}

.job-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-reprint, .btn-edit, .btn-progress, .btn-done, .btn-delete {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  cursor: default !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, transform .1s;
}

.btn-reprint {
  background: #e8e8ed;
  color: #6e6e73;
}
.btn-reprint:hover { background: #dcdce1; }

.btn-edit {
  background: #e8e8ed;
  color: #3a3a3c;
}
.btn-edit:hover { background: #dcdce1; }

.btn-progress {
  background: #e8f0fe;
  color: #0071e3;
}
.btn-progress:hover { background: #d6e7ff; }

.btn-done {
  background: #d1f4e0;
  color: hsl(146, 51%, 40%);
}
.btn-done:hover { background: #a7f0c4; }

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}
.btn-delete:hover { background: #fecaca; }

.btn-edit:active, .btn-progress:active, .btn-done:active, .btn-delete:active { transform: scale(.9); }

.done-item .job-title {
  color: #aeaeb2;
  text-decoration: line-through;
}

.empty-state {
  text-align: center;
  padding: 24px 0;
  color: #aeaeb2;
  font-size: .875rem;
}

/* ── Drag & drop ──────────────────────────────────── */
.drag-handle {
  color: #c7c7cc;
  cursor: grab;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px 2px 2px 0;
  touch-action: none;
}
.drag-handle:hover { color: #aeaeb2; }
.drag-handle:active { cursor: grabbing; }

.drag-source {
  opacity: .35;
}

.drag-ghost {
  position: absolute;
  z-index: 999;
  pointer-events: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: .92;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 500;
  color: #1d1d1f;
}

.drop-above { box-shadow: inset 0 3px 0 #0071e3; }
.drop-below { box-shadow: inset 0 -3px 0 #0071e3; }

/* ── Animations ───────────────────────────────── */
@keyframes fadein  { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@keyframes slideup { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* Desktop: pin the board to the viewport so every column is exactly as tall as
   the space available and its list scrolls inside it — otherwise the column
   stretches to the viewport while the list stops at its own cap, leaving dead
   space below a clipped list. Mobile stacks the columns, so it keeps the cap
   and lets the page scroll instead. */
@media (min-width: 769px) {
  #app { height: 100vh; overflow: hidden; }
  .board { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .job-list { max-height: none; }
}
