/**
 * HP FlashQuote — Design System
 * Brand palette aligned with HP's visual identity: bold blue, clean whites, dark accents.
 */

:root {
  --hp-blue: #0096d6;
  --hp-blue-hover: #007ab8;
  --hp-blue-active: #006899;
  --hp-blue-muted: #e8f4fb;
  --hp-blue-ring: rgba(0, 150, 214, 0.30);
  --hp-blue-dark: #004d73;

  --hp-ink: #0d1b2a;
  --hp-ink-secondary: #475569;
  --hp-ink-muted: #94a3b8;
  --hp-border: #cbd5e1;
  --hp-border-light: #e2e8f0;
  --hp-surface: #ffffff;
  --hp-bg: #f1f5f9;

  --hp-sidebar-bg: #0d1b2a;
  --hp-sidebar-hover: rgba(0, 150, 214, 0.12);
  --hp-sidebar-active: rgba(0, 150, 214, 0.18);
  --hp-sidebar-text: rgba(255, 255, 255, 0.75);
  --hp-sidebar-text-active: #ffffff;
  --hp-sidebar-width: 260px;
  --hp-sidebar-collapsed-width: 68px;

  --hp-danger: #dc2626;
  --hp-danger-bg: #fef2f2;
  --hp-success: #16a34a;
  --hp-success-bg: #f0fdf4;
  --hp-warning: #ca8a04;
  --hp-warning-bg: #fefce8;

  --hp-radius-sm: 6px;
  --hp-radius: 8px;
  --hp-radius-lg: 12px;
  --hp-radius-pill: 9999px;

  --hp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --hp-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --hp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --hp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --hp-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.hp-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--hp-font);
  color: var(--hp-ink);
  background: var(--hp-bg);
  line-height: 1.55;
}

/* ================================================================
   SIDEBAR
   ================================================================ */

.hp-has-sidebar {
  display: flex;
  min-height: 100vh;
}

.hp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--hp-sidebar-width);
  background: var(--hp-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--hp-transition);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.hp-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 1rem;
  flex-shrink: 0;
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hp-sidebar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}

.hp-sidebar-logo {
  width: 100%;
  max-width: 120px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  transition: max-width var(--hp-transition);
}

.hp-sidebar-toggle {
  background: none;
  border: none;
  color: var(--hp-sidebar-text);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hp-radius-sm);
  transition: background var(--hp-transition), color var(--hp-transition), transform var(--hp-transition);
  flex-shrink: 0;
  padding: 0;
}

.hp-sidebar-toggle svg { width: 18px; height: 18px; }

.hp-sidebar-toggle:hover {
  background: var(--hp-sidebar-hover);
  color: #fff;
}

/* Navigation */
.hp-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.hp-sidebar-section {
  margin-bottom: 0.5rem;
  padding: 0 0.625rem;
}

.hp-sidebar-section-label {
  display: block;
  padding: 0.5rem 0.625rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hp-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--hp-transition);
}

.hp-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.625rem;
  color: var(--hp-sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--hp-radius);
  transition: background var(--hp-transition), color var(--hp-transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.hp-sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--hp-transition);
}

.hp-sidebar-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--hp-transition);
}

.hp-sidebar-link:hover {
  background: var(--hp-sidebar-hover);
  color: var(--hp-sidebar-text-active);
}

.hp-sidebar-link:hover svg { opacity: 1; }

.hp-sidebar-link--active {
  background: var(--hp-sidebar-active);
  color: var(--hp-sidebar-text-active);
}

.hp-sidebar-link--active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--hp-blue);
}

.hp-sidebar-link--active svg { opacity: 1; color: var(--hp-blue); }

.hp-sidebar-tree {
  margin: 0;
}

.hp-sidebar-tree__summary {
  list-style: none;
  cursor: pointer;
}

.hp-sidebar-tree__summary::-webkit-details-marker {
  display: none;
}

.hp-sidebar-tree__caret {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.85;
  transition: transform var(--hp-transition);
}

.hp-sidebar-tree[open] .hp-sidebar-tree__caret {
  transform: rotate(90deg);
}

.hp-sidebar-tree__children {
  margin-left: 1.2rem;
}

.hp-sidebar-link--child {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.hp-sidebar-link--sm { font-size: 0.8rem; padding: 0.4rem 0.625rem; }
.hp-sidebar-link--danger { color: rgba(239, 68, 68, 0.8); }
.hp-sidebar-link--danger:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

/* Footer / User */
.hp-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
}

.hp-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.35rem;
  overflow: hidden;
}

