/** product-profile — لایه UI ماژول (روی timcheh.css)
 * قوانین چیدمان (حافظه PM):
 * - شلوغی ممنوع — راهنما فقط آیکون i
 * - هر صفحه یک مسئولیت؛ محتوا نزدیک‌ترین بخش
 * - ثبت: اول فایل، بعد مشخصات
 */

.pp-register-body .drop-grid {
  margin-bottom: var(--tc-space-xl);
}

.pp-register-body .drop-zone {
  min-height: 96px;
}

.pp-register-body .drop-zone-hint {
  display: none;
}

.pp-register-body .product-field textarea {
  min-height: 2.75rem;
  resize: vertical;
}

.pp-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tc-space-md);
  margin-bottom: var(--tc-space-md);
}

.pp-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tc-green-900);
}

.pp-section-label {
  margin: var(--tc-space-lg) 0 var(--tc-space-sm);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tc-green-800);
}

.pp-register-body .product-field {
  margin-bottom: 0;
}

.pp-register-body .product-field label:not(.tc-field-label) {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--tc-green-900);
  margin-bottom: var(--tc-space-xs);
}

.pp-register-body .product-field input,
.pp-register-body .product-field select,
.pp-register-body .product-field textarea {
  width: 100%;
  min-height: var(--tc-input-h);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--tc-bg-muted);
  background: var(--tc-bg-elevated);
  font: inherit;
  font-size: 0.9rem;
}

.pp-page-head {
  border: none;
  border-radius: var(--tc-radius-lg);
  box-shadow: var(--tc-shadow-sm);
}

.panel-head {
  background: var(--tc-bg-subtle);
  font-weight: 700;
}

.btn-primary-custom {
  background: var(--tc-green-600);
  color: var(--tc-text-inverse);
  border-radius: var(--tc-radius-pill);
  font-weight: 700;
  box-shadow: var(--tc-shadow-sm);
  transition: background 0.15s, transform 0.12s;
}

.btn-primary-custom:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary-custom:hover:not(:disabled) {
  background: var(--tc-green-700);
}

.file-card {
  border: none;
  border-radius: var(--tc-radius-md);
  box-shadow: var(--tc-shadow-sm);
}

.design-row {
  border: none;
  border-radius: var(--tc-radius-lg);
  box-shadow: var(--tc-shadow-sm);
}

.meta-modal-dialog {
  border-radius: var(--tc-radius-lg);
  box-shadow: var(--tc-shadow-lg);
}

.preview-modal-dialog {
  border-radius: var(--tc-radius-lg);
}

.toolbar-search,
.product-field input,
.product-field select,
.product-field textarea {
  border-radius: var(--tc-radius-md);
}

