* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: repeating-linear-gradient(135deg, #1e2320 0px, #1e2320 2px, #202521 2px, #202521 4px);
  color: #edeae0;
  font-family: 'Inter', sans-serif;
  padding-bottom: 60px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 10px;
}

/* Header */

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #ff8a4c;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.title {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.subtitle {
  margin: 8px 0 0;
  color: #9ca39a;
  font-size: 13px;
  max-width: 520px;
}

/* Stamp seal */

.stamp-seal {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid #ff6a1f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotate(-8deg);
  color: #ff6a1f;
  font-family: 'Oswald', sans-serif;
  flex-shrink: 0;
  position: relative;
  opacity: 0.95;
  transition: border-color .2s ease, color .2s ease;
}

.stamp-seal.done {
  border-color: #4caf7d;
  color: #4caf7d;
}

.stamp-seal-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed currentColor;
  opacity: 0.5;
}

.stamp-seal-pct {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.stamp-seal-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* Stats grid */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  padding: 16px;
}

.stat-item-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #9ca39a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-item-detail {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  margin-top: 4px;
  color: #c9c2b2;
}

/* Tape progress */

.tape-progress {
  position: relative;
  height: 14px;
  background: #12140f;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #3b423c;
}

.tape-progress-fill {
  height: 100%;
  transition: width .4s ease;
}

.tape-progress-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1px;
}

.tape-progress-tick {
  width: 1px;
  background: rgba(0,0,0,0.25);
  align-self: center;
}

.tape-progress-tick.major {
  height: 100%;
}

.tape-progress-tick.minor {
  height: 55%;
}

/* Filter bar */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  padding: 12px;
}

.input-search {
  flex: 1 1 220px;
  background: #1e2320;
  border: 1px solid #3b423c;
  border-radius: 5px;
  padding: 9px 12px;
  color: #edeae0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  outline: none;
}

.select-filter {
  background: #1e2320;
  border: 1px solid #3b423c;
  border-radius: 5px;
  padding: 9px 10px;
  color: #edeae0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.incomplete-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #c9c2b2;
  font-family: 'IBM Plex Mono', monospace;
  cursor: pointer;
  user-select: none;
}

.incomplete-label input {
  accent-color: #ff6a1f;
  width: 15px;
  height: 15px;
}

.reset-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid #6b3a24;
  color: #ff8a4c;
  border-radius: 5px;
  padding: 9px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reset-btn:hover {
  background: rgba(255, 106, 31, 0.08);
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #9ca39a;
  font-family: 'IBM Plex Mono', monospace;
  border: 1px dashed #3b423c;
  border-radius: 8px;
}

/* Collection section */

.collection-section {
  margin-bottom: 18px;
}

.collection-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #2f352f, #262b27);
  border: 1px solid #3b423c;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.collection-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.collection-title {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: #edeae0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.collection-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #8b9186;
}

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

.collection-progress-track {
  width: 140px;
}

.collection-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  width: 40px;
  text-align: right;
}

.chevron {
  color: #9ca39a;
  transition: transform .15s ease;
  display: inline-block;
}

.chevron.open {
  transform: rotate(180deg);
}

.collection-body {
  margin-top: 10px;
  display: none;
}

.collection-body.open {
  display: block;
}

/* Product card */

.product-card {
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}


.product-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 12px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  position: relative;
}

.product-header::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e2320;
  border: 1px solid #3b423c;
}

.product-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-name {
  color: #edeae0;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-model {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #8b9186;
}

.product-variant-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #5b6158;
  background: #1e2320;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

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

.product-progress-track {
  width: 90px;
}

.product-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  width: 34px;
  text-align: right;
}

.product-body {
  border-top: 1px dashed #3b423c;
  display: none;
}

.product-body.open {
  display: block;
}

.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 10px 22px;
  border-bottom: 1px solid #232722;
  flex-wrap: wrap;
}

.variant-row:last-child {
  border-bottom: none;
}

.variant-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.variant-sku {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #c9c2b2;
  background: #1e2320;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid #3b423c;
  white-space: nowrap;
}

.priority-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.priority-badge.p-nowosc {
  background: #f4c430;
  color: #1c1f1a;
}

.priority-badge.p-polecane {
  background: #4caf7d;
  color: #0c1a12;
}

.priority-badge.p-standard {
  background: transparent;
  color: #9ca39a;
  border: 1px solid #4a514a;
}

.variant-checks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.check-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 58px;
}

.check-item-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  line-height: 1.25;
  color: #8b9186;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* Stamp checkbox */

.stamp-checkbox {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px dashed #6b7268;
  background: transparent;
  color: #8b9186;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  flex-shrink: 0;
  padding: 0;
}

.stamp-checkbox.checked {
  border: 2px solid #ff6a1f;
  background: radial-gradient(circle at 35% 30%, #ff8a4c, #ff6a1f 55%, #d94e0d 100%);
  color: #1c1f1a;
  transform: rotate(-6deg) scale(1.02);
  box-shadow: 0 0 0 3px rgba(255,106,31,0.15);
}

.stamp-checkbox:active {
  transform: scale(0.9);
}

/* Topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  margin-bottom: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.topbar-user {
  color: #8b9186;
}

.topbar-link {
  color: #ff8a4c;
  text-decoration: none;
}

.topbar-user {
  margin-right: auto;
}

.topbar-link:hover {
  text-decoration: underline;
}

/* Auth pages */

.auth-wrap {
  min-height: 100vh;
  background: repeating-linear-gradient(135deg, #1e2320 0px, #1e2320 2px, #202521 2px, #202521 4px);
  color: #edeae0;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  padding: 28px 26px;
}

.auth-title {
  margin: 0 0 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.auth-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca39a;
  display: block;
}

.auth-submit {
  width: 100%;
  text-align: center;
  margin-left: 0 !important;
  margin-top: 4px;
}

/* Flash messages */

.flash {
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid;
  line-height: 1.5;
}

.flash-success {
  background: rgba(76, 175, 125, 0.1);
  border-color: #3a8a63;
  color: #7fd6ab;
}

.flash-error {
  background: rgba(255, 106, 31, 0.1);
  border-color: #6b3a24;
  color: #ff8a4c;
}


/* Admin panel */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.admin-card {
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  padding: 20px;
}

.admin-card-title {
  margin: 0 0 14px;
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #edeae0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-table-wrap {
  background: #262b27;
  border: 1px solid #3b423c;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  color: #9ca39a;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #3b423c;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #232722;
  color: #c9c2b2;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table-actions {
  display: flex;
  gap: 12px;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: rgba(76, 175, 125, 0.15);
  color: #4caf7d;
}

.status-pending {
  background: rgba(244, 196, 48, 0.15);
  color: #f4c430;
}

.link-btn {
  background: transparent;
  border: none;
  color: #ff8a4c;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-btn-danger {
  color: #e0554a;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.collections-settings-table th,
.collections-settings-table td {
  text-align: center;
}

.collections-settings-table th:first-child,
.collections-settings-table td:first-child {
  text-align: left;
}

.collections-settings-table .checkbox-cell input {
  width: 16px;
  height: 16px;
  accent-color: #ff6a1f;
  cursor: pointer;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: #262b27;
  white-space: nowrap;
}

.loading-screen {
  min-height: 100vh;
  background: #1e2320;
  color: #edeae0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
}

/* Footer */

.site-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px dashed #3b423c;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #5b6158;
  text-align: center;
}

.site-footer .build {
  color: #3f453f;
}