.hp-sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--hp-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hp-sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--hp-transition);
}

.hp-sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-sidebar-user-email {
  font-size: 0.7rem;
  color: var(--hp-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-sidebar-footer-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.125rem;
  margin-top: 0.35rem;
}

/* Collapsed state */
.hp-sidebar-collapsed .hp-sidebar {
  width: var(--hp-sidebar-collapsed-width);
}

.hp-sidebar-collapsed .hp-sidebar-logo {
  max-width: 36px;
}

.hp-sidebar-collapsed .hp-sidebar-section-label,
.hp-sidebar-collapsed .hp-sidebar-link-text,
.hp-sidebar-collapsed .hp-sidebar-user-info,
.hp-sidebar-collapsed .hp-sidebar-tree__caret {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.hp-sidebar-collapsed .hp-sidebar-tree__children {
  display: none;
}

.hp-sidebar-collapsed .hp-sidebar-toggle {
  transform: rotate(180deg);
}

.hp-sidebar-collapsed .hp-sidebar-top {
  justify-content: center;
  padding: 1.25rem 0.5rem 1rem;
}

.hp-sidebar-collapsed .hp-sidebar-brand { justify-content: center; }
.hp-sidebar-collapsed .hp-sidebar-link { justify-content: center; padding: 0.55rem; }
.hp-sidebar-collapsed .hp-sidebar-link--active::before { display: none; }
.hp-sidebar-collapsed .hp-sidebar-user { justify-content: center; }
.hp-sidebar-collapsed .hp-sidebar-footer-actions { justify-content: center; }

.hp-sidebar-collapsed .hp-content-wrapper {
  margin-left: var(--hp-sidebar-collapsed-width);
}

/* Overlay (mobile) */
.hp-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ================================================================
   CONTENT WRAPPER + TOPBAR
   ================================================================ */

.hp-content-wrapper {
  flex: 1;
  margin-left: var(--hp-sidebar-width);
  transition: margin-left var(--hp-transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.hp-topbar {
  background: var(--hp-surface);
  border-bottom: 1px solid var(--hp-border-light);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.hp-topbar.hp-topbar--mobile-only { display: none; }

.hp-topbar-menu {
  display: none;
  background: none;
  border: none;
  color: var(--hp-ink);
  cursor: pointer;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--hp-radius);
  padding: 0;
  transition: background var(--hp-transition);
}

.hp-topbar-menu svg { width: 22px; height: 22px; }
.hp-topbar-menu:hover { background: var(--hp-bg); }

.hp-topbar-breadcrumb {
  flex: 1;
  font-size: 0.875rem;
  color: var(--hp-ink-muted);
}

.hp-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hp-topbar-greeting {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hp-ink-secondary);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */

.hp-main {
  flex: 1;
  padding: 1.5rem;
}

.hp-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hp-container:has(> .hp-panel--wide) { max-width: 100%; }

.hp-panel {
  background: var(--hp-surface);
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow);
  border: 1px solid var(--hp-border-light);
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .hp-panel { padding: 2rem; }
}

.hp-panel--auth {
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

.hp-panel--wide { max-width: 100%; }

/* ================================================================
   GUEST LAYOUT (login, signup, password reset)
   ================================================================ */

.hp-body--guest {
  background: var(--hp-sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-guest-main {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.hp-guest-wrapper {
  width: 100%;
  max-width: 26rem;
}

.hp-guest-brand {
  text-align: center;
  margin-bottom: 0;
}

.hp-guest-logo {
  width: 220px;
  height: auto;
}

.hp-body--guest .hp-panel {
  border: none;
  box-shadow: var(--hp-shadow-xl);
}

/* ================================================================
   TYPOGRAPHY
   ================================================================ */

.hp-page-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hp-ink);
}

.hp-page-title::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--hp-blue);
  border-radius: var(--hp-radius-pill);
  margin-top: 0.5rem;
}

.hp-lead {
  margin: 0 0 1.25rem 0;
  color: var(--hp-ink-secondary);
  font-size: 0.9rem;
  max-width: 52ch;
}

.hp-muted {
  color: var(--hp-ink-muted);
  font-size: 0.875rem;
}

/* ================================================================
   FLASH MESSAGES
   ================================================================ */

.hp-flash-list {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}

.hp-flash {
  position: relative;
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  border-radius: var(--hp-radius);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 4px solid var(--hp-blue);
  background: var(--hp-blue-muted);
  color: var(--hp-ink);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hp-flash.hp-flash--hiding {
  opacity: 0;
  transform: translateY(-8px);
}
.hp-flash__close {
  position: absolute;
  top: 0; right: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.6rem 0.65rem;
  line-height: 1;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.5;
}
.hp-flash__close:hover { opacity: 1; }

.hp-flash--success { border-left-color: var(--hp-success); background: var(--hp-success-bg); }
.hp-flash--error { border-left-color: var(--hp-danger); background: var(--hp-danger-bg); }

/* ================================================================
   FORMS
   ================================================================ */

.hp-form .hp-field { margin-bottom: 1rem; }

.hp-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .hp-field-row { grid-template-columns: repeat(3, 1fr); }
}

.hp-form label,
.hp-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hp-ink-secondary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hp-form input[type="text"],
.hp-form input[type="email"],
.hp-form input[type="password"],
.hp-form input[type="url"],
.hp-form input[type="number"],
.hp-form textarea,
.hp-form select,
.hp-panel input[type="text"],
.hp-panel input[type="email"],
.hp-panel input[type="password"],
.hp-panel input[type="url"],
.hp-panel input[type="number"],
.hp-panel textarea,
.hp-panel select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  background: var(--hp-surface);
  color: var(--hp-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hp-form input:focus,
.hp-form textarea:focus,
.hp-form select:focus,
.hp-panel input:focus,
.hp-panel textarea:focus,
.hp-panel select:focus {
  outline: none;
  border-color: var(--hp-blue);
  box-shadow: 0 0 0 3px var(--hp-blue-ring);
}

.hp-form .errorlist,
.hp-field .errorlist {
  margin: 0.3rem 0 0 0;
  padding: 0;
  list-style: none;
  color: var(--hp-danger);
  font-size: 0.78rem;
}

.hp-field-hint {
  margin: 0.3rem 0 0 0;
  font-size: 0.75rem;
  color: var(--hp-ink-muted);
}

.hp-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hp-checkbox-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--hp-blue);
  cursor: pointer;
}

.hp-checkbox-row label {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  cursor: pointer;
  color: var(--hp-ink);
}

/* ================================================================
   BUTTONS
   ================================================================ */

.hp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--hp-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--hp-transition), color var(--hp-transition), box-shadow var(--hp-transition), transform 0.1s ease;
}

