/*!
 * N-Home UI Kit Stylesheet
 * Official N-Home Ui Kit Stylesheet — do not remove this notice.
 *
 * Overview:
 *   This stylesheet provides the global design tokens, layout utilities,
 *   base element resets, component patterns, and responsive breakpoints
 *   used across the N-Home product family.
 *
 * Contents:
 *   - Design tokens: colors, typography, spacing, elevation, radii, z-index
 *   - Global reset and base element rules (html, body, headings, lists, forms)
 *   - Layout utilities: container, grid, flex helpers, spacing helpers
 *   - Components: buttons, inputs, selects, cards, modals, nav, toasts
 *   - State & accessibility helpers: focus, disabled, visually-hidden
 *   - Responsive behavior: mobile-first breakpoints and utilities
 *
 * Conventions:
 *   - BEM-inspired class naming for components: .nhk-<component>__[element]--<modifier>
 *   - Token prefix: --nhk- for CSS custom properties (e.g., --nhk-color-primary)
 *   - Utility classes are intentionally atomic and documented separately
 *   - Mobile-first: base rules apply to small viewports; media queries use min-width
 *
 * Theming:
 *   - Theme variables are defined at :root; override them in a theme wrapper
 *     (e.g., .nhk-theme--dark) to support multiple themes without changing markup.
 *   - Prefer tokens instead of raw values to make theming and runtime switching easy.
 *
 * Accessibility:
 *   - Use relative units (rem/em) for typography and spacing where possible.
 *   - Ensure color contrast meets WCAG AA for text and interactive elements.
 *   - All interactive components include visible focus styles and ARIA-ready hooks.
 *
 * Performance & Maintenance:
 *   - Keep component-specific overrides scoped with a single class selector.
 *   - Avoid deep selector specificity; prefer utility classes and token-driven styles.
 *   - Critical layout and token definitions are kept at the top of the file for easy overrides.
 *
 * Versioning & Contribution:
 *   - Follow semantic versioning for stylesheet releases.
 *   - Submit changes via pull request with a corresponding changelog entry.
 *   - Include visual regression tests for component changes where applicable.
 *
 * License:
 *   - Refer to the project LICENSE file for permitted use and redistribution terms.
 *
 * Contact:
 *   - For questions or contributions, contact the N-Home design systems team.
 *
 * NOTE:
 *   This is the official N-Home Ui Kit Stylesheet. Any modification should be
 *   coordinated with the design systems maintainers to avoid breaking changes.
 */


:root {
  /* ===== Background Layers ===== */
  --nh-body-bg: #141414;
  --nh-surface-bg: rgb(19 19 19 / 50%);
  --nh-elevated-bg: #4a4a4a12;
  --nh-panel-bg: hsl(0deg 0% 100% / 4%);
  --nh-panel-bg-hover: hsla(214, 8%, 98%, 0.07);

  /* ===== Borders ===== */
  --nh-border-subtle: rgb(62 62 62 / 30%);
  --nh-border-medium: #30313354;
  --nh-border-accent: #4797ff;

  /* ===== Text ===== */
  --nh-text-main: #e5e7eb;
  --nh-text-soft: #9ca3af;
  --nh-text-muted: #6b7280;
  --nh-text-accent: #4797ff;

  /* ===== Accent Colors ===== */
  --nh-accent: #4797ff;
  --nh-accent-soft: rgba(71, 151, 255, 0.15);

  /* ===== Semantic (optional, used in buttons etc.) ===== */
  --nh-danger: #ef4444;
  --nh-danger-soft: rgba(239, 68, 68, 0.15);

  /* ===== Shadows ===== */
  --nh-shadow-dropdown: 0 12px 30px rgba(15, 23, 42, 0.7);
  --nh-shadow-soft: 0 6px 17px rgb(20 19 19 / 40%);
  

  /* ===== Tier Card ===== */
  --nh-tier-card-bg: hsl(0deg 0% 89.39% / 4%);
  --nh-tier-card-border: #606060;
  --nh-tier-card-accent: #4797ff;
  --nh-tier-card-bg-selected:rgb(158 158 158 / 10%);
  --nh-tier-card-bg-hover: #99999917;
  --nh-tier-card-border-hover:

  /* ===== Tables ===== */
  --nh-table-header-bg: #1f2023;
  --nh-table-row-bg: #1f2023;
  --nh-table-row-hover-bg: #2c2d30;
  --nh-table-border: #30313354;


  /* ===== Radius ===== */
  --nh-radius-sm: 4px;
  --nh-radius: 8px;
  --nh-radius-pill: 8px;

  /* ===== Font ===== */
  --nh-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

/* ===== Heights ===== */
  --nh-fields-height: 38px;
}

