/* Screen-specific layouts for Nexlink Operation */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, oklch(0.9 0.04 275 / 0.55), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, oklch(0.92 0.03 230 / 0.4), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 22px;
  box-shadow: var(--shadow-md);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.login-brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
#login-form { display: flex; flex-direction: column; gap: 14px; }
.login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
}
.login-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(200px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 520px;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-height: calc(100vh - 220px);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 8px;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.kanban-col-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.kanban-col-head .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  height: 20px;
  display: inline-flex;
  align-items: center;
}
.kanban-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ticket-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.ticket-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.ticket-card .code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}
.ticket-card .title {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  color: var(--fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.ticket-card .meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Detail */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.detail-title-block { flex: 1; min-width: 220px; }
.detail-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.detail-title-block h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: start;
}
.detail-left, .detail-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.detail-desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
}
.meta-list {
  margin: 0;
  display: grid;
  gap: 10px;
}
.meta-list > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: center;
}
.meta-list dt {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
}
.meta-list dd { margin: 0; font-size: 13px; }
.inline-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.payout-total {
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--ok-soft);
  border: 1px solid oklch(0.85 0.05 150);
  text-align: center;
}
.payout-total.dimmed {
  background: var(--surface-2);
  border-color: var(--border);
}
.payout-total .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.payout-total .amount {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 4px 0;
  color: var(--fg);
}
.payout-total:not(.dimmed) .amount { color: var(--ok); }
.payout-total .gate-hint {
  font-size: 12px;
  color: var(--muted);
}

.formula { display: flex; flex-direction: column; gap: 6px; }
.formula-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.formula-row.total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 650;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline li:last-child::before { display: none; }
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
  margin-top: 2px;
  z-index: 1;
}
.tl-dot.muted-dot {
  background: var(--pending);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.tl-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.tl-body .ts {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ceo-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.feed-item.warn { border-color: oklch(0.85 0.06 85); background: var(--warn-soft); }
.feed-item.fail { border-color: oklch(0.85 0.05 25); background: var(--fail-soft); }

.salary-summary {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  margin-bottom: 14px;
  align-items: center;
}
.salary-amount {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.quota-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 550;
}

/* Mobile QC / Veto */
.inspect-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.viewfinder {
  margin: 14px 0;
  aspect-ratio: 1;
  max-height: 220px;
  background: oklch(0.18 0.02 265);
  border-radius: var(--radius);
  position: relative;
  display: grid;
  place-items: center;
  color: oklch(0.85 0.01 265);
  font-size: 13px;
  overflow: hidden;
}
.vf-corners {
  position: absolute;
  inset: 28px;
  border: 2px solid oklch(0.7 0.12 275 / 0.7);
  border-radius: 8px;
  box-shadow: 0 0 0 999px oklch(0.1 0.02 265 / 0.35);
}
.gps-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 14px;
  color: var(--accent);
}
.gps-box strong { display: block; color: var(--fg); font-size: 13px; }
.gps-box .small { color: var(--muted); margin-top: 2px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.photo-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 22px;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.photo-slot.filled {
  border-style: solid;
  border-color: var(--border);
  background:
    linear-gradient(135deg, oklch(0.88 0.03 265), oklch(0.78 0.04 250));
}
.photo-slot.add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.pass-fail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.pf-btn {
  min-height: 52px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pf-btn.pass:hover, .pf-btn.pass.selected {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}
.pf-btn.fail:hover, .pf-btn.fail.selected {
  background: var(--fail-soft);
  border-color: var(--fail);
  color: var(--fail);
}

.veto-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.veto-type {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  text-align: left;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.veto-type:hover { border-color: var(--border-strong); background: var(--surface-2); }
.veto-type.selected {
  border-color: var(--fail);
  background: var(--fail-soft);
}
.veto-type .vt-icon {
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  color: white;
  align-self: center;
}
.vt-icon.crash { background: oklch(0.5 0.16 25); }
.vt-icon.net { background: oklch(0.45 0.1 250); }
.vt-icon.cash { background: oklch(0.48 0.12 145); }
.veto-type strong {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
}
.veto-type span:last-child {
  font-size: 12px;
  color: var(--muted);
  grid-column: 2;
}

.pfactor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pfactor-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 550;
  z-index: 200;
  box-shadow: var(--shadow-md);
  max-width: min(90vw, 360px);
  text-align: center;
}

.app-shell.is-mobile .main {
  background: oklch(0.92 0.01 265);
  padding: 16px 0;
}
.app-shell.is-mobile #screen-qc-queue.active,
.app-shell.is-mobile #screen-qc-inspect.active,
.app-shell.is-mobile #screen-veto.active {
  display: block;
}

/* Projects list */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-prefix {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
}
.project-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.project-repo { color: var(--muted); }
.project-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.project-stats strong { color: var(--fg); }

/* Mobile back nav */
.phone-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.phone-back-btn:hover { color: oklch(0.36 0.11 275); }
.phone-back-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .ceo-panels { grid-template-columns: 1fr; }
  .salary-summary { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(7, minmax(180px, 1fr)); }
  .salary-amount { font-size: 26px; }
  #screen-salary .table-wrap,
  #screen-salary .card { border-radius: 0; border-left: none; border-right: none; }
  #screen-salary table.data th:nth-child(2),
  #screen-salary table.data td:nth-child(2) { display: none; }

  /* Full-bleed phone screens under outer topbar + bottom nav */
  .app-shell.is-mobile .main {
    padding: 0;
    background: var(--surface);
  }
  .app-shell.is-mobile #screen-qc-queue.active,
  .app-shell.is-mobile #screen-qc-inspect.active,
  .app-shell.is-mobile #screen-veto.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
}
@media (max-width: 600px) {
  .detail-header { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; }
  .filter-bar .select, .filter-bar .input { min-width: 100%; width: 100%; }
}