.hp-btn:active { transform: scale(0.98); }

.hp-btn--primary {
  background: var(--hp-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 150, 214, 0.3);
}

.hp-btn--primary:hover { background: var(--hp-blue-hover); color: #fff; }

.hp-btn--secondary {
  background: transparent;
  color: var(--hp-blue);
  border: 1.5px solid var(--hp-blue);
}

.hp-btn--secondary:hover { background: var(--hp-blue-muted); color: var(--hp-blue-active); }

.hp-btn--ghost {
  background: transparent;
  color: var(--hp-ink-secondary);
}

.hp-btn--ghost:hover { background: var(--hp-bg); color: var(--hp-ink); }

.hp-btn--danger {
  background: var(--hp-danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.hp-btn--danger:hover { background: #b91c1c; color: #fff; }

a.hp-btn--primary,
a.hp-btn--secondary { display: inline-flex; }

@keyframes spin { to { transform: rotate(360deg); } }

.hp-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.hp-btn--secondary .hp-btn-spinner {
  border-color: rgba(0,150,214,0.25);
  border-top-color: var(--hp-blue);
}
.hp-btn--ghost .hp-btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--hp-ink-secondary);
}

/* ================================================================
   LINKS
   ================================================================ */

.hp-link {
  color: var(--hp-blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hp-link:hover { color: var(--hp-blue-hover); border-bottom-color: var(--hp-blue-hover); }
.hp-link--danger { color: var(--hp-danger); }
.hp-link--danger:hover { color: #b91c1c; border-bottom-color: #b91c1c; }

a.btn-link { color: var(--hp-blue); font-weight: 600; text-decoration: none; }
a.btn-link:hover { text-decoration: underline; }
a.btn-link.danger { color: var(--hp-danger); }

/* ================================================================
   FAVORITE STAR
   ================================================================ */

.hp-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--hp-border-light);
  transition: color 0.15s;
  padding: 0;
  line-height: 1;
}

.hp-fav-btn:hover { color: #facc15; }
.hp-fav-btn--active { color: #facc15; }

.hp-checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ================================================================
   TABLES
   ================================================================ */

.hp-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--hp-radius);
  border: 1px solid var(--hp-border-light);
}

.hp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.hp-table thead { background: var(--hp-bg); }

.hp-table th {
  text-align: left;
  padding: 0.65rem 0.875rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hp-ink-secondary);
  border-bottom: 2px solid var(--hp-blue);
}

.hp-table th.hp-table-th--compact {
  max-width: 4.75rem;
  white-space: normal;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.hp-table td {
  padding: 0.65rem 0.875rem;
  border-bottom: 1px solid var(--hp-border-light);
  vertical-align: middle;
}

.hp-table tbody tr:hover { background: rgba(0, 150, 214, 0.03); }
.hp-table tbody tr:last-child td { border-bottom: none; }
.hp-table .actions { white-space: nowrap; }

.hp-code {
  font-size: 0.72rem;
  background: var(--hp-blue-muted);
  color: var(--hp-blue-active);
  padding: 0.15rem 0.4rem;
  border-radius: var(--hp-radius-sm);
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
}

.hp-panel > table:not(.hp-table) {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.hp-panel > table:not(.hp-table) th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hp-ink-secondary);
  border-bottom: 2px solid var(--hp-blue);
}

.hp-panel > table:not(.hp-table) td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--hp-border-light);
}