/* =========================================
   Base Layout
   ========================================= */
body {
  margin: 0;
  background: var(--nh-body-bg);
  font-family: var(--nh-font);
  color: var(--nh-text-main);
}

.container {
  background-color: var(--nh-surface-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--nh-border-subtle);
  border-radius: var(--nh-radius);
  margin: 16px;
  padding: 16px;
  box-sizing: border-box;
}

/* Simple card style for grouping content */
.nh-card {
  background-color: var(--nh-panel-bg);
  border-radius: var(--nh-radius);
  border: 1px solid var(--nh-border-subtle);
  padding: 12px 14px;
  box-sizing: border-box;
}

.nh-card-module{
  background-color: var(--nh-surface-bg);
  border-radius: var(--nh-radius);
  border: 1px solid var(--nh-border-subtle);
  min-width: 0;
}
/* Typography helpers */
.nh-label {
  font-size: 12px;
  color: var(--nh-text-soft);
}

/* =========================================
   Dropdown – Group + Label
   ========================================= */

/* Group: label + dropdown */
.nh-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.nh-dropdown-group > label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* Hide the original select */
.nh-dropdown-original {
  display: none;
}

/* =========================================
   Dropdown – Control
   ========================================= */
.nh-dropdown {
  position: relative;
  display: inline-block;
  font-size: 13px;
  min-width: min(170px, 100%);
}

/* Toggle */
.nh-dropdown-toggle {
  min-width: 100%;
  border-radius: var(--nh-radius);
  border: 1px solid transparent;
  background-color: var(--nh-panel-bg);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: var(--nh-text-main);
  box-sizing: border-box;
}

.nh-dropdown-toggle:hover {
  background: var(--nh-panel-bg-hover);
}

/* Active / focus outline */
.nh-dropdown.is-open .nh-dropdown-toggle,
.nh-dropdown.is-focused .nh-dropdown-toggle {
  outline: 1px solid var(--nh-border-accent);
  outline-offset: 0;
  border-color: var(--nh-border-accent);
}

.nh-dropdown-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nh-dropdown-icon {
  font-size: 14px;
  color: var(--nh-text-soft);
}

.nh-dropdown-label {
  color: var(--nh-text-main);
}

/* Chevron SVG */
.nh-dropdown-chevron {
  width: 20px;
  height: 20px;
  color: var(--nh-text-soft);
  flex-shrink: 0;
  pointer-events: none;
}

/* Rotate chevron when dropdown opens */
.nh-dropdown.is-open .nh-dropdown-toggle svg.nh-dropdown-chevron{
  transform: rotate(180deg);
}

.nh-dropdown .nh-dropdown-toggle svg.nh-dropdown-chevron{
  transition: transform 0.18s ease-out;
}

/* =========================================
   Dropdown – Menu & Items
   ========================================= */
.nh-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 100%;
  background-color: var(--nh-elevated-bg);
  border-radius: var(--nh-radius);
  border: 1px solid var(--nh-border-medium);
  box-shadow: var(--nh-shadow-dropdown);
  padding: 4px 0;
  z-index: 50;
  display: none;
}

.nh-dropdown.is-open .nh-dropdown-menu {
  display: block;
}

.nh-dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--nh-text-main);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.nh-dropdown-item:hover {
  background: var(--nh-panel-bg-hover);
}

.nh-dropdown-item.is-active {
  background: var(--nh-panel-bg);
}

/* If you use icons inside items */
.nh-dropdown-item-icon {
  font-size: 14px;
  color: var(--nh-text-soft);
}

/* =========================================
   Inputs
   ========================================= */

.nh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.nh-field > label {
  font-size: 12px;
  color: var(--nh-text-soft);
}

