/* ============================================================
   NexBm Ecosystem — Custom CSS3
   Raw CSS · No frameworks · Glassmorphism · Neon Glow
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Color palette */
  --obsidian: #0B0F17;
  --obsidian-2: #0d1320;
  --card: #161F30;
  --card-border: #1E293B;
  --cyan: #00F0FF;
  --cyan-soft: rgba(0, 240, 255, 0.12);
  --purple: #7000FF;
  --purple-soft: rgba(112, 0, 255, 0.14);

  /* Text */
  --text: #E6EDF5;
  --text-dim: #94A3B8;
  --text-muted: #64748B;

  /* Status */
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;

  /* Effects */
  --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.2);
  --glow-cyan-lg: 0 0 28px rgba(0, 240, 255, 0.28);
  --glow-purple: 0 0 18px rgba(112, 0, 255, 0.25);
  --glass-bg: rgba(22, 31, 48, 0.55);
  --glass-blur: blur(14px);
  --radius: 16px;
  --radius-sm: 10px;

  /* Spacing scale (8px base) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s var(--ease);
  --t-med: 0.32s var(--ease);

  /* Layout */
  --maxw: 1200px;
  --header-h: 68px;

  /* Font */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--obsidian);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Ambient gradient backdrop */
  background-image:
    radial-gradient(900px 600px at 12% -8%, rgba(0, 240, 255, 0.08), transparent 60%),
    radial-gradient(900px 600px at 92% 4%, rgba(112, 0, 255, 0.1), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(0, 240, 255, 0.05), transparent 60%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ---------- Glass utility ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--card-border);
  transition: background var(--t-med), border-color var(--t-med);
}

.site-header.scrolled {
  background: rgba(11, 15, 23, 0.9);
  border-bottom-color: rgba(0, 240, 255, 0.18);
}

.header-inner {
  max-width: var(--maxw);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-dot {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.nav-menu {
  display: flex;
  gap: 4px;
  margin-left: var(--sp-2);
}

.nav-item {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--cyan);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

.header-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  border: 1px solid rgba(112, 0, 255, 0.3);
  font-size: 0.72rem;
  font-weight: 500;
  color: #b89aff;
  white-space: nowrap;
}

.badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px rgba(112, 0, 255, 0.8);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Main ---------- */
.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-2) var(--sp-6);
  min-height: calc(100vh - var(--header-h) - 180px);
}

/* ---------- View switching ---------- */
.view {
  display: none;
  animation: viewIn 0.4s var(--ease);
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: var(--sp-4) 0 var(--sp-5);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cyan-soft);
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.03em;
  margin-bottom: var(--sp-3);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.9);
}

.hero-headline {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  background: linear-gradient(135deg, #ffffff 0%, #9fdcff 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  margin-top: var(--sp-2);
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---------- Status Widget ---------- */
.status-widget {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  box-shadow: var(--glow-cyan);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
  animation: pulse 2s ease-in-out infinite;
}

.status-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--cyan);
}

/* ---------- Section title ---------- */
.section-title {
  margin: var(--sp-5) 0 var(--sp-3);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Tools Grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--radius);
  text-align: left;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: var(--glow-cyan-lg), 0 12px 32px rgba(0, 0, 0, 0.4);
}

.tool-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  transition: box-shadow var(--t-med), transform var(--t-med);
}

.tool-icon svg {
  width: 26px;
  height: 26px;
}

.tool-icon--cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.tool-icon--purple {
  background: var(--purple-soft);
  color: #b89aff;
  border: 1px solid rgba(112, 0, 255, 0.35);
}

.tool-card:hover .tool-icon--cyan {
  box-shadow: var(--glow-cyan);
  transform: scale(1.06);
}
.tool-card:hover .tool-icon--purple {
  box-shadow: var(--glow-purple);
  transform: scale(1.06);
}

.tool-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  margin-top: 4px;
}

.tool-cta .arrow {
  transition: transform var(--t-fast);
}

.tool-card:hover .tool-cta .arrow {
  transform: translateX(4px);
}

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 0;
  margin-bottom: var(--sp-3);
  transition: color var(--t-fast);
}

.back-link:hover {
  color: var(--cyan);
}

/* ---------- View head ---------- */
.view-head {
  margin-bottom: var(--sp-3);
}