* { box-sizing: border-box; }

    .page-wrap {
      max-width: var(--tc-page-max);
      margin: 0 auto;
      padding: 0 1.25rem 3rem;
    }

    /* ——— panels ——— */
    .panel {
      background: var(--tc-bg-elevated);
      border: none;
      border-radius: var(--tc-radius-lg);
      box-shadow: var(--tc-shadow-sm);
      margin-bottom: 1.25rem;
      overflow: hidden;
    }
    .hidden { display: none !important; }
    .panel.hidden { display: none !important; }
    .panel-head {
      padding: 0.85rem 1.1rem;
      font-weight: 700;
      font-size: 0.95rem;
      background: var(--tc-bg-subtle);
      border-bottom: 1px solid var(--tc-bg-muted);
      color: var(--tc-green-900);
    }
    .panel-body { padding: 1.1rem; }

    .meta-line {
      font-size: 0.8rem;
      color: var(--tc-text-muted);
      margin-bottom: 1rem;
    }

    /* ——— drop zones ——— */
    .drop-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.85rem;
    }
    @media (max-width: 560px) { .drop-grid { grid-template-columns: 1fr; } }

    .drop-zone {
      border: 2px dashed var(--tc-green-600);
      border-radius: var(--tc-radius-md);
      background: var(--tc-bg-subtle);
      min-height: 118px;
      padding: 0.85rem;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
      position: relative;
    }
    .drop-zone:hover,
    .drop-zone.dragover {
      border-color: var(--tc-gold);
      background: rgba(168, 137, 74, 0.07);
      box-shadow: inset 0 0 0 1px rgba(168, 137, 74, 0.2);
    }
    .drop-zone-title {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--tc-green-700);
      margin-bottom: 0.25rem;
    }
    .drop-zone-hint {
      font-size: 0.75rem;
      color: var(--tc-text-muted);
    }
    .drop-zone-count {
      font-size: 0.75rem;
      color: var(--tc-green-600);
      margin-top: 0.5rem;
      font-weight: 600;
    }
    .drop-zone input[type="file"] {
      display: none;
    }
    .pp-register-body .tc-field-label span:first-child::after {
      content: none;
    }
    .pp-register-body .product-field:has([required]) .tc-field-label > span:first-child::after {
      content: ' *';
      color: #a33;
      font-weight: 700;
    }
    .drop-zone.required-slot .drop-zone-title::after {
      content: ' *';
      color: #a33;
      font-weight: 700;
    }
    .drop-zone.missing-required {
      border-color: #c45;
      background: var(--tc-bg-elevated)8f8;
    }
    .queue-file-list {
      list-style: none;
      margin: 0.45rem 0 0;
      padding: 0;
      position: relative;
      z-index: 2;
    }
    .queue-file-item {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.72rem;
      background: var(--tc-bg-elevated);
      border: 1px solid rgba(27, 107, 58, 0.2);
      padding: 0.3rem 0.4rem;
      margin-top: 0.35rem;
      border-radius: 6px;
    }
    .queue-file-name {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .queue-file-size {
      color: var(--tc-text-muted);
      flex-shrink: 0;
    }
    .queue-file-remove {
      flex-shrink: 0;
      border: 0;
      background: #fdecea;
      color: #a33;
      width: 1.35rem;
      height: 1.35rem;
      border-radius: 4px;
      cursor: pointer;
      font-size: 1rem;
      line-height: 1;
      padding: 0;
    }
    .queue-file-remove:hover {
      background: #f8c9c4;
    }

    /* ——— buttons ——— */
    .btn-sm-custom {
      background: transparent;
      color: var(--tc-green-700);
      border: 1px solid var(--tc-green-600);
      border-radius: var(--tc-radius-md);
      padding: 0.2rem 0.55rem;
      font-family: inherit;
      font-size: 0.72rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-sm-custom:hover {
      border-color: var(--tc-gold);
      color: var(--tc-gold-hover);
      background: rgba(168, 137, 74, 0.08);
    }
    .btn-sm-custom.success {
      background: var(--tc-green-600);
      color: var(--tc-bg-elevated);
      border-color: var(--tc-green-600);
    }
    .btn-sm-custom.success:hover {
      background: var(--tc-green-700);
      border-color: var(--tc-gold);
    }
    .btn-sm-custom.danger { border-color: #c45; color: #a33; }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.65rem;
      margin-bottom: 0.85rem;
    }
    .toolbar select {
      font-family: inherit;
      font-size: 0.8rem;
      padding: 0.35rem 0.5rem;
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      background: var(--tc-bg-elevated);
      color: var(--tc-text);
    }
    .toolbar-search {
      flex: 1;
      min-width: 10rem;
      max-width: 18rem;
      font-family: inherit;
      font-size: 0.82rem;
      padding: 0.4rem 0.6rem;
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      background: var(--tc-bg-elevated);
      color: var(--tc-text);
    }
    .toolbar-search::placeholder { color: var(--tc-text-muted); }

    /* ——— design rows ——— */
    .design-row {
      background: var(--tc-bg-elevated);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      margin-bottom: 1rem;
      overflow: hidden;
    }
    .design-row-head {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.65rem 1rem;
      background: linear-gradient(to left, var(--tc-bg) 0%, var(--tc-bg-elevated) 100%);
      border-bottom: 1px solid var(--tc-bg-muted);
      flex-wrap: wrap;
    }
    .design-row-title {
      margin: 0;
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--tc-green-900);
      flex: 1;
      min-width: 0;
    }
    .design-row-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      align-items: center;
    }
    .design-select-wrap {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.75rem;
      color: var(--tc-text-muted);
      cursor: pointer;
      user-select: none;
    }
    .design-select-wrap input {
      width: 1rem;
      height: 1rem;
      accent-color: var(--tc-green-600);
      cursor: pointer;
    }
    .design-row.selected {
      border-color: var(--tc-green-600);
      box-shadow: 0 0 0 1px rgba(21, 122, 94, 0.25);
    }

    .bulk-bar {
      display: none;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
      padding: 0.65rem 0.85rem;
      margin-bottom: 0.85rem;
      background: rgba(21, 122, 94, 0.08);
      border: 1px solid var(--tc-green-600);
      border-radius: var(--tc-radius-md);
    }
    .bulk-bar.show { display: flex; }
    .bulk-bar-label {
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--tc-green-900);
      margin-left: 0.25rem;
    }
    .design-row-body {
      padding: 0.85rem 1rem 1rem;
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
    }

    .product-block { margin-bottom: 1.75rem; }
    .product-block:last-child { margin-bottom: 0; }
    .product-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 700;
      font-size: 1rem;
      color: var(--tc-green-900);
      margin-bottom: 0.75rem;
      padding: 0.5rem 0.65rem;
      background: var(--tc-bg);
      border-radius: var(--tc-radius-md);
      border-right: 3px solid var(--tc-green-600);
    }
    .product-count {
      background: var(--tc-green-700);
      color: var(--tc-bg-elevated);
      font-size: 0.7rem;
      padding: 0.1rem 0.45rem;
      border-radius: var(--tc-radius-md);
    }

    .type-badge {
      display: inline-block;
      font-size: 0.62rem;
      padding: 0.1rem 0.35rem;
      border-radius: var(--tc-radius-md);
      background: var(--tc-green-600);
      color: var(--tc-bg-elevated);
      margin-bottom: 0.3rem;
    }

    .product-field {
      margin-bottom: 1rem;
    }
    .product-field label {
      display: block;
      font-weight: 600;
      font-size: 0.85rem;
      color: var(--tc-green-900);
      margin-bottom: 0.35rem;
    }
    .product-field input {
      width: 100%;
      font-family: inherit;
      font-size: 0.9rem;
      padding: 0.55rem 0.65rem;
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      background: var(--tc-bg-subtle);
    }
    .product-field input:focus {
      outline: none;
      border-color: var(--tc-green-600);
      box-shadow: 0 0 0 2px rgba(21, 122, 94, 0.15);
    }
    .product-field select,
    .product-field textarea {
      width: 100%;
      font-family: inherit;
      font-size: 0.9rem;
      padding: 0.55rem 0.65rem;
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      background: var(--tc-bg-subtle);
    }
    .product-field textarea { min-height: 4.5rem; resize: vertical; }
    .product-field select:focus,
    .product-field textarea:focus {
      outline: none;
      border-color: var(--tc-green-600);
      box-shadow: 0 0 0 2px rgba(21, 122, 94, 0.15);
    }
    .product-field textarea::placeholder { color: var(--tc-text-muted); opacity: 0.65; }
    .meta-fields-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem 1rem;
      margin-bottom: 1rem;
      padding: 0.85rem;
      background: var(--tc-bg-subtle);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
    }
    @media (max-width: 560px) { .meta-fields-grid { grid-template-columns: 1fr; } }
    .meta-fields-grid .span-2 { grid-column: 1 / -1; }
    .meta-fields-title {
      grid-column: 1 / -1;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--tc-green-900);
      margin: 0 0 0.15rem;
      padding-bottom: 0.35rem;
      border-bottom: 1px solid var(--tc-bg-muted);
    }
    .category-block {
      margin-bottom: 1rem;
      padding: 0.85rem;
      background: var(--tc-bg-subtle);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
    }
    .category-block .meta-fields-title { border-bottom: 0; padding-bottom: 0; margin-bottom: 0.5rem; }
    .kind-tag.cat-tag { background: var(--tc-green-700); }
    .kind-tag.meta-ok { background: #157A5E; }
    .kind-tag.meta-warn { background: #b8860b; }
    .btn-linkish {
      background: none; border: 0; color: var(--tc-green-600);
      font-family: inherit; font-size: 0.75rem; cursor: pointer; text-decoration: underline;
    }
    .meta-modal {
      position: fixed; inset: 0; z-index: 2000;
      display: flex; align-items: center; justify-content: center; padding: 1rem;
    }
    .meta-modal.hidden { display: none; }
    .meta-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
    .meta-modal-dialog {
      position: relative; z-index: 1; background: var(--tc-bg-elevated); border-radius: var(--tc-radius-md);
      max-width: min(96vw, 560px); width: 100%; padding: 1rem 1.1rem; max-height: 92vh; overflow-y: auto;
      box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    }
    .meta-modal-dialog.wide { max-width: min(96vw, 680px); }
    .edit-section-title {
      font-size: 0.82rem; font-weight: 700; color: var(--tc-green-900);
      margin: 1rem 0 0.5rem; padding-top: 0.65rem; border-top: 1px solid var(--tc-bg-muted);
    }
    .edit-section-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.25rem; }
    .edit-file-group { margin-bottom: 0.75rem; }
    .edit-file-group-head {
      display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
      margin-bottom: 0.35rem;
    }
    .edit-file-group-head label { font-size: 0.78rem; font-weight: 700; color: var(--tc-green-700); }
    .edit-file-row {
      display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
      padding: 0.4rem 0.5rem; background: var(--tc-bg); border-radius: 6px;
      margin-bottom: 0.35rem; font-size: 0.72rem;
    }
    .edit-file-name { flex: 1; min-width: 6rem; direction: ltr; text-align: right; word-break: break-all; }
    .edit-file-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
    .edit-file-actions .btn-sm-custom { padding: 0.2rem 0.45rem; font-size: 0.68rem; }
    .edit-hint { font-size: 0.68rem; color: var(--tc-text-muted); margin: 0.5rem 0 0; }
    .meta-modal-dialog h3 { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--tc-green-900); }
    .meta-modal-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; justify-content: flex-end; }

    .file-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 0.75rem;
    }

    .file-card {
      background: var(--tc-bg-elevated);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      overflow: hidden;
      transition: box-shadow 0.2s, border-color 0.2s;
      width: 148px;
      flex-shrink: 0;
    }
    .file-card:hover {
      border-color: var(--tc-gold);
      box-shadow: 0 2px 8px rgba(168, 137, 74, 0.12);
    }

    .preview-box {
      aspect-ratio: 1;
      background: var(--tc-bg-muted);
      overflow: hidden;
    }
    .preview-box img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center;
      display: block;
    }
    .preview-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      color: var(--tc-text-muted);
      text-align: center;
      padding: 0.5rem;
    }

    .file-card-body { padding: 0.5rem 0.55rem 0.6rem; }
    .file-name {
      font-size: 0.72rem;
      word-break: break-all;
      margin-bottom: 0.35rem;
      line-height: 1.35;
      max-height: 2.7em;
      overflow: hidden;
    }
    .file-meta {
      font-size: 0.68rem;
      color: var(--tc-text-muted);
      margin-bottom: 0.4rem;
    }
    .status-badge {
      display: inline-block;
      font-size: 0.65rem;
      padding: 0.12rem 0.35rem;
      border-radius: var(--tc-radius-md);
      margin-bottom: 0.35rem;
    }
    .st-pending_approval { background: var(--tc-bg-elevated)3CD; color: #664D03; }
    .st-active { background: #D1E7DD; color: #0F5132; }
    .st-rejected { background: #F8D7DA; color: #842029; }
    .st-inactive { background: #E2E3E5; color: #41464B; }
    .st-ready { background: #D1E7DD; color: #0F5132; }
    .st-draft { background: #E2E3E5; color: #41464B; }

    .profile-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }
    .profile-item {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem 0.75rem;
      padding: 0.65rem 0;
      border-bottom: 1px solid #eee;
      font-size: 0.88rem;
    }
    .profile-item:last-child { border-bottom: 0; }
    .profile-id {
      font-weight: 700;
      color: var(--tc-green-900);
      min-width: 3rem;
    }
    .profile-name { flex: 1; min-width: 8rem; }
    .profile-meta {
      font-size: 0.75rem;
      color: var(--tc-text-muted);
    }
    .profile-kinds {
      display: flex;
      gap: 0.35rem;
      flex-wrap: wrap;
    }
    .kind-tag {
      font-size: 0.68rem;
      padding: 0.12rem 0.4rem;
      border-radius: 4px;
      background: var(--tc-bg);
      border: 1px solid var(--tc-bg-muted);
      color: var(--tc-text-muted);
    }
    .kind-tag.ok {
      background: #e8f3ec;
      border-color: rgba(21, 122, 94, 0.25);
      color: var(--tc-green-600);
      font-weight: 600;
    }

    .file-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.25rem;
    }

    .alert-box {
      padding: 0.65rem 0.85rem;
      border-radius: var(--tc-radius-md);
      font-size: 0.85rem;
      margin-top: 0.85rem;
      display: none;
    }
    .alert-box.show { display: block; }
    .alert-box.ok { background: #D1E7DD; color: #0F5132; }
    .alert-box.err { background: #F8D7DA; color: #842029; }

    .empty-folder {
      font-size: 0.82rem;
      color: var(--tc-text-muted);
      padding: 0.5rem 0;
    }

    .preview-box.preview-clickable {
      cursor: zoom-in;
    }

    .preview-modal {
      position: fixed;
      inset: 0;
      z-index: 1050;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.25rem;
    }
    .preview-modal.hidden { display: none; }
    .preview-modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(10, 61, 52, 0.72);
    }
    .preview-modal-dialog {
      position: relative;
      z-index: 1;
      background: var(--tc-bg);
      border-radius: var(--tc-radius-md);
      max-width: min(92vw, 720px);
      max-height: 90vh;
      width: 100%;
      padding: 1rem 1rem 1.25rem;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .preview-modal-close {
      position: absolute;
      top: 0.5rem;
      left: 0.5rem;
      border: none;
      background: var(--tc-green-700);
      color: var(--tc-bg-elevated);
      width: 2rem;
      height: 2rem;
      border-radius: var(--tc-radius-md);
      font-size: 1.25rem;
      line-height: 1;
      cursor: pointer;
    }
    .preview-modal-close:hover {
      background: var(--tc-green-900);
      box-shadow: 0 0 0 2px rgba(168, 137, 74, 0.35);
    }
    .preview-modal-title {
      margin: 0 0 0.75rem;
      font-size: 0.85rem;
      color: var(--tc-green-900);
      text-align: center;
      word-break: break-all;
      max-width: 100%;
    }
    .preview-modal-img-wrap {
      flex: 1;
      min-height: 0;
      width: 100%;
      max-height: calc(90vh - 5rem);
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--tc-bg-elevated);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
      padding: 0.5rem;
    }
    .preview-modal-img-wrap img {
      max-width: 100%;
      max-height: calc(90vh - 6rem);
      object-fit: contain;
      object-position: center;
    }

    .upload-progress {
      margin-top: 0.85rem;
      padding: 0.75rem;
      background: var(--tc-bg);
      border: 1px solid var(--tc-bg-muted);
      border-radius: var(--tc-radius-md);
    }
    .upload-progress.hidden { display: none; }
    .upload-progress-label {
      font-size: 0.85rem;
      margin: 0 0 0.5rem;
      color: var(--tc-green-900);
      font-weight: 600;
    }
    .progress-track {
      height: 10px;
      background: var(--tc-bg-muted);
      border-radius: 999px;
      overflow: hidden;
    }
    .progress-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--tc-green-600), var(--tc-green-500));
      transition: width 0.12s ease-out;
    }
    .progress-steps {
      margin: 0.5rem 0 0;
      padding: 0;
      list-style: none;
      font-size: 0.75rem;
      color: var(--tc-text-muted);
    }
    .progress-steps li.done { color: var(--tc-green-600); font-weight: 600; }
    .progress-steps li.active { color: var(--tc-green-900); font-weight: 600; }

[data-tc-theme="dark"] .card-like {
  background: var(--tc-bg-subtle) !important;
  border-color: var(--tc-bg-muted) !important;
}

[data-tc-theme="dark"] .queue-file-item {
  background: var(--tc-bg-elevated);
  border-color: var(--tc-bg-muted);
}

[data-tc-theme="dark"] .preview-modal-img-wrap {
  background: var(--tc-bg-subtle);
  border-color: var(--tc-bg-muted);
}

.tab-soon-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-pastel-orange);
  color: var(--tc-pastel-orange-fg);
  margin-right: 0.25rem;
  vertical-align: middle;
}

