/* ── Open PO — scoped under .app-open-po ─────────────────────────────────── */

.app-open-po {
  --po-primary:    #4F46E5;
  --po-primary-dk: #4338CA;
  --po-success:    #16A34A;
  --po-warning:    #D97706;
  --po-danger:     #DC2626;
  --po-info:       #2563EB;
  --po-bg:         #F3F4F6;
  --po-surface:    #FFFFFF;
  --po-border:     #E5E7EB;
  --po-text:       #111827;
  --po-text-muted: #6B7280;
  --po-radius:     10px;
  --po-radius-sm:  6px;
  --po-shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --po-shadow-lg:  0 10px 25px rgba(0,0,0,.15);

  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Google Sans", system-ui, sans-serif;
  background: var(--po-bg);
  color: var(--po-text);
  line-height: 1.5;
}

.app-open-po button { cursor: pointer; font-family: inherit; font-size: inherit; }
.app-open-po input,
.app-open-po textarea,
.app-open-po select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--po-text);
}

/* ── Page shell ──────────────────────────────────────────────── */

.app-open-po .page {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.app-open-po .content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

/* ── Top bar ─────────────────────────────────────────────────── */

.app-open-po .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--po-primary);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 52px;
  flex-shrink: 0;
}

.app-open-po .top-bar-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-open-po .top-bar-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: .875rem;
  padding: 4px 8px;
  border-radius: var(--po-radius-sm);
  white-space: nowrap;
  min-width: 60px;
}
.app-open-po .top-bar-btn:active { background: rgba(255,255,255,.15); }

.app-open-po .top-bar-spacer { min-width: 60px; }

/* ── Loading / Error screens ─────────────────────────────────── */

.app-open-po .loading-screen,
.app-open-po .error-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.app-open-po .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--po-border);
  border-top-color: var(--po-primary);
  border-radius: 50%;
  animation: po-spin .8s linear infinite;
}
@keyframes po-spin { to { transform: rotate(360deg); } }

.app-open-po .error-text { color: var(--po-danger); font-weight: 500; }

/* ── Onboarding ──────────────────────────────────────────────── */

.app-open-po .onboarding {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--po-primary);
}

.app-open-po .onboarding-card {
  background: var(--po-surface);
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--po-shadow-lg);
  text-align: center;
}

.app-open-po .app-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--po-primary);
  margin-bottom: 8px;
}

.app-open-po .onboarding-subtitle {
  color: var(--po-text-muted);
  margin-bottom: 28px;
}

.app-open-po .storage-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.app-open-po .storage-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 2px solid var(--po-border);
  border-radius: var(--po-radius);
  background: var(--po-bg);
  transition: border-color .15s, background .15s;
}
.app-open-po .storage-option:hover,
.app-open-po .storage-option:active {
  border-color: var(--po-primary);
  background: #EEF2FF;
}

.app-open-po .storage-icon { font-size: 2rem; }
.app-open-po .storage-label { font-weight: 600; font-size: .9rem; }
.app-open-po .storage-desc { font-size: .75rem; color: var(--po-text-muted); }

/* ── Cards ───────────────────────────────────────────────────── */

.app-open-po .card {
  background: var(--po-surface);
  border-radius: var(--po-radius);
  box-shadow: var(--po-shadow);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--po-border);
  width: 100%;
  text-align: left;
}

.app-open-po .po-card {
  display: block;
  cursor: pointer;
  transition: box-shadow .15s;
}
.app-open-po .po-card:active { box-shadow: var(--po-shadow-lg); }

.app-open-po .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.app-open-po .card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-open-po .card-desc {
  font-size: .875rem;
  color: var(--po-text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-open-po .card-meta {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--po-text-muted);
  margin-top: 8px;
}

.app-open-po .card-deadline {
  font-size: .8rem;
  color: var(--po-warning);
}

/* ── Categories ──────────────────────────────────────────────── */

.app-open-po .category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-open-po .category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.app-open-po .category-item-name {
  font-weight: 600;
  font-size: .95rem;
}

/* Tags shown on product items */
.app-open-po .category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}