.nh-input,
input[type="text"].nh-input,
input[type="number"].nh-input,
input[type="email"].nh-input,
input[type="password"].nh-input,
textarea.nh-input {
  width: 100%;
  font-family: var(--nh-font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--nh-text-main);
  padding: 6px 10px;
  box-sizing: border-box;
  outline: none;
  transition:
    border-color 0.16s ease-out,
    background 0.16s ease-out,
    box-shadow 0.16s ease-out;
}

.nh-input::placeholder {
  color: var(--nh-text-muted);
}

.nh-input:focus {
  border-color: var(--nh-border-accent);
  box-shadow: 0 0 0 1px var(--nh-accent-soft);
  background-color: var(--nh-panel-bg);
}

.nh-input[readonly] {
  opacity: 0.7;
}

/* Error state */
.nh-input.nh-input-error {
  border-color: var(--nh-danger);
  box-shadow: 0 0 0 1px var(--nh-danger-soft);
}
.nh-input:-webkit-autofill,
.nh-input:-webkit-autofill:focus {
    background: transparent;
}

/* =========================================
   Buttons
   ========================================= */

.nh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--nh-radius);
  border: 1px solid transparent;
  font-family: var(--nh-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background-color: var(--nh-panel-bg);
  color: var(--nh-text-main);
  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out,
    transform 0.08s ease-out;
}

.nh-btn:hover {
  background-color: var(--nh-panel-bg-hover);
}

.nh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Primary button */
.nh-btn-primary {
  background: var(--nh-accent);
  border-color: var(--nh-accent);
  color: #ffffff;
  box-shadow: var(--nh-shadow-soft);
}

.nh-btn-primary:hover {
  background: #4fa3ff;
}

/* Secondary (outline) */
.nh-btn-secondary {
  background: transparent;
  border-color: var(--nh-border-medium);
}

/* Ghost */
.nh-btn-ghost {
  background: transparent;
  border-color: transparent;
}

/* Danger */
.nh-btn-danger {
  background: var(--nh-danger-soft);
  border-color: var(--nh-danger);
  color: #fecaca;
}

/* Small / large size tweaks */
.nh-btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.nh-btn-lg {
  padding: 8px 14px;
  font-size: 14px;
}
/* =========================================
   Radio Boxes – HORIZONTAL w/ LABEL ON TOP
   ========================================= */

/* Wrapper that holds label + the row */
.nh-radio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

/* Label matches dropdown label exactly */
.nh-radio-wrapper > label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* Horizontal row for radio options */
.nh-radio-group {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

/* Each radio box behaves like a pill */
.nh-radio-box {
  flex: 1;
  cursor: pointer;
  display: block;
  position: relative;
}

/* Hide native radio */
.nh-radio-box input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Visual pill container (matches dropdown toggle) */
.nh-radio-box-visual {
  width: 100%;
  height: var(--nh-fields-height);
  display: flex;
  align-items: center;
  justify-content: center; /* centers label + dot */
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--nh-radius);
  border: 1px solid transparent;
  background-color: var(--nh-panel-bg);
  color: var(--nh-text-main);
  font-size: 13px;
  box-sizing: border-box;
  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out,
    outline-color 0.16s ease-out;
}

/* Hover */
.nh-radio-box:hover .nh-radio-box-visual {
  background-color: var(--nh-panel-bg-hover);
}

/* Dot indicator */
.nh-radio-box-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #4b5563;
  box-sizing: border-box;
  flex-shrink: 0;
  transition:
    border-color 0.16s ease-out,
    background 0.16s ease-out;
}

/* Active / checked */
.nh-radio-box input[type="radio"]:checked + .nh-radio-box-visual {
  border-color: var(--nh-border-accent);
  outline: 1px solid var(--nh-border-accent);
  outline-offset: 0;
  background-color: var(--nh-panel-bg);
}

.nh-radio-box input[type="radio"]:checked + .nh-radio-box-visual .nh-radio-box-dot {
  border-color: var(--nh-border-accent);
  background-color: var(--nh-border-accent);
}

/* Keyboard focus */
.nh-radio-box input[type="radio"]:focus + .nh-radio-box-visual {
  outline: 1px solid var(--nh-border-accent);
  border-color: var(--nh-border-accent);
}
/* =========================================
   Input Field – matches dropdown/radio style
   ========================================= */

/* Wrapper so label + input + error stack cleanly */
.nh-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