.profile-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-card {
  display: grid;
  grid-template-columns: 3.5rem 4.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--tc-bg-elevated);
  border: 1px solid var(--tc-bg-muted);
  border-radius: var(--tc-radius-md);
  box-shadow: var(--tc-shadow-sm);
}

@media (max-width: 640px) {
  .profile-card {
    grid-template-columns: 3rem 4rem 1fr;
    grid-template-rows: auto auto;
  }
  .profile-col-actions {
    grid-column: 1 / -1;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
  }
}

.profile-col-id {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--tc-green-900);
}

.profile-col-thumb {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--tc-radius-sm);
  overflow: hidden;
  background: var(--tc-bg-subtle);
  border: 1px solid var(--tc-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-thumb-ph {
  font-size: 0.75rem;
  color: var(--tc-text-soft);
}

.profile-name-row {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--tc-text);
  margin-bottom: 0.35rem;
}

.profile-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.profile-col-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.profile-date {
  font-size: 0.72rem;
  color: var(--tc-text-muted);
}

.kind-tag.tag-print { background: var(--tc-pastel-blue); color: var(--tc-pastel-blue-fg); border: none; }
.kind-tag.tag-mockup { background: var(--tc-pastel-mint); color: var(--tc-pastel-mint-fg); border: none; }
.kind-tag.tag-order_form { background: var(--tc-pastel-lavender); color: var(--tc-pastel-lavender-fg); border: none; }
.kind-tag.tag-attachment { background: var(--tc-pastel-lime); color: var(--tc-pastel-lime-fg); border: none; }
.kind-tag.tag-cat { background: var(--tc-pastel-pink); color: var(--tc-pastel-pink-fg); border: none; }