/* ================================================================
   TOOLBAR
   ================================================================ */

.hp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
}

/* ================================================================
   PAGINATION (aligned with quote builder product table)
   ================================================================ */

.hp-pagination-nav {
  justify-content: center;
  margin-top: 0.75rem;
}

.hp-pagination-indicator {
  align-self: center;
  margin: 0 0.75rem;
  font-size: 0.875rem;
}

.hp-btn--disabled,
.hp-btn.hp-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ================================================================
   BADGES
   ================================================================ */

.hp-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--hp-radius-sm);
  background: var(--hp-blue-muted);
  color: var(--hp-blue-active);
  margin-right: 0.2rem;
  margin-bottom: 0.15rem;
}

.hp-badge--success { background: var(--hp-success-bg); color: var(--hp-success); }
.hp-badge--muted { background: var(--hp-border-light); color: var(--hp-ink-muted); }
.hp-badge--warning { background: var(--hp-warning-bg); color: var(--hp-warning); }

/* ================================================================
   DASHBOARD TILES
   ================================================================ */

.hp-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.hp-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-lg);
  text-decoration: none;
  color: var(--hp-ink);
  box-shadow: var(--hp-shadow-sm);
  transition: transform var(--hp-transition), box-shadow var(--hp-transition), border-color var(--hp-transition);
}

.hp-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--hp-shadow-lg);
  border-color: var(--hp-blue);
}

.hp-tile:active { transform: translateY(0); }

.hp-tile-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hp-radius);
  background: var(--hp-blue-muted);
  color: var(--hp-blue);
  flex-shrink: 0;
  transition: background var(--hp-transition), color var(--hp-transition);
}

.hp-tile:hover .hp-tile-icon { background: var(--hp-blue); color: #fff; }
.hp-tile-icon svg { width: 1.35rem; height: 1.35rem; }

.hp-tile-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hp-tile-desc {
  font-size: 0.78rem;
  color: var(--hp-ink-muted);
  line-height: 1.4;
}

.hp-link-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.hp-link-list li {
  margin-bottom: 0.6rem;
  padding-left: 1rem;
  border-left: 3px solid var(--hp-blue);
}

/* ================================================================
   FIELDSET PERMISOS (ROLES)
   ================================================================ */

.hp-perm-fieldset {
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-lg);
  padding: 1.25rem;
  margin: 1.5rem 0;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--hp-bg);
}

.hp-perm-fieldset legend { font-weight: 700; font-size: 0.9rem; color: var(--hp-ink); padding: 0 0.35rem; }
.hp-perm-help { font-size: 0.85rem; color: var(--hp-ink-muted); margin: 0 0 1rem 0; }
.hp-perm-app { margin-bottom: 1.25rem; }

.hp-perm-app-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--hp-ink);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--hp-blue);
  font-weight: 700;
}

.hp-perm-model { margin: 0.75rem 0 0 0.5rem; }

.hp-perm-model-title {
  margin: 0 0 0.35rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--hp-ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hp-perm-list { list-style: none; padding: 0; margin: 0; }

.hp-perm-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 0.3rem;
  padding: 0.25rem 0;
}

.hp-perm-item input { width: auto; margin: 0; accent-color: var(--hp-blue); }

.hp-perm-code {
  font-size: 0.7rem;
  color: var(--hp-ink-muted);
  font-family: ui-monospace, monospace;
}

