/* ──────────── MODALS ──────────── */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s var(--ease);
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.admin-modal {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: var(--sh-lg);
  animation: modalSlideUp 0.25s var(--ease-out);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.admin-modal::-webkit-scrollbar { width: 4px; }
.admin-modal::-webkit-scrollbar-track { background: transparent; }
.admin-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.admin-modal-close {
  background: var(--bg-input);
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-tertiary);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.admin-modal-close .lucide { width: 18px; height: 18px; }
.admin-modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ──────────── HUBSPOT-INSPIRED DETAIL MODALS ──────────── */
.admin-modal.hs-modal {
  max-width: 1200px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-modal.hs-modal.hs-modal-wide {
  max-width: 1600px;
  width: 96vw;
}

.admin-modal.hs-modal.hs-modal-compact {
  max-width: 620px;
}
.admin-modal.hs-modal.hs-modal-compact .hs-form {
  padding: 24px 28px;
  border-top: none;
}

.admin-modal.hs-modal.hs-modal-wide .hs-body {
  grid-template-columns: 1fr 400px;
}
.admin-modal.hs-modal.hs-modal-wide .hs-main {
  padding: 28px 36px;
}
.admin-modal.hs-modal.hs-modal-wide .hs-sidebar {
  padding: 24px 28px;
}

.hs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  gap: 14px;
}
.hs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.hs-header-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hs-header-icon .lucide { width: 20px; height: 20px; }
.hs-header-icon.blue { background: var(--info-bg); color: var(--info); }
.hs-header-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.hs-header-icon.green { background: var(--success-bg); color: var(--success); }
.hs-header-icon.red { background: var(--danger-bg); color: var(--danger); }
.hs-header-icon.purple { background: var(--purple-bg); color: var(--purple); }
.hs-header-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.hs-header-sub {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 1px;
}
.hs-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hs-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.hs-main {
  overflow-y: auto;
  padding: 28px 36px;
  border-right: 1px solid var(--border);
  min-height: 0;
}
.hs-main::-webkit-scrollbar { width: 3px; }
.hs-main::-webkit-scrollbar-track { background: transparent; }
.hs-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hs-sidebar {
  overflow-y: auto;
  padding: 24px 26px;
  background: var(--bg-input);
  min-height: 0;
}
.hs-sidebar::-webkit-scrollbar { width: 3px; }
.hs-sidebar::-webkit-scrollbar-track { background: transparent; }
.hs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.hs-section { margin-bottom: 22px; }
.hs-section:last-child { margin-bottom: 0; }
.hs-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hs-section-title .lucide { width: 13px; height: 13px; }

.hs-props { display: grid; gap: 0; }
.hs-prop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}
.hs-prop:last-child { border-bottom: none; }
.hs-prop-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 600;
  flex-shrink: 0;
}
.hs-prop-value {
  font-size: 0.84rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}
.hs-prop-value a { color: var(--info); text-decoration: none; }
.hs-prop-value a:hover { text-decoration: underline; }

.hs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.hs-card:last-child { margin-bottom: 0; }
.hs-card-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hs-card-title .lucide { width: 13px; height: 13px; }

.hs-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
}
.hs-status .lucide { width: 14px; height: 14px; }
.hs-status.pending { background: var(--warning-bg); color: #b45309; }
.hs-status.confirmed { background: var(--success-bg); color: var(--success); }
.hs-status.processing { background: var(--info-bg); color: var(--info); }
.hs-status.shipped { background: var(--purple-bg); color: var(--purple); }
.hs-status.delivered { background: var(--success-bg); color: var(--success); }
.hs-status.cancelled { background: var(--danger-bg); color: var(--danger); }
.hs-status.paid { background: var(--success-bg); color: var(--success); }
.hs-status.failed { background: var(--danger-bg); color: var(--danger); }
.hs-status.refunded { background: var(--purple-bg); color: var(--purple); }
.hs-status.approved { background: var(--success-bg); color: var(--success); }
.hs-status.rejected { background: var(--danger-bg); color: var(--danger); }
.hs-status.completed { background: var(--info-bg); color: var(--info); }
.hs-status.new { background: var(--warning-bg); color: #b45309; }
.hs-status.read { background: var(--info-bg); color: var(--info); }
.hs-status.replied { background: var(--success-bg); color: var(--success); }
.hs-status.active { background: var(--success-bg); color: var(--success); }
.hs-status.inactive { background: var(--danger-bg); color: var(--danger); }

.hs-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.hs-items-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.hs-items-table th:last-child { text-align: right; }
.hs-items-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.hs-items-table td:last-child { text-align: right; font-weight: 600; }
.hs-items-table tbody tr:last-child td { border-bottom: none; }
.hs-items-sku {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: block;
}

.hs-totals {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
  font-size: 0.84rem;
}
.hs-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hs-totals-row.grand {
  font-weight: 800;
  font-size: 1.02rem;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.hs-notes { max-height: 200px; overflow-y: auto; }
.hs-note {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}
.hs-note:last-child { border-bottom: none; }
.hs-note-meta {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hs-note-text { color: var(--text-primary); line-height: 1.5; }
.hs-note-input { display: flex; gap: 8px; margin-top: 8px; }
.hs-note-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.hs-note-input input:focus { border-color: var(--brand); }

.hs-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.hs-quick-stat {
  text-align: center;
  padding: 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.hs-quick-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.hs-quick-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.hs-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.hs-actions .admin-btn { width: 100%; justify-content: center; }

.hs-address {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.hs-stock-restored {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 10px;
}
.hs-stock-restored.yes { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: var(--success); }
.hs-stock-restored.no { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }
.hs-stock-restored .lucide { width: 16px; height: 16px; }

.hs-message-body {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.88rem;
  color: var(--text-primary);
  padding: 12px 0;
}

.hs-reply { margin-top: 14px; }
.hs-reply textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.hs-reply textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.hs-form {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.hs-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hs-form label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.hs-form select,
.hs-form input,
.hs-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.hs-form select:focus,
.hs-form input:focus,
.hs-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