.queue-file-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--tc-bg-muted);
}

.edit-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.edit-file-thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: var(--tc-radius-sm);
  border: 1px solid var(--tc-bg-muted);
  flex-shrink: 0;
}

.edit-file-thumb.hidden { display: none; }

.pp-register-panel {
  max-width: none !important;
  width: calc(100vw - 2rem);
  margin-inline: calc(-1 * max(0px, (100vw - var(--tc-page-max, 960px)) / 2 - 1rem));
}

.pp-register-panel .panel-body {
  padding: 0.85rem 0.5rem;
}

.pp-register-toolbar {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pp-file-btn {
  cursor: pointer;
  margin: 0;
}

.pp-register-table-wrap {
  overflow-x: visible;
  border: 1px solid var(--tc-bg-muted);
  border-radius: var(--tc-radius-md);
  background: var(--tc-bg-elevated);
}

.pp-register-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  min-width: 0;
  table-layout: fixed;
}

.pp-register-table th,
.pp-register-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--tc-bg-muted);
  text-align: right;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.pp-register-table th:nth-child(1),
.pp-register-table td:nth-child(1) { width: 9%; }
.pp-register-table th:nth-child(2),
.pp-register-table td:nth-child(2) { width: 18%; }
.pp-register-table th:nth-child(3),
.pp-register-table td:nth-child(3) { width: 11%; }
.pp-register-table th:nth-child(4),
.pp-register-table td:nth-child(4) { width: 16%; }
.pp-register-table th:nth-child(5),
.pp-register-table td:nth-child(5),
.pp-register-table th:nth-child(6),
.pp-register-table td:nth-child(6),
.pp-register-table th:nth-child(7),
.pp-register-table td:nth-child(7),
.pp-register-table th:nth-child(8),
.pp-register-table td:nth-child(8) { width: 7%; }