/* Label (same as dropdown label) */
.nh-input-wrapper > label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* Input element */
.nh-input {
  width: 100%;
  font-family: var(--nh-font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--nh-text-main);
  background-color: var(--nh-panel-bg);
  border-radius: var(--nh-radius);
  border: 1px solid transparent;
  margin-bottom: 5px;
  padding: 6px 10px;
  box-sizing: border-box;
  outline: none;
  transition:
    border-color 0.16s ease-out,
    background 0.16s ease-out,
    outline-color 0.16s ease-out;
}

.nh-input:hover {
  background-color: var(--nh-panel-bg-hover);
}

/* Focused */
.nh-input:focus {
  border-color: var(--nh-border-accent);
  outline: 1px solid var(--nh-border-accent);
}

/* Placeholder */
.nh-input::placeholder {
  color: var(--nh-text-muted);
}

/* === DANGER STATE (error) === */
.nh-input-error {
  border-color: var(--nh-danger);
  outline: 1px solid var(--nh-danger);
  background-color: var(--nh-panel-bg);
}

/* Danger placeholder shifts color also */
.nh-input-error::placeholder {
  color: #fca5a5; /* light red */
}

/* Invalid text label under field */
.nh-input-invalid-text {
  font-size: 11px;
  color: var(--nh-danger);
  padding-left: 2px;
  line-height: 1.3;
  display: none; /* JS toggles this */
}
/* =========================================
   Field row – multi-column layout
   ========================================= */

.nh-field-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* Allow any of these to live nicely in a row */
.nh-field-row > .nh-input-wrapper,
.nh-field-row > .nh-dropdown-group,
.nh-field-row > .nh-radio-wrapper {
  flex: 1;
  min-width: 0; /* prevents overflow when narrow */
}

/* =========================================
   Input shell with optional icon
   ========================================= */

.nh-input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--nh-radius);
  border: 1px solid transparent;
  background-color: var(--nh-panel-bg);
  box-sizing: border-box;
  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out,
    outline-color 0.16s ease-out;
}

/* Hover – mirror dropdown hover */
.nh-input-shell:hover {
  background-color: var(--nh-panel-bg-hover);
}

/* Icon span / svg */
.nh-input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nh-text-soft);
  font-size: 14px;
  flex-shrink: 0;
}

/* When using SVG icons inside */
.nh-input-icon svg {
  width: 18px;
  height: 18px;
}

/* Input inside shell – take full space, no own border */
.nh-input-shell .nh-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

/* Remove old focus visuals from the bare input when inside shell */
.nh-input-shell .nh-input:focus {
  outline: none;
  box-shadow: none;
}

/* Focus state on shell */
.nh-input-shell.is-focused {
  border-color: var(--nh-border-accent);
  outline: 1px solid var(--nh-border-accent);
}

/* Error state on shell (danger) */
.nh-input-shell.nh-input-error {
  border-color: var(--nh-danger);
  outline: 1px solid var(--nh-danger);
}
/* Label with optional icon (for dropdown/radio wrappers) */
.nh-field-label-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nh-field-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nh-text-soft);
  font-size: 14px;
}

.nh-field-label-icon svg {
  width: 16px;
  height: 16px;
}

/* =========================================
   Tabs – Segmented Control Style
   ========================================= */

/* Wrapper stays the same */
.nh-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  width:100%;
}

.nh-tabs-label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* Segmented tab row */
.nh-tab-list {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  background-color: var(--nh-panel-bg);
  border-radius: var(--nh-radius-pill);
  padding: 2px;
  border: 1px solid var(--nh-border-subtle);
  overflow: hidden;
}

/* Sliding active pill */
.nh-tab-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: -1px;
  width: 0; /* set by JS */
  border-radius: var(--nh-radius-pill);
  background-color: var(--nh-panel-bg-hover);
  box-sizing: border-box;
  z-index: 0;
  pointer-events: none;
  transition:
    transform 0.18s ease-out,
    width 0.18s ease-out;
}