/* ================================================================
   CONFIRM DELETE
   ================================================================ */

.hp-confirm-text { font-size: 1rem; margin: 1rem 0 1.5rem; line-height: 1.6; }

/* ================================================================
   GENERIC FIELDSET
   ================================================================ */

.hp-fieldset {
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-lg);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--hp-bg);
}

.hp-fieldset legend { font-weight: 700; font-size: 0.88rem; color: var(--hp-ink); padding: 0 0.35rem; }
.hp-fieldset .hp-muted { margin-top: 0; margin-bottom: 0.75rem; }

.hp-fieldset ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

@media (min-width: 640px) {
  .hp-fieldset ul { grid-template-columns: repeat(2, 1fr); }
}

.hp-fieldset li label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  cursor: pointer;
}

.hp-fieldset input[type="checkbox"] { width: auto; margin-top: 0.2rem; accent-color: var(--hp-blue); }

/* ================================================================
   QUOTE CRUD
   ================================================================ */

.hp-quote-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .hp-quote-layout { grid-template-columns: 320px 1fr; }
  .hp-has-sidebar:not(.hp-sidebar-collapsed) .hp-quote-layout { grid-template-columns: 260px 1fr; }
}

@media (min-width: 1200px) {
  .hp-quote-layout { grid-template-columns: 360px 1fr; }
  .hp-has-sidebar:not(.hp-sidebar-collapsed) .hp-quote-layout { grid-template-columns: 300px 1fr; }
}

.hp-quote-panel {
  background: var(--hp-bg);
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
}

.hp-quote-panel-header {
  flex-shrink: 0;
}

.hp-quote-panel-scrollable {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.hp-quote-panel-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--hp-border-light);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.hp-quote-panel-title {
  margin: 0 0 1rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hp-ink-secondary);
  border-bottom: 2px solid var(--hp-blue);
  padding-bottom: 0.45rem;
}

.hp-selected-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  min-height: 2rem;
}

.hp-selected-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--hp-radius-sm);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--hp-border-light);
}

.hp-selected-item:last-child { border-bottom: none; }

.hp-sel-row1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}
.hp-sel-row1 .hp-remove-btn { margin-left: auto; flex-shrink: 0; }

.hp-sel-row2 {
  min-width: 0;
  padding-left: 0.1rem;
}

.hp-sel-row3 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hp-sel-row4 {
  display: flex;
  align-items: center;
}

.hp-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.5rem;
  margin-top: 0.35rem;
  border-top: 2px solid var(--hp-border);
  font-size: 0.88rem;
}
.hp-subtotal-label {
  font-weight: 600;
  color: var(--hp-ink-secondary);
}
.hp-subtotal-value {
  font-size: 1rem;
  color: var(--hp-blue-active);
}

.hp-selected-item-thumb,
.hp-product-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid var(--hp-border);
  flex-shrink: 0;
}

.hp-selected-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.hp-selected-item-sku {
  font-weight: 600;
  color: var(--hp-blue-active);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
}

.hp-selected-item-name {
  font-size: 0.78rem;
  color: var(--hp-ink-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hp-selected-item-bdnet {
  font-size: 0.72rem;
  color: var(--hp-blue-active);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.hp-bdnet-value { font-weight: 700; }

.hp-att-sku-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}
.hp-badge--pending-tiers {
  cursor: help;
}

.hp-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
  vertical-align: middle;
  line-height: 1;
}
.hp-badge--pl {
  background: #e0f2fe;
  color: #0369a1;
}
.hp-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.hp-selected-item-qty { display: flex; align-items: center; gap: 0.35rem; }

.hp-qty-input {
  width: 4rem !important;
  padding: 0.2rem 0.35rem !important;
  font-size: 0.82rem !important;
  text-align: center;
}

/* Product group cards — alternating tints */
.hp-product-group {
  border-radius: var(--hp-radius-sm);
  padding: 0.35rem;
  margin-bottom: 0.5rem;
}
.hp-product-group:last-child { margin-bottom: 0; }
.hp-product-group:nth-child(odd)  { background: #f8fafc; }
.hp-product-group:nth-child(even) { background: #f0f4f8; }
.hp-product-group .hp-selected-item { border-bottom: none; }

/* Attachment toggle — matches section title style */
.hp-attachment-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hp-ink-muted);
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.hp-attachment-toggle:hover { color: var(--hp-blue); }
.hp-attachment-toggle .hp-att-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.55rem;
}
.hp-attachment-toggle .hp-att-arrow.collapsed { transform: rotate(-90deg); }

/* Attachment group — sub-items */
.hp-attachment-group {
  border-left: 2px solid #bfdbfe;
  margin-left: 0.5rem;
  padding-left: 0.25rem;
}

.hp-selected-item--attachment {
  flex-direction: row;
  align-items: center;
  padding: 0.15rem 0.3rem;
  font-size: 0.72rem;
  gap: 0.3rem;
  border-bottom: none;
}
.hp-selected-item--attachment .hp-selected-item-thumb {
  width: 22px;
  height: 22px;
}
.hp-selected-item--attachment .hp-selected-item-sku { font-size: 0.62rem; }
.hp-selected-item--attachment .hp-selected-item-name { font-size: 0.66rem; }

.hp-attachment-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hp-blue-active);
  background: #dbeafe;
  border-radius: 4px;
}

