/* ============================================================
   pr244_white_label.css — TradeRail PR244
   White-Label Config — Company Setup → Branding tab
   Namespace: TradeRailPR244
   ============================================================ */

/* ── Shell: full-panel layout matching all other modules ───── */
#tr244-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Page header ────────────────────────────────────────────── */
.tr244-page-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 22px 28px 18px;
  flex-shrink: 0;
}

.tr244-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 2px;
}

.tr244-page-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* ── Tab bar ────────────────────────────────────────────────── */
.tr244-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 28px;
  flex-shrink: 0;
}

.tr244-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}

.tr244-tab:hover { color: #1e293b; }

.tr244-tab.active {
  color: #FF6B00;
  border-bottom-color: #FF6B00;
}

/* ── Scrollable body ────────────────────────────────────────── */
.tr244-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ── Card ───────────────────────────────────────────────────── */
.tr244-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.tr244-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.tr244-card-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
}

/* ── Form fields ────────────────────────────────────────────── */
.tr244-field {
  margin-bottom: 18px;
}

.tr244-field:last-child { margin-bottom: 0; }

.tr244-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.tr244-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}

.tr244-input:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,.12);
}

.tr244-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.tr244-input-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Two-column row ─────────────────────────────────────────── */
.tr244-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tr244-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}

/* ── Logo upload zone ───────────────────────────────────────── */
.tr244-logo-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.tr244-logo-zone:hover,
.tr244-logo-zone.drag-over {
  border-color: #FF6B00;
  background: #fff7f0;
}

.tr244-logo-zone.has-logo {
  border-style: solid;
  border-color: #e2e8f0;
  padding: 16px 24px;
}

.tr244-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
}

.tr244-logo-placeholder-icon {
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr244-logo-placeholder-icon svg {
  width: 24px;
  height: 24px;
  stroke: #94a3b8;
  fill: none;
}

.tr244-logo-placeholder-text {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.tr244-logo-placeholder-sub {
  font-size: 12px;
  color: #94a3b8;
}

.tr244-logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tr244-logo-preview-img {
  max-height: 64px;
  max-width: 200px;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.tr244-logo-preview-info {
  flex: 1;
  text-align: left;
}

.tr244-logo-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.tr244-logo-preview-size {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.tr244-logo-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#tr244-logo-input { display: none; }

/* PIN gate overlay ─────────────────────────────────────────── */
.tr244-pin-gate {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tr244-pin-gate-icon {
  width: 36px;
  height: 36px;
  background: #FF6B00;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tr244-pin-gate-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
}

.tr244-pin-gate-text {
  flex: 1;
}

.tr244-pin-gate-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}

.tr244-pin-gate-sub {
  font-size: 12px;
  color: #b45309;
  margin-top: 2px;
}

/* ── Craft classifications ──────────────────────────────────── */
.tr244-craft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.tr244-craft-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .15s;
}

.tr244-craft-item:hover { border-color: #cbd5e1; }

.tr244-craft-drag-handle {
  cursor: grab;
  color: #94a3b8;
  flex-shrink: 0;
  padding: 2px;
}

.tr244-craft-drag-handle:active { cursor: grabbing; }

.tr244-craft-name {
  flex: 1;
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

.tr244-craft-badge {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tr244-craft-edit-btn,
.tr244-craft-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #94a3b8;
  transition: color .15s, background .15s;
}

.tr244-craft-edit-btn:hover { color: #1e293b; background: #e2e8f0; }
.tr244-craft-delete-btn:hover { color: #ef4444; background: #fee2e2; }

.tr244-craft-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tr244-craft-add-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}

.tr244-craft-add-input:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,.12);
}

/* ── PDF preview mini ───────────────────────────────────────── */
.tr244-pdf-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 12px;
  color: #374151;
  position: relative;
}

.tr244-pdf-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #1A1A2E;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.tr244-pdf-preview-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tr244-pdf-preview-logo-box {
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
}

.tr244-pdf-preview-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tr244-pdf-preview-company {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.tr244-pdf-preview-detail {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.tr244-pdf-preview-right {
  text-align: right;
  font-size: 11px;
  color: #64748b;
}

.tr244-pdf-preview-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tr244-pdf-preview-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

.tr244-pdf-preview-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
}

.tr244-pdf-preview-label {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Toggle rows ────────────────────────────────────────────── */
.tr244-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.tr244-toggle-label {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

.tr244-toggle-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.tr244-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.tr244-toggle input { opacity: 0; width: 0; height: 0; }

.tr244-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s;
}

.tr244-toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.tr244-toggle input:checked + .tr244-toggle-slider { background: #FF6B00; }
.tr244-toggle input:checked + .tr244-toggle-slider:before { transform: translateX(20px); }

/* ── Buttons ────────────────────────────────────────────────── */
.tr244-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.tr244-btn:active { transform: scale(.98); }

.tr244-btn-primary {
  background: #FF6B00;
  color: #fff;
}

.tr244-btn-primary:hover { opacity: .9; }

.tr244-btn-secondary {
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #e2e8f0;
}

.tr244-btn-secondary:hover { background: #e2e8f0; }

.tr244-btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.tr244-btn-danger:hover { background: #fecaca; }

.tr244-btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

/* ── Save bar ───────────────────────────────────────────────── */
.tr244-save-bar {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.tr244-save-status {
  font-size: 13px;
  color: #64748b;
}

.tr244-save-status.saved { color: #16a34a; }
.tr244-save-status.error { color: #dc2626; }

/* ── Toast ──────────────────────────────────────────────────── */
.tr244-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1A1A2E;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  z-index: 9999;
  animation: tr244-slidein .25s ease;
}

.tr244-toast.success { background: #16a34a; }
.tr244-toast.error   { background: #dc2626; }

@keyframes tr244-slidein {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── PIN modal ──────────────────────────────────────────────── */
.tr244-pin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr244-pin-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: min(360px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
}

.tr244-pin-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.tr244-pin-modal-sub {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 20px;
}

.tr244-pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.tr244-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: transparent;
  transition: background .15s, border-color .15s;
}

.tr244-pin-dot.filled {
  background: #FF6B00;
  border-color: #FF6B00;
}

.tr244-pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto 16px;
}

.tr244-pin-key {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  transition: background .1s;
}

.tr244-pin-key:hover { background: #f8fafc; }
.tr244-pin-key:active { background: #f1f5f9; }

.tr244-pin-key.del {
  font-size: 14px;
  color: #64748b;
}

.tr244-pin-error {
  font-size: 13px;
  color: #dc2626;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ── Empty state ────────────────────────────────────────────── */
.tr244-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.tr244-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.tr244-empty-text {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}

/* ── Responsive: hide sidebar on mobile (desktop-only rule) ─── */
@media (max-width: 767px) {
  .tr244-row-2,
  .tr244-row-3 { grid-template-columns: 1fr; }

  .tr244-body { padding: 16px; }

  .tr244-page-header { padding: 16px; }

  .tr244-tabs { padding: 0 16px; overflow-x: auto; }

  .tr244-save-bar { padding: 12px 16px; }
}