/* Tab button */
.nh-tab {
  position: relative;
  z-index: 1; /* above indicator */
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--nh-radius-pill);
  font-family: var(--nh-font);
  font-size: 13px;
  color: var(--nh-text-soft);
  cursor: pointer;
  display: inline-flex;
  height: var(--nh-fields-height);
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition:
    color 0.16s ease-out;

}
.nh-tab-panel.is-active {
  display: block;
}
.nh-tab-panel{
  display: none;
}
/* Divider lines between tabs (visual "|") */
.nh-tab:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background-color: rgba(255, 255, 255, 0.04);
}

/* Hover */
.nh-tab:hover {
  color: var(--nh-text-main);
}

/* Active tab text */
.nh-tab.is-active {
  color: var(--nh-text-accent);
}

/* Remove old underline behavior if any */
.nh-tab.is-active::after {
  /* no underline here – we already used ::after for the divider */
}
/* =========================================
   CHECKBOX
   ========================================= */

/* Single field with optional label on top */
.nh-checkbox-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

/* Top label (matches dropdown/radio label) */
.nh-checkbox-wrapper > label.nh-checkbox-field-label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* For multiple checkboxes under one field label */
.nh-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Clickable row */
.nh-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--nh-text-main);
}

/* Hide native checkbox but keep it focusable */
.nh-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Visual box */
.nh-checkbox-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--nh-border-medium);
  background-color: var(--nh-panel-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out;
}

/* Checkmark (svg or pseudo), default hidden */
.nh-checkbox-box svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}

/* Label text */
.nh-checkbox-label {
  flex: 1;
}

/* Hover */
.nh-checkbox:hover .nh-checkbox-box {
  background-color: var(--nh-panel-bg-hover);
}

/* Checked state — UPDATED */
.nh-checkbox input[type="checkbox"]:checked + .nh-checkbox-box {
  background-color: var(--nh-accent);       /* solid accent */
  border-color: var(--nh-accent);           /* match border */
  box-shadow: 0 0 0 1px var(--nh-accent);   /* subtle outline */
  color: #ffffff;                           /* icon (currentColor) becomes white */
}

.nh-checkbox input[type="checkbox"]:checked + .nh-checkbox-box svg {
  opacity: 1;
  stroke: #ffffff;                          /* explicit white checkmark */
}

/* Keyboard focus */
.nh-checkbox input[type="checkbox"]:focus + .nh-checkbox-box {
  box-shadow: 0 0 0 1px var(--nh-border-accent);
}

/* Disabled (optional) */
.nh-checkbox input[type="checkbox"]:disabled + .nh-checkbox-box {
  opacity: 0.5;
  cursor: not-allowed;
}

.nh-checkbox input[type="checkbox"]:disabled ~ .nh-checkbox-label {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Inline checkbox layout specifically for item-cards */
.nh-checkbox-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.nh-checkbox-inline .nh-checkbox-box {
  margin-top: 0; /* avoid vertical misalignment */
  flex-shrink: 0;
}

.nh-checkbox-inline .nh-checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nh-item-card.is-selected {
  border-color: var(--nh-border-accent);
  background-color: var(--nh-accent-soft);
  box-shadow: 0 0 0 1px var(--nh-border-accent);
}

/* =========================================
   N-Home Stepper
   ========================================= */

.nh-stepper {
  display: inline-flex;
  align-items: center;
  border-radius: var(--nh-radius-pill);
  background-color: var(--nh-panel-bg);
  border: 1px solid var(--nh-border-subtle);
  overflow: hidden;
  box-sizing: border-box;
  height: var(--nh-fields-height);
}

.nh-stepper-btn {
  border: none;
  background: transparent;
  color: var(--nh-text-main);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s ease-out,
    opacity 0.12s ease-out;
  height: var(--nh-fields-height);
}

.nh-stepper-btn:hover:not(.is-disabled) {
  background-color: var(--nh-panel-bg-hover);
}

.nh-stepper-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Middle input */
.nh-stepper-input {
  width: 48px !important;
  text-align: center;
  border: none;
  outline: none;
  background: transparent;
  color: var(--nh-text-main);
  font-family: var(--nh-font);
  font-size: 13px;
  padding: 4px 0;
  box-sizing: border-box;
}

/* Remove default browser spinners */
.nh-stepper-input::-webkit-inner-spin-button,
.nh-stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.nh-stepper-input[type=number] {
  -moz-appearance: textfield;
}

/* Focus ring around full stepper */
.nh-stepper.is-focused {
  border-color: var(--nh-border-accent);
  box-shadow: 0 0 0 1px var(--nh-border-accent);
}
.nh-reset-btn{
    display: none;
    padding: 0px;
    color: var(--nh-text-accent);
    background: none;
    font-size: 16px;
}
.nh-reset-btn.is-visible {
  display: block;
}
/* =========================================
   TOGGLE
   ========================================= */

.nh-toggle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.nh-toggle-field-label {
  font-size: 12px;
  color: var(--nh-text-soft);
  user-select: none;
}

/* Clickable row */
.nh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--nh-text-main);
}