.app-open-po .category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--po-primary);
  color: #fff;
  opacity: .85;
}

/* Multi-select toggles in product form */
.app-open-po .category-toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.app-open-po .category-toggle {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--po-border);
  background: var(--po-surface);
  color: var(--po-text-muted);
  font-size: .875rem;
  cursor: pointer;
  transition: all .15s;
}

.app-open-po .category-toggle-active {
  border-color: var(--po-primary);
  background: var(--po-primary);
  color: #fff;
}

/* ── Settings ────────────────────────────────────────────────── */

.app-open-po .setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--po-border);
}
.app-open-po .setting-item:last-child { border-bottom: none; }

.app-open-po .setting-label {
  font-weight: 600;
  font-size: .925rem;
  margin-bottom: 2px;
}

.app-open-po .setting-desc {
  font-size: .8rem;
  color: var(--po-text-muted);
}

.app-open-po .btn-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Badges ──────────────────────────────────────────────────── */

.app-open-po .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.app-open-po .badge-sm { padding: 1px 6px; font-size: .7rem; }
.app-open-po .badge-green  { background: #DCFCE7; color: #15803D; }
.app-open-po .badge-red    { background: #FEE2E2; color: #B91C1C; }
.app-open-po .badge-yellow { background: #FEF9C3; color: #A16207; }
.app-open-po .badge-gray   { background: #F3F4F6; color: #6B7280; }
.app-open-po .badge-blue   { background: #DBEAFE; color: #1D4ED8; }

/* ── FAB ─────────────────────────────────────────────────────── */

.app-open-po .fab {
  position: absolute;
  bottom: 24px;
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--po-primary);
  color: #fff;
  font-size: 1.75rem;
  border: none;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: transform .15s, box-shadow .15s;
}
.app-open-po .fab:active { transform: scale(.93); box-shadow: 0 2px 6px rgba(79,70,229,.4); }

/* ── PO Detail ───────────────────────────────────────────────── */

.app-open-po .detail-header { margin-bottom: 16px; }
.app-open-po .detail-desc   { font-size: .9rem; color: var(--po-text-muted); margin-top: 6px; }
.app-open-po .detail-deadline { font-size: .85rem; color: var(--po-warning); margin-top: 4px; }

.app-open-po .stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.app-open-po .stat {
  background: var(--po-surface);
  border-radius: var(--po-radius-sm);
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--po-border);
}
.app-open-po .stat-value { font-size: 1.1rem; font-weight: 700; color: var(--po-primary); }
.app-open-po .stat-label { font-size: .7rem; color: var(--po-text-muted); margin-top: 2px; }

.app-open-po .stat-revenue {
  font-size: .95rem;
  font-weight: 600;
  color: var(--po-success);
  text-align: right;
  margin-bottom: 16px;
}

.app-open-po .section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.app-open-po .section-title {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--po-text-muted);
  margin-bottom: 10px;
  margin-top: 20px;
}

/* ── Product list ────────────────────────────────────────────── */

.app-open-po .product-item {
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.app-open-po .product-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.app-open-po .product-name  { font-weight: 500; }
.app-open-po .product-price { font-weight: 600; color: var(--po-primary); }
.app-open-po .product-stock { font-size: .8rem; color: var(--po-text-muted); }

.app-open-po .variant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.app-open-po .variant-tag {
  font-size: .75rem;
  background: #EEF2FF;
  color: var(--po-primary);
  padding: 2px 6px;
  border-radius: 99px;
}

.app-open-po .product-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

.app-open-po .danger-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--po-border);
}

/* ── Order list ──────────────────────────────────────────────── */

.app-open-po .order-card { margin-bottom: 12px; }

.app-open-po .order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.app-open-po .order-buyer  { font-weight: 600; }
.app-open-po .order-sub    {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.app-open-po .order-phone  { font-size: .85rem; color: var(--po-text-muted); }
.app-open-po .order-address { font-size: .8rem; color: var(--po-text-muted); margin-bottom: 6px; }

.app-open-po .order-items  { margin-bottom: 6px; }
.app-open-po .order-item-line { font-size: .85rem; color: var(--po-text-muted); padding: 2px 0; }

.app-open-po .order-dp     { font-size: .85rem; color: var(--po-warning); margin-bottom: 4px; }
.app-open-po .order-notes  { font-size: .8rem; color: var(--po-text-muted); font-style: italic; margin-bottom: 6px; }

.app-open-po .order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--po-border);
}
.app-open-po .order-total  { font-weight: 700; color: var(--po-primary); }
.app-open-po .order-actions { display: flex; gap: 6px; }