.pp-th-sub {
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--tc-green-700);
  opacity: 0.85;
}

.pp-stack-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
}

.pp-id-line {
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--tc-green-900);
}

.pp-product-name-line {
  font-weight: 600;
  line-height: 1.3;
  font-size: 0.68rem;
}

.pp-maahed-product-input,
.pp-maahed-code-input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 1.35rem;
  box-sizing: border-box;
  font-size: 0.62rem;
  line-height: 1.1;
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--tc-bg-muted);
  border-radius: 3px;
}

.pp-register-table th {
  background: var(--tc-bg-subtle);
  font-weight: 700;
  color: var(--tc-green-900);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pp-register-table tbody tr:hover {
  background: #faf8f4;
}

.pp-col-copy-btn,
.pp-row-copy-btn {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--tc-bg-muted);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: var(--tc-green-800);
  font-weight: 600;
}

.pp-col-copy-btn:hover,
.pp-row-copy-btn:hover {
  background: var(--tc-bg-subtle);
}

.pp-group-cell {
  background: #f7f4ef;
  vertical-align: top;
  border-right: 1px solid #e8e0d4;
}

.pp-register-group-first td:not(.pp-group-cell) {
  border-top: 2px solid #c5d9c8;
}

.pp-register-variant-row + .pp-register-group-first td,
.pp-register-group-first td {
  border-top: 2px solid #c5d9c8;
}