.view-head h2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.view-tag {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cyan-soft);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.view-head p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- Tool panel ---------- */
.tool-panel {
  border-radius: var(--radius);
  padding: var(--sp-3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform var(--t-fast), box-shadow var(--t-med), background var(--t-med), opacity var(--t-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #2bd4ff 100%);
  color: #04121a;
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  box-shadow: var(--glow-cyan-lg);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(0, 240, 255, 0.4);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ---------- Form controls ---------- */
.field-label,
.np-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.inv-input,
.qr-input,
.np-select,
.inv-input--sm {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.inv-input:focus,
.qr-input:focus,
.np-select:focus,
.inv-input--sm:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.qr-input {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

.np-select {
  cursor: pointer;
  appearance: none;
  -webkit-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' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ============================================================
   NETPULSE
   ============================================================ */
.np-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.np-controls .np-label {
  margin-bottom: 6px;
}

.np-controls > .np-select {
  flex: 1;
}

.np-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.np-result-card {
  position: relative;
  background: rgba(11, 15, 23, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.np-result-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.np-result-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.np-result-value--sm {
  font-size: 0.82rem;
  font-weight: 500;
  word-break: break-all;
}

.np-result-unit {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.np-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  transition: background var(--t-med), box-shadow var(--t-med);
}

.np-dot.fast {
  background: var(--success);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}
.np-dot.ok {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}
.np-dot.slow {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}
.np-dot.fail {
  background: var(--error);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.np-dot.testing {
  background: var(--cyan);
  animation: pulse 0.8s ease-in-out infinite;
}

.np-history h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.np-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.np-history-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 9px 12px;
  background: rgba(11, 15, 23, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.82rem;
  animation: viewIn 0.3s var(--ease);
}

.np-history-list li .h-host {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-history-list li .h-ms {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--cyan);
}

.np-history-empty {
  color: var(--text-muted);
  justify-content: center;
  font-style: italic;
}

/* ============================================================
   QR STUDIO
   ============================================================ */
.qr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  align-items: start;
}

.qr-options {
  display: flex;
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
}

.field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.qr-color {
  height: 42px;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--card-border);
}

.qr-color::-webkit-color-swatch-wrapper { padding: 0; }
.qr-color::-webkit-color-swatch { border: none; border-radius: 6px; }

.qr-hint {
  margin-top: var(--sp-2);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: var(--sp-3);
  background: rgba(11, 15, 23, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
}

#qrImage {
  display: none;
  border-radius: 10px;
  max-width: 100%;
  height: auto;
}

#qrImage.show {
  display: block;
  animation: viewIn 0.4s var(--ease);
}

.qr-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.qr-placeholder-icon svg {
  width: 56px;
  height: 56px;
  margin-bottom: var(--sp-1);
  opacity: 0.4;
}

.qr-preview-panel .btn {
  width: 100%;
}

/* ============================================================
   DEV INVOICE
   ============================================================ */
.invoice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  align-items: start;
}

.invoice-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.invoice-items-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.invoice-items-head h4 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.invoice-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.invoice-item {
  display: grid;
  grid-template-columns: 1fr 64px 90px 36px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: rgba(11, 15, 23, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  animation: viewIn 0.3s var(--ease);
}

.invoice-item input {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
  transition: border-color var(--t-fast);
}

.invoice-item input:focus {
  outline: none;
  border-color: var(--cyan);
}

.item-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid transparent;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.item-remove:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}

.item-remove svg {
  width: 16px;
  height: 16px;
}

.invoice-tax-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.invoice-tax-row .field-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.inv-input--sm {
  max-width: 110px;
}

/* Invoice preview paper */
.invoice-preview-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.invoice-paper {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  font-size: 0.85rem;
}

.invoice-paper-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid #0B0F17;
  margin-bottom: var(--sp-2);
}

.invoice-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.invoice-number {
  font-size: 0.78rem;
  color: #64748B;
}

.invoice-paper-brand .brand-name {
  font-size: 1.1rem;
  color: #0B0F17;
}

.invoice-paper-brand .brand-dot {
  text-shadow: none;
}

.invoice-paper-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.invoice-paper-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paper-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  font-weight: 600;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-2);
}

.invoice-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  padding: 8px 6px;
  border-bottom: 1px solid #e2e8f0;
}

.invoice-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
}

.col-qty,
.col-price,
.col-amount {
  text-align: right;
}

.paper-empty {
  text-align: center;
  color: #94A3B8;
  font-style: italic;
}

.invoice-totals {
  margin-left: auto;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.total-row--grand {
  font-size: 1.05rem;
  font-weight: 700;
  padding-top: 8px;
  border-top: 2px solid #0B0F17;
  margin-top: 4px;
}

.invoice-paper-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: #94A3B8;
}

.invoice-paper-foot .brand-name {
  font-size: 0.9rem;
  color: #0B0F17;
}

.invoice-print-btn {
  width: 100%;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: rgba(11, 15, 23, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: var(--sp-3) var(--sp-2);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.footer-inner .brand-name {
  font-size: 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .qr-layout,
  .invoice-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner {
    gap: var(--sp-1);
  }
  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(11, 15, 23, 0.97);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    padding: var(--sp-2);
    gap: 4px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--t-med), opacity var(--t-med);
    margin-left: 0;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-item {
    padding: 12px 14px;
    border-radius: 8px;
  }
  .nav-item.active::after {
    left: 14px;
    right: auto;
    width: 3px;
    height: 18px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
  }
  .header-badge {
    display: none;
  }
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .np-results {
    grid-template-columns: 1fr;
  }
  .np-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .invoice-meta {
    grid-template-columns: 1fr;
  }
  .invoice-paper-meta {
    grid-template-columns: 1fr;
  }
  .invoice-totals {
    width: 100%;
  }
  .app-main {
    padding: var(--sp-3) var(--sp-2) var(--sp-5);
  }
}

@media (max-width: 420px) {
  .view-head h2 {
    font-size: 1.5rem;
  }
  .hero-headline {
    font-size: 2rem;
  }
  .invoice-item {
    grid-template-columns: 1fr 48px 72px 32px;
  }
}

/* ============================================================
   PRINT (invoice only)
   ============================================================ */
@media print {
  body * {
    visibility: hidden;
  }
  #invoicePaper,
  #invoicePaper * {
    visibility: visible;
  }
  #invoicePaper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .site-header,
  .site-footer,
  .back-link,
  .invoice-print-btn {
    display: none !important;
  }
}