/* ── Buttons ─────────────────────────────────────────────────── */

.app-open-po .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--po-radius-sm);
  font-weight: 500;
  font-size: .9rem;
  border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.app-open-po .btn:active { transform: scale(.97); }
.app-open-po .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.app-open-po .btn-primary  { background: var(--po-primary); color: #fff; }
.app-open-po .btn-primary:not(:disabled):hover { background: var(--po-primary-dk); }

.app-open-po .btn-secondary {
  background: var(--po-surface);
  color: var(--po-text);
  border: 1.5px solid var(--po-border);
}
.app-open-po .btn-secondary:not(:disabled):hover { background: var(--po-border); }

.app-open-po .btn-outline  {
  background: transparent;
  color: var(--po-primary);
  border: 1.5px solid var(--po-primary);
}
.app-open-po .btn-outline:not(:disabled):hover { background: #EEF2FF; }

.app-open-po .btn-danger   { background: var(--po-danger); color: #fff; }
.app-open-po .btn-danger:not(:disabled):hover { background: #B91C1C; }

.app-open-po .btn-block    { width: 100%; }

.app-open-po .btn-sm {
  padding: 5px 12px;
  font-size: .8rem;
  border-radius: var(--po-radius-sm);
  border: 1.5px solid var(--po-border);
  background: var(--po-surface);
  color: var(--po-text);
}
.app-open-po .btn-sm.btn-outline {
  border-color: var(--po-primary);
  color: var(--po-primary);
  background: transparent;
}
.app-open-po .btn-sm.btn-danger {
  border-color: var(--po-danger);
  color: var(--po-danger);
  background: transparent;
}

.app-open-po .btn-icon {
  padding: 4px 8px;
  font-size: .8rem;
  background: transparent;
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius-sm);
  color: var(--po-text-muted);
}
.app-open-po .btn-icon.btn-danger { border-color: var(--po-danger); color: var(--po-danger); }

/* ── Forms ───────────────────────────────────────────────────── */

.app-open-po .form { display: flex; flex-direction: column; gap: 16px; }

.app-open-po .form-field { display: flex; flex-direction: column; gap: 6px; }

.app-open-po .form-label { font-size: .85rem; font-weight: 500; color: var(--po-text); }

.app-open-po .input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--po-border);
  border-radius: var(--po-radius-sm);
  background: var(--po-surface);
  transition: border-color .15s;
  font-size: 1rem;
}
.app-open-po .input:focus {
  outline: none;
  border-color: var(--po-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.app-open-po textarea.input { resize: vertical; min-height: 80px; }

.app-open-po .select-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

.app-open-po .form-section { display: flex; flex-direction: column; gap: 10px; }

.app-open-po .form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-open-po .form-section-label { font-size: .85rem; font-weight: 500; }

.app-open-po .hint { font-size: .8rem; color: var(--po-text-muted); font-style: italic; }

/* Variant form row */
.app-open-po .variant-form-list { display: flex; flex-direction: column; gap: 8px; }
.app-open-po .variant-form-row  {
  display: flex;
  gap: 6px;
  align-items: center;
}
.app-open-po .variant-name-input  { flex: 2; }
.app-open-po .variant-price-input { flex: 1; }

/* Order item form */
.app-open-po .order-item-form-list { display: flex; flex-direction: column; gap: 10px; }
.app-open-po .order-item-form-row  {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  align-items: center;
}
.app-open-po .qty-input { width: 64px; }

/* Radio buttons */
.app-open-po .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.app-open-po .radio-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--po-border);
  background: var(--po-surface);
  font-size: .85rem;
  color: var(--po-text-muted);
  transition: border-color .15s, background .15s;
}
.app-open-po .radio-btn-active {
  border-color: var(--po-primary);
  background: #EEF2FF;
  color: var(--po-primary);
  font-weight: 500;
}

/* ── Settings ────────────────────────────────────────────────── */

.app-open-po .settings-section {
  background: var(--po-surface);
  border-radius: var(--po-radius);
  border: 1px solid var(--po-border);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-open-po .setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
}
.app-open-po .setting-value { font-weight: 500; color: var(--po-text-muted); }

/* ── Alerts ──────────────────────────────────────────────────── */

.app-open-po .alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--po-radius-sm);
  font-size: .875rem;
  font-weight: 500;
}
.app-open-po .alert-success { background: #DCFCE7; color: #15803D; }
.app-open-po .alert-error   { background: #FEE2E2; color: #B91C1C; }
.app-open-po .alert-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: .6;
  padding: 0 4px;
}

/* ── Delete modal ────────────────────────────────────────────── */

.app-open-po .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.app-open-po .modal {
  background: var(--po-surface);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--po-shadow-lg);
}