.pp-maahed-product-input.pp-saved-flash {
  border-color: var(--tc-green-600);
  background: #f0faf4;
}

.pp-maahed-code-input.pp-saved-flash {
  border-color: var(--tc-green-600);
  background: #f0faf4;
}

.pp-mockup-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: none;
  white-space: normal;
}

.pp-mockup-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--tc-bg-muted);
  flex-shrink: 0;
}

.pp-mockup-links {
  font-size: 0.62rem;
  line-height: 1.25;
}

.pp-product-info-td,
.pp-product-id-td,
.pp-variant-id-td {
  vertical-align: top;
}

.pp-mockup-td {
  min-width: 0;
}

.pp-import-modal-dialog {
  max-width: min(96vw, 520px);
}

.pp-import-file-name {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--tc-green-800);
  word-break: break-all;
}

.pp-import-modal-body {
  max-height: min(50vh, 320px);
  overflow-y: auto;
}

.pp-import-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
}

.pp-import-stats div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--tc-bg-muted);
}

.pp-import-stats dt {
  margin: 0;
  font-weight: 600;
  color: var(--tc-green-900);
}

.pp-import-stats dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.pp-import-error-title {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #a33;
}

.pp-import-error-list {
  margin: 0;
  padding-right: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #822;
  max-height: 12rem;
  overflow-y: auto;
}