.hp-remove-btn {
  background: none;
  border: none;
  color: var(--hp-danger);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: var(--hp-radius-sm);
  transition: background 0.15s;
}

.hp-remove-btn:hover { background: var(--hp-danger-bg); }

.hp-empty-selection {
  color: var(--hp-ink-muted);
  font-size: 0.82rem;
  font-style: italic;
  padding: 0.35rem 0;
}

.hp-filter-row th { padding: 0.35rem 0.5rem; }

.hp-col-filter {
  width: 100%;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.78rem !important;
  border: 1px solid var(--hp-border) !important;
  border-radius: var(--hp-radius-sm) !important;
}

.hp-table tbody tr.hp-row-selected,
.hp-table tbody tr.hp-row-selected:hover {
  background: #dbeafe;
}

.hp-table tbody tr.hp-product-row--fav {
  background: #fefce8;
}
.hp-table tbody tr.hp-product-row--fav:hover {
  background: #fef9c3;
}

.hp-table tbody tr.hp-product-row--fav.hp-row-selected,
.hp-table tbody tr.hp-product-row--fav.hp-row-selected:hover {
  background: #bfdbfe;
}

.hp-table tbody tr.hp-row--pending-config,
.hp-table tbody tr.hp-row--pending-config:hover {
  background: #fffbeb;
}

/* Detail-view accessory rows */
.hp-detail-att-toggle td {
  padding: 0.1rem 0.5rem !important;
  border-bottom: none !important;
}

.hp-detail-att-row td {
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
  font-size: 0.78rem;
  color: var(--hp-ink-secondary);
  background: #f8fafc;
  border-bottom-color: #f0f4f8 !important;
}
.hp-detail-att-row .hp-product-thumb {
  width: 26px;
  height: 26px;
}
.hp-detail-att-row .hp-code { font-size: 0.7rem; }

/* ================================================================
   STATUS / CONTRIBUTOR BADGES
   ================================================================ */

.hp-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--hp-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hp-status-badge--draft { background: #f1f5f9; color: #475569; }
.hp-status-badge--pending { background: var(--hp-warning-bg); color: var(--hp-warning); }
.hp-status-badge--sent { background: var(--hp-blue-muted); color: var(--hp-blue-active); }
.hp-status-badge--partial { background: #fff7ed; color: #c2410c; }
.hp-status-badge--approved { background: var(--hp-success-bg); color: var(--hp-success); }
.hp-status-badge--rejected { background: var(--hp-danger-bg); color: var(--hp-danger); }
.hp-status-badge--expired { background: #f1f5f9; color: #94a3b8; }

.hp-contributor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--hp-radius-pill);
}

.hp-contributor-badge--yes { background: var(--hp-success-bg); color: var(--hp-success); }
.hp-contributor-badge--no { background: var(--hp-danger-bg); color: var(--hp-danger); }

/* ================================================================
   EMAIL TEMPLATE
   ================================================================ */

.hp-email-template-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
}

@media (min-width: 1100px) {
  .hp-email-template-layout--with-sidebar {
    flex-direction: row;
    align-items: flex-start;
  }

  .hp-email-template-layout--with-sidebar .hp-email-template-editor {
    flex: 1 1 auto;
  }

  .hp-email-template-layout--with-sidebar .hp-email-template-tags {
    flex: 0 0 360px;
    position: sticky;
    top: 1rem;
  }
}

.hp-email-template-section { min-width: 0; }

.hp-email-template-tags,
.hp-email-template-editor { min-width: 0; }

.hp-email-template-tags { display: flex; flex-direction: column; }
.hp-email-template-tags .hp-table-wrap { overflow-x: auto; }

.hp-email-template-tags-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.hp-email-template-tags-column { min-width: 0; }

