/* ===== stock-take.css ===== */

.st-container {
  /* Leave room for the sticky footer */
  padding-bottom: 6rem;
}

.st-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.st-header h1 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--text);
}
.st-header h1 i { color: var(--primary); margin-right: .5rem; }
.st-header-meta {
  margin-top: .35rem;
  color: var(--text-muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.st-date {
  font-weight: 600;
  color: var(--text);
}
.st-dot { color: var(--border); }
.st-progress { font-weight: 500; }

.st-loading {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.st-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.st-group-header {
  background: #f8faff;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.st-group-header i { color: var(--primary); }
.st-group-count {
  margin-left: auto;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Desktop table ───────────────────────────────────────── */
.st-table {
  width: 100%;
  border-collapse: collapse;
}
.st-table thead th {
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  padding: .6rem 1rem;
  background: #fafbff;
  border-bottom: 1px solid var(--border);
}
.st-table tbody td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .9rem;
}
.st-table tbody tr:last-child td { border-bottom: none; }
.st-table tbody tr.has-count   { background: #f0fdf4; }
.st-table tbody tr.has-variance { background: #fefce8; }

.st-name { font-weight: 600; color: var(--text); }
.st-cat  {
  display: inline-block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.st-expected {
  font-weight: 600;
  color: var(--text);
}
.st-expected .unit { color: var(--text-muted); font-weight: 400; font-size: .82rem; margin-left: .15rem; }

.st-input {
  width: 110px;
  padding: .4rem .55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
}
.st-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.st-variance {
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
}
.st-variance.zero { color: var(--text-muted); font-weight: 500; }
.st-variance.pos  { color: #16a34a; }
.st-variance.neg  { color: #dc2626; }
.st-variance .placeholder { color: var(--border); font-weight: 400; }

.st-reason {
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  background: #fff;
  min-width: 140px;
}
.st-reason.hidden-slot { visibility: hidden; }

/* ── Mobile cards ────────────────────────────────────────── */
.st-cards { display: none; }

@media (max-width: 767px) {
  .st-table { display: none; }
  .st-cards { display: block; padding: .6rem; }
  .st-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .85rem;
    margin-bottom: .65rem;
    background: #fff;
  }
  .st-card.has-count    { background: #f0fdf4; border-color: #bbf7d0; }
  .st-card.has-variance { background: #fefce8; border-color: #fde68a; }

  .st-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .55rem;
  }
  .st-card-name { font-weight: 600; color: var(--text); font-size: .95rem; }
  .st-card-cat  { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
  .st-card-expected {
    font-size: .82rem; color: var(--text-muted);
    white-space: nowrap;
  }
  .st-card-expected strong { color: var(--text); }

  .st-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    align-items: end;
  }
  .st-card-row label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .25rem;
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .st-card .st-input { width: 100%; }
  .st-card .st-reason { width: 100%; }

  .st-card-variance-row {
    margin-top: .55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .st-card-variance-row .st-variance { font-size: .95rem; }
}

/* ── Sticky footer ───────────────────────────────────────── */
.st-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .06);
  z-index: 50;
}
.st-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.st-footer-progress {
  font-size: .9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.st-footer-progress #stFooterProgress { color: var(--text); font-weight: 600; }
.st-footer .btn { padding: .65rem 1.4rem; font-size: .95rem; }

@media (max-width: 480px) {
  .st-footer-inner { padding: .6rem .75rem; }
  .st-footer .btn { padding: .55rem 1rem; font-size: .88rem; }
  .st-footer-progress { font-size: .82rem; }
}

/* ── Not-counted badge on inventory page ──────────────────── */
.inv-not-counted-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eab308;
  margin-left: .4rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, .15);
}
.inv-not-counted-label {
  display: inline-block;
  margin-left: .4rem;
  font-size: .7rem;
  font-weight: 600;
  color: #854d0e;
  background: #fef9c3;
  padding: .1rem .4rem;
  border-radius: 4px;
  vertical-align: middle;
}