.app-open-po .modal-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.app-open-po .modal-body  { color: var(--po-text-muted); font-size: .9rem; margin-bottom: 20px; }

.app-open-po .modal-actions {
  display: flex;
  gap: 8px;
}
.app-open-po .modal-actions .btn { flex: 1; }

/* ── Empty state ─────────────────────────────────────────────── */

.app-open-po .empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--po-text-muted);
}
.app-open-po .empty-title    { font-size: 1.05rem; font-weight: 500; margin-bottom: 6px; }
.app-open-po .empty-subtitle { font-size: .875rem; }

/* ── Product prices ──────────────────────────────────────────── */

.app-open-po .product-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.app-open-po .product-price { font-weight: 600; color: var(--po-primary); }
.app-open-po .product-cost  { font-size: .75rem; color: var(--po-text-muted); }

/* ── Recap / Laporan ─────────────────────────────────────────── */

.app-open-po .recap-po-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.app-open-po .recap-finance {
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.app-open-po .recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--po-border);
}
.app-open-po .recap-row:last-child { border-bottom: none; }
.app-open-po .recap-row-label { font-size: .9rem; color: var(--po-text-muted); }
.app-open-po .recap-row-value { font-weight: 600; font-size: .95rem; }

.app-open-po .value-revenue { color: var(--po-primary); }
.app-open-po .value-cost    { color: var(--po-danger); }
.app-open-po .value-profit  { color: var(--po-success); }
.app-open-po .value-margin  { color: var(--po-warning); }

.app-open-po .recap-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.app-open-po .recap-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius-sm);
  padding: 6px 10px;
}
.app-open-po .recap-status-count { font-weight: 700; font-size: .95rem; }

.app-open-po .recap-product-table {
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius);
  overflow: hidden;
  font-size: .82rem;
}

.app-open-po .recap-product-header,
.app-open-po .recap-product-row,
.app-open-po .recap-product-total {
  display: grid;
  grid-template-columns: 1fr 44px 90px 90px;
  gap: 4px;
  align-items: center;
  padding: 9px 12px;
}

.app-open-po .recap-product-header {
  background: var(--po-bg);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--po-text-muted);
  border-bottom: 1px solid var(--po-border);
}

.app-open-po .recap-product-body .recap-product-row {
  border-bottom: 1px solid var(--po-border);
}
.app-open-po .recap-product-body .recap-product-row:last-child {
  border-bottom: none;
}

.app-open-po .recap-product-total {
  background: var(--po-bg);
  border-top: 2px solid var(--po-border);
  font-weight: 700;
}