@media (min-width: 1100px) {
  .hp-email-template-tags-grid {
    grid-template-columns: minmax(0, 60%) minmax(0, 40%);
    align-items: start;
  }
}

.hp-email-template-tags-toggle {
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius);
  background: var(--hp-bg);
  padding: 0.65rem 0.85rem;
}

.hp-email-template-tags-toggle > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hp-ink-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hp-email-template-tags-toggle[open] > summary { margin-bottom: 0.85rem; }

.hp-email-template-tags-content {
  margin-top: 0.2rem;
}

.hp-email-template-editors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.hp-email-template-products-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 1100px) {
  .hp-email-template-editors-grid {
    grid-template-columns: minmax(0, 60%) minmax(0, 40%);
    align-items: start;
  }
}

.hp-email-template-editor .tox-tinymce {
  border-color: var(--hp-border-light);
  border-radius: var(--hp-radius);
}

.hp-email-template-editor .tox .tox-menubar {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.hp-email-template-editor .tox .tox-mbtn {
  white-space: nowrap;
  flex: 0 0 auto;
}

.tox.tox-tinymce-aux {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
  z-index: 1500;
}

.hp-email-template-source {
  min-height: 420px;
}

/* ================================================================
   QUOTE METADATA
   ================================================================ */

.hp-quote-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.hp-quote-meta-item {
  background: var(--hp-bg);
  border: 1px solid var(--hp-border-light);
  border-radius: var(--hp-radius);
  padding: 0.65rem 0.875rem;
}

.hp-quote-meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hp-ink-muted);
  margin-bottom: 0.2rem;
}

.hp-quote-meta-value { font-size: 0.9rem; font-weight: 600; color: var(--hp-ink); }

/* ================================================================
   IMPORT
   ================================================================ */

.hp-import-instructions { margin-bottom: 1.5rem; }

.hp-import-section-title {
  margin: 1.25rem 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hp-ink);
}

.hp-import-section-title:first-child { margin-top: 0.5rem; }

.hp-rule-list {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0 0;
  line-height: 1.75;
  font-size: 0.875rem;
  color: var(--hp-ink-secondary);
}

.hp-import-results {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--hp-blue);
}

