/* صفحه‌ی بسته‌ها و محموله‌های انبار دیجی‌کالا (/digikala-packages) */
.dkp-connection { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr); gap: 14px; align-items: end; padding: 16px; margin-bottom: 16px; }
.dkp-tabs { grid-column: 1 / -1; display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line, #e5e7eb); border-radius: 13px; overflow-x: auto; }
.dkp-tabs button { height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.dkp-tabs button.active { background: #eef2ff; color: #4338ca; }
.dkp-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-inline-start: 6px; padding: 0 5px; border-radius: 6px; background: #4338ca; color: #fff; font-size: 10px; }
.dkp-busy { margin-bottom: 12px; padding: 8px 12px; border-radius: 10px; background: #eff6ff; color: #1d4ed8; font-size: 12px; }

.dkp-meta { display: grid; gap: 10px; padding: 14px 16px; margin-bottom: 16px; }
.dkp-meta > div, .dkp-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dkp-meta small { min-width: 140px; color: var(--muted, #64748b); font-size: 11px; font-weight: 700; }
.dkp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 11px; white-space: nowrap; }
.dkp-chip.is-ok { background: #dcfce7; color: #166534; }
.dkp-chip.is-off { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }

.dkp-filters, .dkp-printbar { display: flex; flex-wrap: wrap; gap: 11px; align-items: end; padding: 14px 16px; margin-bottom: 14px; }
.dkp-filters.inline { padding: 0; margin: 8px 0; }
.dkp-filters .grow, .dkp-filters .field.grow { flex: 1 1 220px; min-width: 0; }
.dkp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.dkp-actions.wrap { margin: 0 0 12px; }
.dkp-report { display: flex; flex-wrap: wrap; gap: 11px; align-items: end; width: 100%; padding-top: 12px; border-top: 1px dashed var(--line, #e5e7eb); }

.dkp-tablebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 6px 12px; color: var(--muted, #64748b); font-size: 12px; }
.dkp-table td { vertical-align: middle; }
.dkp-product { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.dkp-product > div { display: grid; gap: 2px; min-width: 0; }
.dkp-product strong { font-size: 12px; line-height: 1.6; }
.dkp-product small, .dkp-sub { display: block; color: var(--muted, #64748b); font-size: 10px; }
.dkp-qty { width: 90px !important; min-width: 70px !important; direction: ltr; text-align: center; }
.dkp-late { background: #fff7f7; }
.dkp-danger { color: #dc2626; }
.dkp-total td { font-weight: 800; background: #f8fafc; }
.dkp-subrow td { background: #fafcff; }

.dkp-create { display: grid; gap: 18px; padding: 18px; margin-bottom: 16px; }
.dkp-create h3 { margin: 0 0 8px; font-size: 14px; }
.dkp-step { display: flex; gap: 14px; align-items: flex-start; }
.dkp-step > b { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: #eef2ff; color: #4338ca; }
.dkp-step > .grow { flex: 1; min-width: 0; }
.dkp-segmented { max-width: 520px; }
.dkp-note { color: var(--muted, #64748b); font-size: 12px; line-height: 1.9; margin: 6px 0 0; }

.dkp-nature { margin-top: 14px; }
.dkp-nature h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.dkp-warehouses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dkp-warehouse { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; }
.dkp-warehouse header { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dkp-warehouse small { color: var(--muted, #64748b); font-size: 11px; line-height: 1.7; }
.dkp-warehouse.is-full { opacity: .6; }
.dkp-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.dkp-slot { padding: 5px 11px; border: 1px solid #c7d2fe; border-radius: 8px; background: #fff; color: #3730a3; font: inherit; font-size: 12px; cursor: pointer; direction: ltr; }
.dkp-slot:hover:not(:disabled) { background: #eef2ff; }
.dkp-slot.active { background: #4338ca; border-color: #4338ca; color: #fff; }
.dkp-slot:disabled { border-color: #e5e7eb; color: #cbd5e1; cursor: not-allowed; text-decoration: line-through; }
.dkp-submit { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line, #e5e7eb); }

.dkp-packages { display: grid; gap: 10px; }
.dkp-package { overflow: hidden; border-radius: 14px; }
.dkp-package.is-open { border-color: #9dbaf4; }
.dkp-package-head { display: flex; align-items: center; gap: 10px; padding-inline-start: 14px; }
.dkp-package-head > input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.dkp-package-main { all: unset; box-sizing: border-box; flex: 1; display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(4, minmax(110px, 1fr)) auto; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; text-align: right; }
.dkp-package-main small { display: block; color: var(--muted, #64748b); font-size: 10px; font-weight: 700; }
.dkp-package-main strong { display: block; margin-top: 3px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkp-package-main em { display: block; color: var(--muted, #64748b); font-size: 10px; font-style: normal; }
.dkp-package-body { padding: 14px 16px 16px; border-top: 1px solid var(--line, #e5e7eb); background: #fbfcff; }
.dkp-serials { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; font-size: 11px; }
.dkp-serials span { padding: 2px 8px; border-radius: 6px; background: #f1f5f9; font-family: ui-monospace, Consolas, monospace; }

@media (max-width: 950px) {
  .dkp-package-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .dkp-connection { grid-template-columns: 1fr; }
  .dkp-package-main { grid-template-columns: 1fr; }
  .dkp-actions { margin-inline-start: 0; }
  .dkp-step { flex-direction: column; }
}

/* حالت تیره */
html[data-theme="dark"] .dkp-tabs button.active, html[data-theme="dark"] .dkp-step > b { background: #312e81; color: #e0e7ff; }
html[data-theme="dark"] .dkp-chip, html[data-theme="dark"] .dkp-serials span { background: #1e293b; color: #cbd5e1; }
html[data-theme="dark"] .dkp-package-body, html[data-theme="dark"] .dkp-subrow td, html[data-theme="dark"] .dkp-total td { background: #0f172a; }
html[data-theme="dark"] .dkp-late { background: #3b1414; }
html[data-theme="dark"] .dkp-slot { background: transparent; color: #c7d2fe; border-color: #4338ca; }
html[data-theme="dark"] .dkp-busy { background: #172554; color: #bfdbfe; }

/* Webhook */
.dkp-status-cell { display: grid; gap: 3px; justify-items: start; }
.dkp-hook { color: #7c3aed; font-size: 10px; white-space: nowrap; }
.dkp-hook-items { margin: 0 0 12px; }
.dkp-hook-items summary { cursor: pointer; font-size: 12px; font-weight: 800; padding: 6px 0; }
.dkp-hook-url { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dkp-hook-url small { min-width: 150px; color: var(--muted, #64748b); font-weight: 700; }
.dkp-hook-url code { padding: 5px 10px; border-radius: 8px; background: #f1f5f9; font-size: 12px; word-break: break-all; }
html[data-theme="dark"] .dkp-hook-url code { background: #1e293b; color: #e2e8f0; }