.app-open-po .col-name  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-open-po .col-qty   { text-align: center; font-weight: 600; }
.app-open-po .col-money { text-align: right; }

/* ── Recap per customer ──────────────────────────────────────── */

.app-open-po .recap-customer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-open-po .recap-customer-card {
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius);
  overflow: hidden;
}

.app-open-po .recap-customer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--po-border);
  background: var(--po-bg);
}

.app-open-po .recap-customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-open-po .recap-customer-name {
  font-weight: 700;
  font-size: .95rem;
}

.app-open-po .recap-customer-phone {
  font-size: .8rem;
  color: var(--po-text-muted);
}

.app-open-po .recap-customer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.app-open-po .recap-customer-order-count {
  font-size: .75rem;
  color: var(--po-text-muted);
}

.app-open-po .recap-customer-items {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-open-po .recap-customer-item-row {
  display: grid;
  grid-template-columns: 1fr 36px 80px;
  gap: 4px;
  align-items: center;
  font-size: .82rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--po-border);
}
.app-open-po .recap-customer-item-row:last-child { border-bottom: none; }

.app-open-po .recap-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--po-text);
}

.app-open-po .recap-item-qty {
  text-align: center;
  font-weight: 600;
  color: var(--po-text-muted);
  font-size: .8rem;
}

.app-open-po .recap-item-price {
  text-align: right;
  font-weight: 500;
}

.app-open-po .recap-customer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  border-top: 2px solid var(--po-border);
  background: var(--po-bg);
}

.app-open-po .recap-customer-total-label {
  font-size: .8rem;
  color: var(--po-text-muted);
  margin-right: auto;
}

.app-open-po .recap-customer-total {
  font-weight: 700;
  font-size: 1rem;
}

.app-open-po .recap-customer-dp {
  font-size: .8rem;
  color: var(--po-warning);
}

/* ── Dashboard nav ───────────────────────────────────────────── */

.app-open-po .dashboard-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Customer list ───────────────────────────────────────────── */

.app-open-po .customer-list { display: flex; flex-direction: column; gap: 10px; }

.app-open-po .customer-card { padding: 14px 16px; text-align: left; }

.app-open-po .customer-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.app-open-po .customer-name { font-weight: 600; font-size: 1rem; }

.app-open-po .customer-phone { font-size: 0.85rem; color: var(--po-text-muted); }

.app-open-po .customer-address {
  font-size: 0.85rem;
  color: var(--po-text-muted);
  margin-bottom: 4px;
}

.app-open-po .customer-notes {
  font-size: 0.82rem;
  color: var(--po-text-muted);
  font-style: italic;
  margin-bottom: 6px;
}

/* ── Hint box ────────────────────────────────────────────────── */

.app-open-po .hint-box {
  padding: 12px 16px;
  background: var(--po-bg);
  border-radius: var(--po-radius-sm);
  margin-bottom: 12px;
}

/* ── Product select list (PO detail) ─────────────────────────── */

.app-open-po .section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
}
.app-open-po .section-title-row .section-title { margin: 0; }

.app-open-po .product-select-list { display: flex; flex-direction: column; gap: 8px; }

.app-open-po .product-select-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--po-surface);
  border: 1.5px solid var(--po-border);
  border-radius: var(--po-radius-sm);
}

.app-open-po .product-select-row-active {
  border-color: var(--po-primary);
  background: #EEF2FF;
}

.app-open-po .product-select-info { flex: 1; min-width: 0; }

.app-open-po .product-select-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.app-open-po .product-select-check {
  font-size: 1rem;
  width: 18px;
  flex-shrink: 0;
  color: var(--po-primary);
  font-weight: 700;
}

.app-open-po .product-select-row:not(.product-select-row-active) .product-select-check {
  color: var(--po-text-muted);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (min-width: 480px) {
  .app-open-po .stats-row { grid-template-columns: repeat(4, 1fr); }
  .app-open-po .modal-overlay { align-items: center; }
  .app-open-po .modal { border-radius: 16px; }
}
