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

:root {
  --red: #c0000c;
  --red-dark: #960009;
  --bg: #f4f4f6;
  --white: #fff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #888;
  --radius: 12px;
}

html, body { height: 100%; background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); }

/* ===== LOGIN ===== */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1a1a1a 0%, #2d0004 100%);
}

.np-login-box {
  background: var(--white);
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.np-logo { font-size: 26px; font-weight: 900; text-align: center; margin-bottom: 4px; }
.logo-arts { color: var(--red); }
.logo-com { color: #222; }
.np-login-sub { text-align: center; font-size: 13px; color: var(--muted); margin-top: -8px; }

.np-login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
}
.np-login-box input:focus { border-color: var(--red); }

#loginBtn {
  width: 100%;
  padding: 15px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  margin-top: 4px;
}
#loginBtn:active { background: var(--red-dark); }
#loginError { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; }

/* ===== TOPBAR ===== */
.np-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.np-topbar-logo { font-size: 18px; font-weight: 900; }
.np-topbar-right { display: flex; align-items: center; gap: 10px; }
.np-topbar-right span { font-size: 13px; color: var(--muted); }
.np-logout { background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.np-logout:active { background: #f5f5f5; }

/* ===== STEPS ===== */
.np-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 32px 4px;
}
.np-step {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #999;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .3s, color .3s;
}
.np-step.active { background: var(--red); color: #fff; }
.np-step.done { background: #2e7d32; color: #fff; }
.np-step-line { flex: 1; height: 2px; background: #e0e0e0; max-width: 60px; }

.np-step-labels {
  display: flex;
  justify-content: space-between;
  padding: 4px 24px 16px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ===== SCREENS ===== */
.np-screen { display: none; padding: 0 16px 120px; }
.np-screen.active { display: block; }

.np-section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

/* ===== SEARCH ===== */
.np-search-wrap {
  position: relative;
  margin-bottom: 8px;
}
.np-search-wrap input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
  background: var(--white);
  transition: border-color .2s;
}
.np-search-wrap input:focus { border-color: var(--red); }
.np-clear-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  font-size: 18px; color: var(--muted);
  cursor: pointer; padding: 4px;
}

/* ===== LIST (suggestions) ===== */
.np-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }

.np-list-item {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.np-list-item:active { background: #ffeaea; border-color: var(--red); }
.np-list-item-info { display: flex; flex-direction: column; gap: 2px; }
.np-list-item-info strong { font-size: 15px; }
.np-list-item-info span { font-size: 12px; color: var(--muted); }
.np-list-item-action { font-size: 22px; color: var(--red); font-weight: 700; flex-shrink: 0; }

.np-list-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== SELECTED CLIENT CARD ===== */
.np-selected-card {
  background: var(--white);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.np-selected-icon { font-size: 28px; flex-shrink: 0; }
.np-selected-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.np-selected-info strong { font-size: 15px; }
.np-selected-info span { font-size: 12px; color: var(--muted); }
.np-change-btn {
  background: none; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  font-size: 13px; color: var(--muted); cursor: pointer;
  flex-shrink: 0;
}

/* ===== ITEMS ===== */
.np-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.np-item-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.np-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.np-item-name { font-size: 14px; font-weight: 700; flex: 1; }
.np-item-code { font-size: 11px; color: var(--muted); }
.np-item-remove {
  background: none; border: none;
  color: #ccc; font-size: 22px;
  cursor: pointer; line-height: 1;
  flex-shrink: 0; padding: 0 2px;
}
.np-item-remove:active { color: var(--red); }

.np-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* QTY STEPPER */
.np-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.np-qty-btn {
  width: 40px; height: 40px;
  background: #f5f5f5; border: none;
  font-size: 20px; font-weight: 700;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}
.np-qty-btn:active { background: #e0e0e0; }
.np-qty-val {
  width: 44px; text-align: center;
  font-size: 16px; font-weight: 700;
  border: none; outline: none;
  padding: 0; background: var(--white);
}

/* PRICE INPUT */
.np-item-price-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.np-item-price-wrap label { font-size: 11px; color: var(--muted); }
.np-item-price {
  width: 100px; text-align: right;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px; font-weight: 700;
  outline: none;
}
.np-item-price:focus { border-color: var(--red); }
.np-item-subtotal { font-size: 12px; color: var(--muted); }

/* ===== FIELDS (step 3) ===== */
.np-field { margin-bottom: 14px; }
.np-field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.np-field input, .np-field select, .np-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
  background: var(--white);
  transition: border-color .2s;
  font-family: inherit;
}
.np-field input:focus, .np-field select:focus, .np-field textarea:focus { border-color: var(--red); }
.np-field textarea { resize: none; }

/* ===== SUMMARY BOX ===== */
.np-summary-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 20px;
}
.np-summary-client {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.np-summary-client span { color: var(--muted); font-size: 12px; }
.np-summary-client strong { font-size: 15px; }

.np-summary-items { padding: 8px 0; }
.np-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
}
.np-summary-item span { color: var(--muted); font-size: 12px; }

.np-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-top: 2px solid var(--border);
  font-size: 15px;
}
.np-summary-total span { color: var(--muted); font-weight: 700; }
.np-summary-total strong { font-size: 22px; font-weight: 900; color: var(--red); }

/* ===== BOTTOM BAR ===== */
.np-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  z-index: 50;
}
.np-bottom-bar.two { display: flex; gap: 10px; }
.np-bottom-bar.two .np-btn-secondary { flex: 0 0 auto; }
.np-bottom-bar.two .np-btn-primary { flex: 1; }

.np-btn-primary {
  display: block; width: 100%;
  padding: 16px;
  background: var(--red);
  color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 17px; font-weight: 800;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.np-btn-primary:active { background: var(--red-dark); }
.np-btn-primary:disabled { opacity: .4; pointer-events: none; }

.np-btn-secondary {
  padding: 16px 20px;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.np-btn-secondary:active { background: #f5f5f5; }

/* ===== SUCCESS ===== */
#screen-success { padding-bottom: 40px; }
.np-success-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 12px;
  padding: 32px 16px;
}
.np-success-icon {
  width: 72px; height: 72px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  font-size: 36px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.np-success-wrap h2 { font-size: 24px; font-weight: 900; }
.np-success-wrap p { font-size: 15px; color: var(--muted); }
.np-success-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 16px; }

/* ===== TOAST ===== */
.np-toast {
  position: fixed;
  bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #222; color: #fff;
  padding: 12px 24px; border-radius: 24px;
  font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; white-space: nowrap;
  max-width: 90vw; z-index: 200;
}
.np-toast.error { background: var(--red); }
.np-toast.success { background: #2e7d32; }
.np-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