/* Hide native checkbox but keep it accessible */
.nh-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Track */
.nh-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background-color: var(--nh-panel-bg);
  border: 1px solid var(--nh-border-medium);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  padding: 1px;
  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out;
}

/* Thumb */
.nh-toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background-color: var(--nh-text-soft);
  transform: translateX(0);
  transition:
    transform 0.16s ease-out,
    background 0.16s ease-out;
}

/* Right-side text */
.nh-toggle-text {
  font-size: 12px;
  color: var(--nh-text-soft);
}

/* Hover */
.nh-toggle:hover .nh-toggle-track {
  background-color: var(--nh-panel-bg-hover);
}

/* Checked state */
.nh-toggle-input:checked + .nh-toggle-track {
  background-color: var(--nh-accent);
  border-color: var(--nh-accent);
}

.nh-toggle-input:checked + .nh-toggle-track .nh-toggle-thumb {
  transform: translateX(16px);
  background-color: #ffffff;
}

.nh-toggle-input:checked ~ .nh-toggle-text {
  color: var(--nh-text-main);
}

/* Focus ring on track when input focused (keyboard) */
.nh-toggle-input:focus + .nh-toggle-track {
  box-shadow: 0 0 0 1px var(--nh-border-accent);
}

/* Disabled (optional) */
.nh-toggle-input:disabled + .nh-toggle-track {
  opacity: 0.4;
  cursor: not-allowed;
}

.nh-toggle-input:disabled ~ .nh-toggle-text {
  opacity: 0.6;
  cursor: not-allowed;
}
/* =========================================
   Item List Card (Horizontal)
   ========================================= */

.nh-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--nh-radius);
  background-color: var(--nh-panel-bg);
  border: 1px solid var(--nh-border-subtle);
  box-sizing: border-box;
  margin-bottom: 8px;
}

/* Hover highlight for clickable rows (if you want) */
.nh-item-card:hover {
  background-color: var(--nh-panel-bg-hover);
}

/* Left cluster: thumbnail + text */
.nh-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* allow text to truncate */
}

/* Thumbnail */
.nh-item-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background-color: #111827;
  border: 1px solid var(--nh-border-medium);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nh-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Text stack */
.nh-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nh-item-title {
  font-size: 13px;
  color: var(--nh-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nh-item-subtitle {
  font-size: 11px;
  color: var(--nh-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nh-item-meta {
  font-size: 11px;
  color: var(--nh-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right cluster: price + stepper */
.nh-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* Price */
.nh-item-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.nh-item-price-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--nh-text-main);
}

.nh-item-price-unit {
  font-size: 11px;
  color: var(--nh-text-soft);
}

/* Qty section */
.nh-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nh-item-qty-label {
  font-size: 11px;
  color: var(--nh-text-soft);
}

/* Make the stepper a bit tighter in this context if needed */
.nh-item-qty .nh-stepper {
  transform: scale(0.96);
  transform-origin: right center;
}
/* =========================================
   ITEM CARD — STACKED QTY STYLE
   ========================================= */

.nh-item-qty--stacked .nh-stepper {
  border: 1px solid var(--nh-border-medium);
  background-color: var(--nh-elevated-bg);
  border-radius: var(--nh-radius);
}

/* tighter footprint in stacked mode */
.nh-item-qty--stacked .nh-stepper-btn {
  padding: 3px 8px;
}

.nh-item-qty--stacked .nh-stepper-input {
  width: 36px;
  font-size: 12px;
}


/* Responsive-ish: stack right side below on narrow screens */
@media (max-width: 600px) {
  .nh-item-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .nh-item-right {
    align-items: flex-start;
  }

  .nh-item-qty .nh-stepper {
    transform-origin: left center;
  }
}