.pp-import-ok-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--tc-green-800);
}

.pp-edit-cancel-btn {
  display: none;
}

.pp-edit-cancel-btn.is-visible {
  display: inline-block;
}

.pp-register-toolbar .upload-progress {
  margin: 0.35rem 0 0.5rem;
}

.pp-edit-mode-btn.is-active {
  background: var(--tc-green-800);
  color: #fff;
  border-color: var(--tc-green-800);
}

.pp-maahed-product-input.pp-input-locked,
.pp-maahed-code-input.pp-input-locked {
  background: #f3f3f3;
  cursor: not-allowed;
  opacity: 0.85;
}

.pp-import-hub-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.pp-import-hub-actions .btn-sm-custom,
.pp-import-hub-actions .btn-primary-custom {
  width: 100%;
  text-align: right;
}

.pp-import-audit-details {
  margin-top: 0.5rem;
  font-size: 0.72rem;
}

.pp-import-audit-list {
  margin: 0.35rem 0 0;
  padding-right: 1rem;
  max-height: 8rem;
  overflow-y: auto;
}

.pp-import-audit-list li {
  margin-bottom: 0.25rem;
}

.pp-import-modal-dialog .hidden,
.pp-import-hub-step.hidden,
.pp-import-modal-body.hidden {
  display: none;
}

.ob-reject-banner {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
  border-radius: 8px;
  color: #842029;
  font-size: 0.9rem;
  line-height: 1.45;
}
.ob-reject-banner.hidden { display: none !important; }
.profile-reject-line {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #842029;
  line-height: 1.4;
}
.profile-card-reject {
  border-color: #f1aeb5;
  background: #fff8f8;
}
.status-badge.st-needs_revision,
.status-badge.st-approval.st-needs_revision {
  background: #f8d7da;
  color: #842029;
}
.status-badge.st-publish_failed {
  background: #fff3cd;
  color: #856404;
}
.status-badge.st-publish_requested {
  background: #cfe2ff;
  color: #084298;
}
.status-badge.st-warehouse_approved {
  background: #d4edda;
  color: #155724;
}