.hp-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hp-form input[type="file"] {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* ================================================================
   RESPONSIVE: mobile sidebar
   ================================================================ */

@media (max-width: 1023px) {
  .hp-sidebar {
    transform: translateX(-100%);
    transition: transform var(--hp-transition);
    box-shadow: none;
  }

  .hp-sidebar-mobile-open .hp-sidebar {
    transform: translateX(0);
    box-shadow: var(--hp-shadow-xl);
  }

  .hp-sidebar-mobile-open .hp-sidebar-overlay { display: block; }

  .hp-content-wrapper { margin-left: 0 !important; }
  .hp-sidebar-collapsed .hp-content-wrapper { margin-left: 0 !important; }

  .hp-topbar.hp-topbar--mobile-only { display: flex; }
  .hp-topbar-menu { display: flex; }
  .hp-sidebar-toggle { display: none; }
}

@media (max-width: 639px) {
  .hp-main { padding: 1rem; }
  .hp-panel { padding: 1.25rem 1rem; }
}

/* --- Language switcher --- */
.hp-lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 0.25rem;
}
.hp-lang-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--hp-ink-muted);
}
.hp-lang-switcher select {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.hp-lang-switcher select option { background: var(--hp-sidebar-bg, #1a1a2e); color: #fff; }
.hp-sidebar-collapsed .hp-lang-switcher select,
.hp-sidebar-collapsed .hp-lang-icon { display: none; }
.hp-sidebar-collapsed .hp-lang-switcher { justify-content: center; padding: 0.5rem; }

.hp-lang-switcher--guest {
  border-top: none;
  justify-content: center;
  padding: 0;
  margin: 0 0 1rem;
}
.hp-lang-switcher--guest .hp-lang-icon { color: var(--hp-ink-secondary); }
.hp-lang-switcher--guest select {
  background: #fff;
  color: var(--hp-ink);
  border-color: var(--hp-border);
  width: auto;
  flex: 0;
}

/* --- Email chips (client form) --- */
.hp-email-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  min-height: 1.5rem;
}
.hp-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--hp-blue-5, #e8f0fe);
  color: var(--hp-blue, #0096d6);
  border: 1px solid var(--hp-blue-10, #c4dcf0);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.2;
}
.hp-email-chip-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-email-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hp-blue, #0096d6);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.hp-email-chip-remove:hover { opacity: 1; }
.hp-email-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.hp-email-add-row .hp-input {
  flex: 1;
  min-width: 0;
}
.hp-btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.hp-btn--outline {
  background: transparent;
  color: var(--hp-blue, #0096d6);
  border: 1px solid var(--hp-blue, #0096d6);
  border-radius: var(--hp-radius, 6px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hp-btn--outline:hover {
  background: var(--hp-blue, #0096d6);
  color: #fff;
}

/* Filter toolbar (above table) */
.hp-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--hp-border-light, #e2e8f0);
  border-radius: var(--hp-radius, 6px);
  position: relative;
  z-index: 10;
}
.hp-filter-toolbar:empty { display: none; }

.hp-filter-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.hp-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hp-ink-muted, #64748b);
  white-space: nowrap;
}

.hp-filter-input {
  padding: 0.25rem 0.35rem;
  font-size: 0.78rem;
  border: 1px solid var(--hp-border, #cbd5e1);
  border-radius: var(--hp-radius-sm, 4px);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.hp-filter-input:focus {
  outline: none;
  border-color: var(--hp-blue, #0096d6);
  box-shadow: 0 0 0 2px rgba(0,150,214,.15);
}

.hp-filter-text { width: 90px; }
.hp-filter-select {
  min-width: 100px;
  cursor: pointer;
  appearance: auto;
}
.hp-filter-date {
  width: 100px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
}
.hp-filter-range { width: 50px; }

.hp-filter-date-pair,
.hp-filter-range-pair {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.hp-filter-sep {
  font-size: 0.72rem;
  color: var(--hp-ink-muted, #64748b);
}

.hp-sort-arrow {
  margin-left: 4px;
  font-size: 0.7em;
  opacity: 0.3;
  transition: opacity .15s;
}

/* Qty label in sidebar */
.hp-qty-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--hp-ink-muted);
}

/* Shared xfilter dropdown (Excel-style multi-select) */
.hp-xfilter { position: relative; display: block; }
.hp-xfilter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  background: var(--hp-surface);
  color: var(--hp-ink);
  font-size: 0.78rem;
  font-family: var(--hp-font);
  cursor: pointer;
  min-height: 30px;
  text-align: left;
}
.hp-xfilter-trigger:hover { border-color: #94a3b8; }
.hp-xfilter.open .hp-xfilter-trigger {
  border-color: var(--hp-blue);
  box-shadow: 0 0 0 2px var(--hp-blue-ring);
}
.hp-xfilter.has-filter .hp-xfilter-trigger {
  background: #fff7ed;
  border-color: #f59e0b;
}
.hp-xfilter-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.hp-xfilter-caret { font-size: 0.7rem; color: var(--hp-ink-muted); }
.hp-xfilter-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 240px;
  max-width: 360px;
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  box-shadow: var(--hp-shadow-lg);
  z-index: 1000;
  padding: 8px;
  display: none;
}
.hp-xfilter.open .hp-xfilter-panel { display: block; }
.hp-xfilter-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--hp-border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--hp-font);
  margin-bottom: 6px;
  box-sizing: border-box;
}
.hp-xfilter-search:focus {
  outline: none;
  border-color: var(--hp-blue);
  box-shadow: 0 0 0 2px var(--hp-blue-ring);
}
.hp-xfilter-options {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  background: #fff;
}
.hp-xfilter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  color: var(--hp-ink);
}
.hp-xfilter-option:hover { background: #f1f5f9; }
.hp-xfilter-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--hp-blue);
}
.hp-xfilter-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-xfilter-all {
  font-weight: 600;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.hp-xfilter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}
.hp-xfilter-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: var(--hp-font);
  border: 1px solid var(--hp-border);
  border-radius: 6px;
  background: var(--hp-surface);
  color: var(--hp-ink);
  cursor: pointer;
}
.hp-xfilter-btn:hover { background: #f1f5f9; }
.hp-xfilter-empty {
  padding: 8px;
  font-size: 0.8rem;
  color: var(--hp-ink-muted);
  text-align: center;
}
.hp-xfilter-hint {
  padding: 8px 6px;
  font-size: 0.78rem;
  color: var(--hp-ink-muted);
  line-height: 1.35;
  border-bottom: 1px solid #f1f5f9;
}

.hp-filter-item .hp-xfilter {
  min-width: 120px;
}

.hp-file-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.hp-file-picker__input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.hp-file-picker__name {
  font-size: 0.88rem;
  color: var(--hp-ink-muted);
}
