:root {
  color-scheme: dark;
  --page-pad-x: clamp(14px, 4vw, 28px);
  --page-pad-y: clamp(14px, 3vh, 32px);
  --touch-min: 44px;
  --sidebar-w: 240px;
  --jis-dash-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --jis-dash-dur: 0.55s;
  --bg-0: #0b0908;
  --bg-spot-maroon: #241a1c;
  --bg-spot-olive: #12180f;
  --card: rgba(22, 16, 18, 0.78);
  --card-border: rgba(255, 240, 235, 0.07);
  --text: #f0ebe8;
  --muted: #9c918c;
  --maroon-deep: #5c252c;
  --olive: #4d5c32;
  --accent-gradient-mid: #6b3a42;
  --btn-text: #faf6f4;
  --danger-muted: rgba(200, 100, 110, 0.14);
  --danger-border: rgba(200, 110, 118, 0.35);
  --success-muted: rgba(95, 118, 72, 0.16);
  --success-border: rgba(120, 142, 88, 0.38);
  --success-text: #d8e4c4;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --transition: 180ms ease;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  background: radial-gradient(
      1100px 720px at 50% -8%,
      var(--bg-spot-maroon) 0%,
      var(--bg-0) 52%
    ),
    radial-gradient(900px 600px at 100% 100%, var(--bg-spot-olive), transparent 55%);
  background-color: var(--bg-0);
  color: var(--text);
}

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

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(var(--page-pad-y), env(safe-area-inset-top, 0px))
    max(var(--page-pad-x), env(safe-area-inset-right, 0px))
    max(var(--page-pad-y), env(safe-area-inset-bottom, 0px))
    max(var(--page-pad-x), env(safe-area-inset-left, 0px));
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
}

.landing {
  text-align: center;
  justify-content: flex-start;
  align-items: stretch;
}

.landing-glow {
  position: absolute;
  width: min(520px, 140vw);
  height: min(520px, 140vw);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  animation: pulse-glow 10s ease-in-out infinite alternate;
}

.landing-glow-1 {
  top: -120px;
  left: 50%;
  transform: translateX(-55%);
  background: radial-gradient(circle, rgba(140, 55, 68, 0.38), transparent 60%);
}

.landing-glow-2 {
  bottom: -180px;
  right: -80px;
  background: radial-gradient(circle, rgba(75, 95, 48, 0.36), transparent 60%);
  animation-delay: -3s;
}

@keyframes pulse-glow {
  from {
    opacity: 0.35;
    transform: translateX(-55%) scale(1);
  }
  to {
    opacity: 0.55;
    transform: translateX(-48%) scale(1.05);
  }
}

.landing-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 4vw, 28px);
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
}

.logo-float-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  animation: float-y 4.8s ease-in-out infinite;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.logo-img {
  display: block;
  width: min(360px, min(88vw, 100%));
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
  border-radius: clamp(16px, 5vw, 28px);
}

.logo-img--auth {
  display: block;
  width: auto;
  height: auto;
  max-height: 72px;
  max-width: min(160px, 48vw);
  margin-inline: auto;
  border-radius: var(--radius-sm);
}

.landing-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: min(22rem, 100%);
  padding-inline: 4px;
}

.landing-welcome-title {
  margin: 0;
  font-size: clamp(1.45rem, 4.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  animation: welcome-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both,
    welcome-glow 5s ease-in-out 1.15s infinite;
}

.landing-welcome-title::after {
  content: "";
  display: block;
  height: 2px;
  margin: 12px auto 0;
  width: min(200px, 55vw);
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #8b3d45, #8fa366, transparent);
  opacity: 0.85;
  animation: welcome-line 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.75s both;
}

@keyframes welcome-line {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.landing-welcome-sub {
  margin: 0;
  font-size: clamp(0.9rem, 2.8vw, 1.02rem);
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  animation: welcome-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes welcome-rise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes welcome-glow {
  0%,
  100% {
    text-shadow: 0 0 26px rgba(140, 60, 70, 0.2);
  }
  50% {
    text-shadow: 0 0 32px rgba(95, 118, 65, 0.28), 0 0 22px rgba(120, 55, 65, 0.18);
  }
}

.landing-cta {
  min-width: min(200px, 100%);
  width: min(280px, 100%);
  min-height: var(--touch-min);
  justify-content: center;
  animation: welcome-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.85s both;
}

.landing-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: clamp(12px, 3vh, 24px);
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  font-size: clamp(0.75rem, 2.5vw, 0.8rem);
  color: var(--muted);
  opacity: 0.75;
  text-align: center;
  width: 100%;
}

.auth-page {
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.auth-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(520px 420px at 50% 0%, rgba(120, 50, 60, 0.14), transparent 60%),
    radial-gradient(480px 400px at 80% 80%, rgba(70, 88, 45, 0.14), transparent 55%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(26.25rem, calc(100vw - 2 * var(--page-pad-x)));
  margin-inline: auto;
  padding: clamp(22px, 5vw, 32px) clamp(18px, 4vw, 28px) clamp(20px, 4vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(16px);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-min);
  margin-bottom: 18px;
  padding-block: 4px;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
}

.auth-back:hover {
  color: var(--text);
  transform: translateX(-2px);
}

.auth-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 4.2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.field-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.field-hint {
  margin: -6px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.field--remember {
  gap: 6px;
}

.field-remember-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-remember-label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.field-hint--remember {
  margin: 0;
  padding-left: 28px;
}

.input-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: rgba(160, 85, 95, 0.95);
  cursor: pointer;
}

.input {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 235, 230, 0.09);
  background: rgba(14, 10, 11, 0.72);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input:focus {
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.22);
  background: rgba(12, 9, 10, 0.88);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-muted);
  border: 1px solid var(--danger-border);
  color: #f0c8cc;
  font-size: 0.9rem;
}

.form-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-muted);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition),
    color var(--transition), border-color var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--maroon-deep), var(--accent-gradient-mid) 45%, var(--olive));
  box-shadow: 0 12px 32px rgba(60, 28, 32, 0.45);
}

.btn-primary:hover {
  box-shadow: 0 16px 44px rgba(90, 45, 50, 0.5), 0 0 0 1px rgba(143, 163, 102, 0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(130, 150, 95, 0.35);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  min-height: var(--touch-min);
}

.btn-block {
  width: 100%;
  padding: 14px 18px;
  margin-top: 4px;
  min-height: var(--touch-min);
}

.success-card {
  text-align: center;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--maroon-deep), var(--olive));
  box-shadow: 0 12px 36px rgba(50, 28, 32, 0.45);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

.success-actions .btn {
  min-height: var(--touch-min);
  padding-inline: 20px;
}

@media (max-width: 640px) {
  .input {
    font-size: 16px;
  }
}

/* —— User avatars —— */
.jk-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.jk-avatar--img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.jk-avatar--header {
  width: 38px;
  height: 38px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.jk-avatar--lg {
  width: 88px;
  height: 88px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.jk-avatar--xl {
  width: 112px;
  height: 112px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.48);
}

.jk-avatar--fallback {
  background: linear-gradient(135deg, var(--maroon-deep), var(--accent-gradient-mid) 48%, var(--olive));
  color: var(--btn-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.jk-avatar--header .jk-avatar-initials {
  font-size: 0.85rem;
}

.jk-avatar--lg .jk-avatar-initials {
  font-size: 1.35rem;
}

.jk-avatar--xl .jk-avatar-initials {
  font-size: 1.65rem;
}

/* —— Settings & edit profile —— */
.page.jis-settings-page {
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-top: max(clamp(20px, 4vh, 36px), env(safe-area-inset-top, 0px));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(32px, 6vh, 56px), env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

.jis-settings-top {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto 28px;
  text-align: center;
}

.jis-settings-page-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.jis-settings-page-lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.jis-settings-profile {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto 32px;
}

.jis-settings-profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.jis-settings-profile-name {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 600;
}

.jis-settings-profile-user {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.jis-settings-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.jis-settings-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 108px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  background: rgba(22, 16, 18, 0.55);
  border: 1px solid rgba(255, 240, 235, 0.08);
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.jis-settings-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 163, 102, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.jis-settings-tile:focus-visible {
  outline: none;
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.22);
}

.jis-settings-tile-kicker {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.85);
}

.jis-settings-tile-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}

.jis-settings-tile-desc {
  margin-top: auto;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.jis-settings-form-wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
}

.jis-settings-profile-preview {
  margin-bottom: 22px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  text-align: center;
}

.jis-settings-section-label {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.jis-settings-hint {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.jis-settings-form-wrap .jk-avatar--xl {
  margin: 0 auto;
  display: flex;
}

.jis-settings-form .input:focus {
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.22);
}

.input-file {
  padding: 10px 12px;
  font-size: 0.88rem;
  cursor: pointer;
}

.input-file::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--maroon-deep), var(--accent-gradient-mid) 45%, var(--olive));
  cursor: pointer;
}

.input-file::file-selector-button:hover {
  filter: brightness(1.06);
}

/* —— J.E.S shared —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page.jis-inner-page {
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-top: max(clamp(20px, 4vh, 36px), env(safe-area-inset-top, 0px));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(28px, 6vh, 48px), env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

/* Reused by settings / edit-profile backgrounds */
.jis-dashboard-glow,
.jis-inner-glow {
  position: absolute;
  width: min(520px, 130vw);
  height: min(520px, 130vw);
  border-radius: 50%;
  filter: blur(96px);
  opacity: 0.32;
  pointer-events: none;
}

.jis-dashboard-glow-1 {
  top: -120px;
  left: 45%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(110, 42, 52, 0.4), transparent 62%);
}

.jis-dashboard-glow-2 {
  bottom: -160px;
  right: -10%;
  background: radial-gradient(circle, rgba(58, 78, 38, 0.36), transparent 58%);
}

/* —— Dashboard: minimal dark + motion —— */
.page.jis-dashboard {
  --jis-dash-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --jis-dash-dur: 0.55s;
  position: relative;
  justify-content: flex-start;
  align-items: stretch;
  padding-top: max(clamp(16px, 3.5vw, 28px), env(safe-area-inset-top, 0px));
  padding-right: max(clamp(14px, 4vw, 32px), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(28px, 6vh, 56px), env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(14px, 4vw, 32px), env(safe-area-inset-left, 0px));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  isolation: isolate;
}

.jis-dashboard-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.jis-dashboard-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.55;
  animation: jis-orb-drift 18s ease-in-out infinite;
}

.jis-dashboard-orb--a {
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(92, 37, 44, 0.55) 0%, transparent 68%);
  animation-delay: 0s;
}

.jis-dashboard-orb--b {
  width: min(380px, 85vw);
  height: min(380px, 85vw);
  top: 20%;
  right: -15%;
  background: radial-gradient(circle, rgba(45, 58, 32, 0.5) 0%, transparent 65%);
  animation-delay: -6s;
  animation-duration: 22s;
}

.jis-dashboard-orb--c {
  width: min(300px, 70vw);
  height: min(300px, 70vw);
  bottom: -5%;
  left: 35%;
  background: radial-gradient(circle, rgba(70, 48, 52, 0.45) 0%, transparent 70%);
  animation-delay: -12s;
  animation-duration: 20s;
}

@keyframes jis-orb-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.45;
  }
  50% {
    transform: translate(12px, -18px) scale(1.06);
    opacity: 0.62;
  }
}

.jis-dashboard-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.jis-dash-reveal {
  opacity: 0;
  animation: jis-dash-rise var(--jis-dash-dur) var(--jis-dash-ease) forwards;
}

.jis-dash-reveal--2 {
  animation-delay: 0.08s;
}

.jis-dash-reveal--3 {
  animation-delay: 0.16s;
}

.jis-dash-reveal--4 {
  animation-delay: 0.24s;
}

.jis-dash-reveal--5 {
  animation-delay: 0.32s;
}

@keyframes jis-dash-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jis-dashboard-topbar {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(28px, 5vh, 44px);
}

.jis-dashboard-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(14, 10, 11, 0.55);
  border: 1px solid rgba(255, 240, 235, 0.07);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  transition: border-color 0.35s var(--jis-dash-ease), box-shadow 0.35s var(--jis-dash-ease);
}

.jis-dashboard-topbar-inner:hover {
  border-color: rgba(255, 240, 235, 0.1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.42);
}

.jis-dashboard-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.jis-dashboard-brand-mark {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text);
}

.jis-dashboard-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.jis-dashboard-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.jis-dashboard-topbar-actions .jk-avatar {
  box-shadow: 0 0 0 2px rgba(255, 240, 235, 0.08);
  transition: transform 0.35s var(--jis-dash-ease), box-shadow 0.35s var(--jis-dash-ease);
}

.jis-dashboard-topbar-actions .jk-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(143, 163, 102, 0.35);
}

.jis-dashboard-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.jis-dashboard-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.jis-dashboard-user-handle {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.jis-dashboard-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 240, 235, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--jis-dash-ease), background 0.25s ease;
}

.jis-dashboard-pill:hover {
  color: var(--text);
  border-color: rgba(143, 163, 102, 0.35);
  background: rgba(143, 163, 102, 0.08);
  transform: translateY(-1px);
}

.jis-dashboard-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.28);
}

.jis-dashboard-pill--accent {
  color: var(--btn-text);
  border: none;
  background: linear-gradient(135deg, var(--maroon-deep), var(--accent-gradient-mid) 48%, var(--olive));
  box-shadow: 0 6px 22px rgba(50, 24, 28, 0.45);
}

.jis-dashboard-pill--accent:hover {
  color: var(--btn-text);
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.jis-dashboard-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.jis-dashboard-hero {
  margin-bottom: clamp(32px, 6vh, 52px);
  padding-bottom: clamp(24px, 4vh, 36px);
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
}

.jis-dashboard-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.jis-dashboard-hero-line {
  margin: 0;
  max-width: 28rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.jis-dashboard-section-label {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.75);
  text-align: center;
}

.jis-dashboard-modules {
  margin-bottom: clamp(48px, 9vh, 80px);
}

.jis-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2.4vw, 22px);
}

/* Dashboard category sections (Inventory / Manufacturing / Finance / Analytics) */
.jis-dash-category {
  margin-top: clamp(28px, 5vh, 52px);
  padding-top: clamp(10px, 1.6vh, 16px);
  position: relative;
}

.jis-dash-category:first-of-type {
  margin-top: 0;
}

.jis-dash-category::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: min(820px, 92%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 240, 235, 0.14), transparent);
  opacity: 0.7;
}

.jis-dash-category:first-of-type::before {
  display: none;
}

/* Minimal accent per category */
.jis-dash-category--inventory .jis-dashboard-section-label {
  color: rgba(155, 210, 180, 0.85);
}
.jis-dash-category--manufacturing .jis-dashboard-section-label {
  color: rgba(180, 200, 255, 0.85);
}
.jis-dash-category--finance .jis-dashboard-section-label {
  color: rgba(255, 205, 160, 0.85);
}
.jis-dash-category--analytics .jis-dashboard-section-label {
  color: rgba(200, 175, 255, 0.88);
}
.jis-dash-category--customers .jis-dashboard-section-label {
  color: rgba(170, 230, 210, 0.85);
}

.jis-dash-category--inventory .jis-dash-tile::after {
  background: linear-gradient(180deg, rgba(80, 160, 120, 0.9), rgba(120, 190, 150, 0.65));
}
.jis-dash-category--manufacturing .jis-dash-tile::after {
  background: linear-gradient(180deg, rgba(100, 140, 220, 0.9), rgba(165, 190, 255, 0.65));
}
.jis-dash-category--finance .jis-dash-tile::after {
  background: linear-gradient(180deg, rgba(210, 120, 70, 0.95), rgba(255, 195, 120, 0.65));
}
.jis-dash-category--analytics .jis-dash-tile::after {
  background: linear-gradient(180deg, rgba(150, 110, 220, 0.92), rgba(210, 185, 255, 0.68));
}
.jis-dash-category--customers .jis-dash-tile::after {
  background: linear-gradient(180deg, rgba(90, 190, 155, 0.92), rgba(165, 235, 205, 0.66));
}

.jis-dash-category--inventory .jis-dash-tile:hover {
  border-color: rgba(95, 170, 135, 0.28);
}
.jis-dash-category--manufacturing .jis-dash-tile:hover {
  border-color: rgba(125, 165, 240, 0.28);
}
.jis-dash-category--finance .jis-dash-tile:hover {
  border-color: rgba(230, 150, 95, 0.3);
}
.jis-dash-category--analytics .jis-dash-tile:hover {
  border-color: rgba(175, 150, 235, 0.32);
}
.jis-dash-category--customers .jis-dash-tile:hover {
  border-color: rgba(130, 210, 180, 0.28);
}

.jis-dash-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 146px;
  padding: 22px 22px 20px;
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
  background: rgba(18, 13, 14, 0.65);
  border: 1px solid rgba(255, 240, 235, 0.06);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.4s var(--jis-dash-ease), border-color 0.35s ease, box-shadow 0.4s var(--jis-dash-ease);
  animation: jis-tile-in 0.6s var(--jis-dash-ease) backwards;
}

.jis-dashboard-grid .jis-dash-tile:nth-child(1) {
  animation-delay: 0.12s;
}
.jis-dashboard-grid .jis-dash-tile:nth-child(2) {
  animation-delay: 0.18s;
}
.jis-dashboard-grid .jis-dash-tile:nth-child(3) {
  animation-delay: 0.24s;
}
.jis-dashboard-grid .jis-dash-tile:nth-child(4) {
  animation-delay: 0.3s;
}

.jis-dashboard-grid .jis-dash-tile:nth-child(5) {
  animation-delay: 0.36s;
}

@keyframes jis-tile-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jis-dash-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 10% 0%, rgba(120, 55, 65, 0.18), transparent 45%),
    radial-gradient(100% 70% at 100% 100%, rgba(80, 100, 50, 0.12), transparent 50%);
  opacity: 0;
  transition: opacity 0.45s var(--jis-dash-ease);
  pointer-events: none;
}

.jis-dash-tile:hover::before {
  opacity: 1;
}

.jis-dash-tile::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(180, 95, 105, 0.85), rgba(120, 140, 80, 0.65));
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: top;
  transition: opacity 0.35s ease, transform 0.45s var(--jis-dash-ease);
}

.jis-dash-tile:hover::after {
  opacity: 1;
  transform: scaleY(1);
}

.jis-dash-tile:hover {
  transform: translateY(-6px);
  border-color: rgba(143, 163, 102, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(120, 70, 78, 0.12);
}

.jis-dash-tile:active {
  transform: translateY(-3px) scale(0.99);
}

.jis-dash-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
}

.jis-dash-tile--muted {
  background: rgba(14, 11, 12, 0.5);
  border-style: dashed;
  border-color: rgba(255, 240, 235, 0.1);
}

.jis-dash-tile--muted:hover {
  border-style: solid;
}

.jis-dash-tile-index {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(156, 145, 140, 0.55);
  font-variant-numeric: tabular-nums;
}

.jis-dash-tile-title {
  position: relative;
  z-index: 1;
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Link tiles: no hint text — leave space for the corner arrow */
a.jis-dash-tile > .jis-dash-tile-title {
  margin-bottom: 22px;
}

.jis-dash-tile-hint {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.jis-dash-tile-arrow {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
  font-size: 1.1rem;
  color: rgba(156, 145, 140, 0.45);
  transition: transform 0.45s var(--jis-dash-ease), color 0.35s ease;
}

.jis-dash-tile:hover .jis-dash-tile-arrow {
  transform: translateX(4px);
  color: rgba(200, 190, 185, 0.9);
}

.jis-dashboard-tools .jis-dash-tile {
  animation-delay: 0.36s;
}

.jis-dash-tile--narrow {
  max-width: 320px;
}

@media (max-width: 1024px) {
  .jis-dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .jis-dash-tile--narrow {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .jis-dashboard-topbar-inner {
    border-radius: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .jis-dashboard-topbar-actions {
    justify-content: flex-start;
  }

  .jis-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jis-dashboard-orb,
  .jis-dash-reveal,
  .jis-dash-tile {
    animation: none !important;
  }

  .jis-dash-reveal,
  .jis-dash-tile {
    opacity: 1;
    transform: none;
  }

  .jis-dash-tile:hover {
    transform: none;
  }
}

/* Inner placeholder pages */
.jis-inner-glow {
  top: -80px;
  right: -40px;
  background: radial-gradient(circle, rgba(100, 52, 60, 0.28), transparent 60%);
}

.jis-inner-head {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 28px;
  text-align: center;
}

.jis-inner-back {
  display: inline-flex;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
}

.jis-inner-back:hover {
  color: var(--text);
  transform: translateX(-2px);
}

.jis-inner-title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.jis-inner-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.jis-inner-placeholder {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: rgba(18, 14, 15, 0.55);
  border: 1px solid rgba(255, 240, 235, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.jis-inner-placeholder p {
  margin: 0;
}

/* ================================================================
   J.E.S App Shell — sidebar + main content layout
   ================================================================ */

.jis-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: radial-gradient(
      1100px 720px at 50% -8%,
      var(--bg-spot-maroon) 0%,
      var(--bg-0) 52%
    ),
    radial-gradient(900px 600px at 100% 100%, var(--bg-spot-olive), transparent 55%);
  background-color: var(--bg-0);
}

/* ---- Sidebar ---- */
.jis-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(9, 7, 6, 0.82);
  border-right: 1px solid rgba(255, 240, 235, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow-y: auto;
  overflow-x: hidden;
}

.jis-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 240, 235, 0.05);
  flex-shrink: 0;
  text-decoration: none;
}

.jis-sidebar-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 11px;
  flex-shrink: 0;
}

.jis-sidebar-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.jis-sidebar-brand-mark {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.jis-sidebar-brand-sub {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.6);
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 240, 235, 0.05);
}

.jis-sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 10px 10px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.jis-sidebar-section-label {
  display: block;
  padding: 14px 10px 5px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.45);
}

.jis-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(240, 235, 232, 0.58);
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
  text-decoration: none;
  min-height: 38px;
}

.jis-sidebar-item:hover {
  background: rgba(255, 240, 235, 0.06);
  color: rgba(240, 235, 232, 0.88);
}

.jis-sidebar-item.active {
  background: rgba(92, 37, 44, 0.2);
  color: var(--text);
}

.jis-sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--maroon-deep), var(--olive));
}

.jis-sidebar-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.jis-sidebar-divider {
  height: 1px;
  margin: 6px 10px;
  background: rgba(255, 240, 235, 0.05);
}

/* Sidebar footer — user info + logout */
.jis-sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 240, 235, 0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jis-sidebar-user {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 240, 235, 0.03);
  border: 1px solid rgba(255, 240, 235, 0.05);
}

.jis-sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.jis-sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.jis-sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jis-sidebar-user-handle {
  font-size: 0.73rem;
  color: var(--muted);
}

.jis-sidebar-logout {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(230, 185, 190, 0.78);
  border: 1px solid rgba(200, 100, 110, 0.2);
  background: rgba(200, 100, 110, 0.08);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.jis-sidebar-logout:hover {
  background: rgba(200, 100, 110, 0.16);
  color: #f0c8cc;
  border-color: rgba(200, 100, 110, 0.32);
}

.jis-sidebar-nav li {
  list-style: none;
  margin: 0;
}

/* ---- Team directory ---- */
.jis-team .jis-team-table-wrap {
  max-width: 820px;
  overflow-x: auto;
  border: 1px solid rgba(255, 240, 235, 0.08);
  border-radius: 16px;
  background: rgba(16, 11, 12, 0.45);
}

.jis-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.jis-team-table th,
.jis-team-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
}

.jis-team-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.75);
  background: rgba(8, 6, 7, 0.35);
}

.jis-team-table tbody tr:last-child td {
  border-bottom: none;
}

.jis-team-th-photo {
  width: 52px;
}

.jis-team-td-photo {
  width: 52px;
  padding-right: 4px;
}

.jis-team-display {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.jis-team-handle {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.jis-team-status-line {
  margin: 0;
  max-width: 42rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(200, 195, 190, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jis-team-status-empty {
  font-size: 0.85rem;
  color: rgba(156, 145, 140, 0.45);
}

.jis-team-status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.jis-team-status-input {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.jis-team-status-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.jis-team-status-hint {
  margin: 6px 0 0;
  width: 100%;
  flex-basis: 100%;
  font-size: 0.72rem;
  color: rgba(156, 145, 140, 0.65);
  line-height: 1.35;
}

.jis-team-flash {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  background: rgba(80, 140, 110, 0.18);
  border: 1px solid rgba(120, 190, 150, 0.25);
  color: rgba(210, 240, 220, 0.95);
}

.jis-team-flash--err {
  background: rgba(120, 40, 50, 0.2);
  border-color: rgba(200, 90, 100, 0.3);
  color: rgba(255, 210, 210, 0.95);
}

/* ---- App main area ---- */
.jis-app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.jis-app-ambient {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.jis-app-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-top: max(clamp(28px, 4vw, 44px), env(safe-area-inset-top, 0px));
  padding-right: max(clamp(22px, 4vw, 40px), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(36px, 6vh, 64px), env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(22px, 4vw, 40px), env(safe-area-inset-left, 0px));
  max-width: 100%;
}

/* ---- Page header (title block centered; back button top-left) ---- */
.jis-page-header {
  position: relative;
  margin-bottom: clamp(24px, 4vh, 40px);
  padding-bottom: clamp(18px, 3vh, 28px);
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
  width: 100%;
  min-width: 0;
}

.jis-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: var(--touch-min);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  text-decoration: none;
  background: rgba(10, 8, 9, 0.28);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.jis-back-btn:hover {
  border-color: rgba(130, 150, 95, 0.35);
  background: rgba(10, 8, 9, 0.38);
  transform: translateY(-1px);
}

.jis-back-btn:active {
  transform: translateY(0);
}

.jis-back-btn--header {
  position: absolute;
  left: 0;
  top: 0;
  margin-top: 0;
  z-index: 2;
}

.jis-page-header-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: clamp(52px, 14vw, 80px);
  text-align: center;
  box-sizing: border-box;
}

/* Optional right-side action area (e.g. Download Excel) */
.jis-page-header-right {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Match bills toolbar button sizing */
.jis-page-header-right .btn {
  min-height: var(--touch-min);
  padding: 12px 16px;
  font-size: 0.95rem;
}

.jis-page-breadcrumb {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.55);
  text-align: center;
}

.jis-page-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  text-align: center;
}

.jis-page-lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 34rem;
  text-align: center;
}

/* ---- Coming soon placeholder ---- */
.jis-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-height: 260px;
  padding: 40px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 240, 235, 0.08);
  background: rgba(16, 11, 12, 0.4);
}

.jis-coming-soon-icon {
  font-size: 2.2rem;
  opacity: 0.3;
  line-height: 1;
}

.jis-coming-soon-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.5);
}

.jis-coming-soon-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(240, 235, 232, 0.5);
}

.jis-coming-soon-text {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(156, 145, 140, 0.6);
  max-width: 26rem;
  line-height: 1.6;
}

/* ---- Dashboard home ---- */
.jis-dash-welcome {
  margin-bottom: clamp(28px, 5vh, 48px);
  text-align: center;
}

.jis-dash-welcome-greeting {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  text-align: center;
}

.jis-dash-welcome-sub {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

/* ---- App-shell form card (change-* pages) ---- */
.jis-form-card {
  width: 100%;
  max-width: 28rem;
  background: rgba(16, 11, 12, 0.65);
  border: 1px solid rgba(255, 240, 235, 0.07);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 32px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.jis-form-card-title {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.jis-form-card-sub {
  margin: 0 0 24px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

/* ---- Settings page in app shell ---- */
.jis-settings-app-wrap {
  width: 100%;
  max-width: 860px;
}

.jis-settings-profile-card-v2 {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(18, 13, 14, 0.6);
  border: 1px solid rgba(255, 240, 235, 0.07);
  margin-bottom: clamp(24px, 4vh, 36px);
}

.jis-settings-profile-card-v2-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.jis-settings-profile-card-v2-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.jis-settings-profile-card-v2-handle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.jis-settings-history-card {
  margin-top: clamp(28px, 5vh, 44px);
  padding: clamp(18px, 3vw, 24px) clamp(16px, 3vw, 22px);
  border-radius: 16px;
  background: rgba(18, 13, 14, 0.6);
  border: 1px solid rgba(255, 240, 235, 0.07);
}

.jis-settings-history-card-head {
  margin-bottom: 14px;
}

.jis-settings-history-title {
  margin: 0 0 6px;
}

.jis-settings-history-lead {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52rem;
}

.jis-settings-history-empty {
  margin: 0;
  padding: 20px 8px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.jis-settings-history-wrap {
  width: 100%;
  max-height: min(480px, 58vh);
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 240, 235, 0.08);
  background: rgba(10, 8, 9, 0.35);
}

.jis-settings-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.jis-settings-history-table th,
.jis-settings-history-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
  vertical-align: top;
}

.jis-settings-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(12, 10, 11, 0.98);
  backdrop-filter: blur(6px);
}

.jis-settings-history-table tbody tr:last-child td {
  border-bottom: none;
}

.jis-settings-history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.jis-settings-history-cell--time {
  white-space: nowrap;
  color: rgba(240, 235, 232, 0.82);
  font-variant-numeric: tabular-nums;
}

.jis-settings-history-cell--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: rgba(200, 192, 188, 0.95);
}

.jis-settings-history-summary {
  color: var(--text);
  line-height: 1.4;
}

.jis-audit-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.jis-audit-pill--insert {
  background: rgba(95, 118, 65, 0.22);
  color: rgba(200, 215, 175, 0.95);
}

.jis-audit-pill--update {
  background: rgba(120, 90, 55, 0.25);
  color: rgba(230, 200, 165, 0.95);
}

.jis-audit-pill--delete {
  background: rgba(120, 55, 65, 0.28);
  color: rgba(240, 190, 195, 0.95);
}

/* ---- Edit profile in app shell ---- */
.jis-edit-profile-wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(20px, 3vw, 36px);
  width: 100%;
  max-width: 700px;
  align-items: start;
}

.jis-edit-profile-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-radius: 16px;
  background: rgba(16, 11, 12, 0.45);
  border: 1px solid rgba(255, 240, 235, 0.06);
  text-align: center;
}

.jis-edit-profile-avatar-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.5);
}

.jis-edit-profile-avatar-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(156, 145, 140, 0.6);
  line-height: 1.5;
}

.jis-edit-profile-form-col {
  background: rgba(16, 11, 12, 0.5);
  border: 1px solid rgba(255, 240, 235, 0.07);
  border-radius: 18px;
  padding: clamp(20px, 3vw, 28px);
}

/* ---- Mobile: sidebar becomes top-nav ---- */
.jis-app-topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: 12px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(9, 7, 6, 0.9);
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}

.jis-app-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(200px, 42vw);
}

.jis-app-topbar-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.jis-app-topbar-brand-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jis-app-topbar-trailing {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
  justify-content: flex-end;
}

.jis-app-topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.jis-app-topbar-username {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 6.5rem;
}

.jis-app-topbar-team {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(200, 230, 240, 0.85);
  border: 1px solid rgba(130, 200, 220, 0.2);
  background: rgba(130, 200, 220, 0.08);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.jis-app-topbar-team:hover {
  color: var(--text);
  border-color: rgba(130, 200, 220, 0.38);
  background: rgba(130, 200, 220, 0.16);
}

.jis-app-topbar-logout {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(230, 185, 190, 0.82);
  border: 1px solid rgba(200, 100, 110, 0.22);
  background: rgba(200, 100, 110, 0.1);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.jis-app-topbar-logout:hover {
  background: rgba(200, 100, 110, 0.2);
  color: #f0c8cc;
  border-color: rgba(200, 100, 110, 0.35);
}

/* App shell footer — Settings (replaces former mobile scroll nav) */
.jis-app-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
  padding-right: max(clamp(22px, 4vw, 40px), env(safe-area-inset-right, 0px));
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(22px, 4vw, 40px), env(safe-area-inset-left, 0px));
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(255, 240, 235, 0.06);
  background: rgba(9, 7, 6, 0.72);
  backdrop-filter: blur(10px);
}

.jis-app-footer-settings {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(240, 235, 232, 0.72);
  text-decoration: none;
  border: 1px solid rgba(255, 240, 235, 0.08);
  background: rgba(255, 240, 235, 0.04);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.jis-app-footer-settings:hover {
  color: var(--text);
  border-color: rgba(200, 100, 110, 0.22);
  background: rgba(92, 37, 44, 0.15);
}

.jis-app-footer-settings.is-active {
  color: var(--text);
  border-color: rgba(200, 100, 110, 0.28);
  background: rgba(92, 37, 44, 0.22);
}

.jis-app-footer-settings-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}

@media (max-width: 860px) {
  .jis-sidebar {
    display: none;
  }

  .jis-app-main {
    margin-left: 0;
  }

  .jis-app-ambient {
    left: 0;
  }

  .jis-app-topbar-mobile {
    display: flex;
  }

  .jis-app-topbar-brand {
    max-width: min(168px, 46vw);
  }

  .jis-dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .jis-edit-profile-wrap {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .jis-edit-profile-avatar-col {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
  }

  .jis-settings-app-wrap {
    max-width: 100%;
  }

  .jis-settings-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .jis-form-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .jis-settings-profile-card-v2 {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .jis-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .jis-app-content {
    padding-top: max(18px, env(safe-area-inset-top, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-bottom: max(36px, env(safe-area-inset-bottom, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
  }

  .jis-page-breadcrumb {
    letter-spacing: 0.12em;
    font-size: 0.62rem;
  }

  .jis-dashboard-topbar-inner {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jis-app-ambient .jis-dashboard-orb,
  .jis-dash-reveal,
  .jis-dash-tile {
    animation: none !important;
  }

  .jis-dash-reveal {
    opacity: 1;
    transform: none;
  }

  .jis-dash-tile {
    opacity: 1;
  }
}

/* ================================================================
   Login page — enhanced dark card
   ================================================================ */

.jis-login-page {
  justify-content: center;
  align-items: center;
}

/* Post-login welcome splash */
.jes-welcome-splash {
  overflow: hidden;
}

.jes-welcome-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.85rem, 2.5vh, 1.35rem);
  max-width: min(24rem, 92vw);
}

.jes-welcome-logo-stage {
  opacity: 0;
  transform: scale(0.94);
  animation: jes-welcome-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0s forwards;
}

.jes-welcome-logo-orbit {
  display: inline-block;
  line-height: 0;
  transform-origin: 50% 50%;
  animation: jes-welcome-logo-spin 14s linear 0.75s infinite;
}

.jes-welcome-logo-img {
  display: block;
  width: min(80px, 22vw);
  height: min(80px, 22vw);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.42);
}

@keyframes jes-welcome-logo-spin {
  to {
    transform: rotate(360deg);
  }
}

.jes-welcome-tagline {
  margin: 0;
  font-size: clamp(0.92rem, 3.2vw, 1.08rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--muted);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(14px);
  animation: jes-welcome-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.jes-welcome-rule {
  width: 0;
  max-width: 56px;
  height: 1px;
  margin: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(240, 235, 232, 0.22) 20%,
    rgba(240, 235, 232, 0.22) 80%,
    transparent
  );
  animation: jes-welcome-rule 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.42s forwards;
}

.jes-welcome-acronym {
  margin: 0;
  font-size: clamp(1.85rem, 7vw, 2.65rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  animation: jes-welcome-rise 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.jes-welcome-continue {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.75rem, 6vh, 3rem);
  opacity: 0;
  animation: jes-welcome-fade 0.85s ease 1.15s forwards;
}

@keyframes jes-welcome-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jes-welcome-fade {
  to {
    opacity: 1;
  }
}

@keyframes jes-welcome-rule {
  to {
    width: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jes-welcome-logo-stage {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .jes-welcome-logo-orbit {
    animation: none;
  }

  .jes-welcome-tagline,
  .jes-welcome-acronym,
  .jes-welcome-continue {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .jes-welcome-rule {
    animation: none;
    width: 40px;
  }
}

.jis-login-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.jis-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: jis-orb-drift 18s ease-in-out infinite;
}

.jis-login-orb--a {
  width: min(480px, 100vw);
  height: min(480px, 100vw);
  top: -20%;
  left: -10%;
  background: radial-gradient(circle, rgba(92, 37, 44, 0.5) 0%, transparent 65%);
}

.jis-login-orb--b {
  width: min(400px, 90vw);
  height: min(400px, 90vw);
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(45, 68, 30, 0.45) 0%, transparent 65%);
  animation-delay: -9s;
}

.jis-login-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: min(26.25rem, calc(100vw - 2 * var(--page-pad-x)));
}

.jis-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0 6px;
}

.jis-login-brand-link {
  display: block;
  line-height: 0;
  border-radius: 12px;
  transition: transform var(--transition);
}

.jis-login-brand-link:hover {
  transform: scale(1.03);
}

.jis-login-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.jis-login-brand-mark {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.jis-login-brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.jis-login-card {
  width: 100%;
  animation: welcome-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.jis-login-back {
  font-size: 0.85rem;
  color: rgba(156, 145, 140, 0.65);
  transition: color var(--transition);
}

.jis-login-back:hover {
  color: var(--muted);
}

/* ================================================================
   Landing page — polished
   ================================================================ */

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200, 190, 180, 0.75);
  border: 1px solid rgba(255, 240, 235, 0.1);
  background: rgba(255, 240, 235, 0.04);
  animation: welcome-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.landing-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon-deep), var(--olive));
  flex-shrink: 0;
}

/* ================================================================
   Ingredient Items page
   ================================================================ */

/* ---- Toolbar: search + add button ---- */
.jis-pack-toolbar,
.jis-ing-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 4vh, 32px);
  flex-wrap: wrap;
}

.jis-pack-search-wrap,
.jis-ing-search-wrap {
  flex: 1 1 200px;
  position: relative;
}

.jis-pack-search-icon,
.jis-ing-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  opacity: 0.7;
}

.jis-pack-search,
.jis-ing-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 235, 230, 0.09);
  background: rgba(14, 10, 11, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.jis-pack-search:focus,
.jis-ing-search:focus {
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.22);
  background: rgba(12, 9, 10, 0.88);
}

.jis-pack-search::placeholder,
.jis-ing-search::placeholder {
  color: rgba(156, 145, 140, 0.5);
}

/* Clear button inside <input type="search"> */
.jis-pack-search::-webkit-search-cancel-button,
.jis-ing-search::-webkit-search-cancel-button {
  opacity: 0.5;
  cursor: pointer;
}

.jis-pack-add-btn,
.jis-ing-add-btn {
  padding: 11px 20px;
  white-space: nowrap;
  min-height: var(--touch-min);
}

/* ---- Card grid ---- */
.jis-pack-grid,
.jis-ing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.jis-pack-card,
.jis-ing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(18, 13, 14, 0.62);
  border: 1px solid rgba(255, 240, 235, 0.07);
  text-align: center;
  cursor: pointer;
  animation: jis-dash-rise 0.48s var(--jis-dash-ease) both;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

/* Stock edit (pencil icon) on cards */
.jis-stock-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 8, 9, 0.45);
  color: rgba(235, 230, 225, 0.92);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.jis-stock-edit-btn:hover {
  border-color: rgba(130, 150, 95, 0.35);
  background: rgba(10, 8, 9, 0.6);
  transform: translateY(-1px);
}
.jis-stock-edit-btn:active {
  transform: translateY(0);
}
.jis-stock-edit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.35);
}
.jis-stock-edit-icon {
  font-size: 14px;
  line-height: 1;
}

.jis-pack-card:focus,
.jis-ing-card:focus {
  outline: none;
}

.jis-pack-card:focus-visible,
.jis-ing-card:focus-visible {
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 70, 78, 0.28);
}

/* Stagger newly built JS cards */
.jis-pack-card--new,
.jis-ing-card--new {
  animation: jis-dash-rise 0.38s var(--jis-dash-ease) both;
}

.jis-pack-card:hover,
.jis-ing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(143, 163, 102, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
}

.jis-pack-card-img-wrap,
.jis-ing-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 8, 9, 0.55);
  flex-shrink: 0;
}

.jis-pack-card-img,
.jis-ing-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jis-pack-card-placeholder,
.jis-ing-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: linear-gradient(
    135deg,
    rgba(92, 37, 44, 0.22),
    rgba(77, 92, 50, 0.18)
  );
}

.jis-pack-card-name,
.jis-ing-card-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.jis-ing-card-qty,
.jis-pack-card-qty {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.jis-ing-card-qty-label,
.jis-pack-card-qty-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.jis-ing-card-qty-val,
.jis-pack-card-qty-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(180, 200, 150, 0.95);
  line-height: 1.2;
}

/* Ensure card action buttons are clickable (cards are clickable too). */

/* ---- Empty state ---- */
.jis-pack-empty,
.jis-ing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-height: 260px;
  padding: 40px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 240, 235, 0.08);
  background: rgba(16, 11, 12, 0.4);
}

.jis-pack-empty-icon,
.jis-ing-empty-icon {
  font-size: 2.4rem;
  opacity: 0.22;
  line-height: 1;
}

.jis-pack-empty-title,
.jis-ing-empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(240, 235, 232, 0.52);
}

.jis-pack-empty-text,
.jis-ing-empty-text {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(156, 145, 140, 0.65);
  max-width: 24rem;
  line-height: 1.6;
}

/* ---- No search-results message ---- */
.jis-pack-no-results,
.jis-ing-no-results {
  display: none;
  margin-top: 8px;
  text-align: center;
  padding: 32px 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ================================================================
   Modal
   ================================================================ */
#jis-detail-backdrop,
#jis-pack-detail-backdrop {
  z-index: 320;
}

.jis-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.jis-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.jis-modal {
  position: relative;
  width: 100%;
  max-width: 468px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(14, 10, 12, 0.97);
  border: 1px solid rgba(255, 240, 235, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.68);
  transform: translateY(22px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.jis-modal-backdrop.is-open .jis-modal {
  transform: translateY(0) scale(1);
}

.jis-modal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
  position: sticky;
  top: 0;
  background: rgba(14, 10, 12, 0.97);
  z-index: 1;
}

.jis-modal-title {
  grid-column: 2;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  justify-self: center;
  max-width: 100%;
}

.jis-modal-close {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.jis-modal-close:hover {
  background: rgba(200, 100, 110, 0.18);
  color: #f0c8cc;
}

.jis-modal-body {
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Feedback ---- */
.jis-modal-feedback {
  display: none;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
}

.jis-modal-feedback.is-error {
  display: block;
  background: var(--danger-muted);
  border: 1px solid var(--danger-border);
  color: #f0c8cc;
}

.jis-modal-feedback.is-success {
  display: block;
  background: var(--success-muted);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.jis-modal-feedback.is-pending {
  display: block;
  background: rgba(255, 240, 235, 0.04);
  border: 1px solid rgba(255, 240, 235, 0.1);
  color: var(--muted);
}

/* ---- Image upload area ---- */
.jis-img-upload-area {
  border-radius: var(--radius-sm);
  border: 1.5px dashed rgba(255, 240, 235, 0.14);
  background: rgba(10, 8, 9, 0.4);
  overflow: hidden;
  transition: border-color var(--transition);
}

.jis-img-upload-area:focus-within {
  border-color: rgba(180, 95, 105, 0.4);
}

/* Preview strip */
.jis-img-preview {
  position: relative;
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(8, 6, 7, 0.7);
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
}

.jis-img-preview.has-image {
  display: block;
}

.jis-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.jis-img-preview-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.62);
  color: rgba(240, 200, 204, 0.88);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.jis-img-preview-clear:hover {
  background: rgba(150, 45, 55, 0.78);
}

/* Upload buttons row */
.jis-img-upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  flex-wrap: wrap;
}

.jis-img-upload-label,
.jis-cam-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 36px;
  white-space: nowrap;
}

.jis-img-upload-label:hover,
.jis-cam-btn:hover {
  color: var(--text);
  border-color: rgba(143, 163, 102, 0.3);
  background: rgba(143, 163, 102, 0.08);
}

.jis-upload-hint {
  margin-left: auto;
  font-size: 0.7rem;
  color: rgba(156, 145, 140, 0.4);
  white-space: nowrap;
}

/* ---- Webcam live view ---- */
.jis-webcam-wrap {
  display: none;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
}

.jis-webcam-wrap.is-active {
  display: flex;
}

.jis-webcam-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  display: block;
}

.jis-webcam-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: rgba(8, 6, 7, 0.85);
}

.jis-webcam-snap-btn,
.jis-webcam-cancel-btn {
  padding: 9px 18px;
  font-size: 0.85rem;
  min-height: 38px;
}

/* ---- Modal action row ---- */
.jis-modal-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.jis-modal-cancel-btn {
  padding: 11px 20px;
  min-height: var(--touch-min);
}

.jis-modal-submit-btn {
  padding: 11px 24px;
  min-height: var(--touch-min);
}

/* ---- Ingredient detail modal (view + delete) ---- */
.jis-pack-detail-modal,
.jis-ing-detail-modal {
  max-width: min(440px, 100%);
}

.jis-pack-detail-body,
.jis-ing-detail-body {
  gap: 18px;
}

.jis-pack-detail-hero,
.jis-ing-detail-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(52vh, 320px);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(10, 8, 9, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.jis-pack-detail-hero-img,
.jis-ing-detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.jis-pack-detail-hero-placeholder,
.jis-ing-detail-hero-placeholder {
  font-size: 4rem;
  opacity: 0.35;
  line-height: 1;
}

.jis-pack-detail-meta,
.jis-ing-detail-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jis-pack-detail-meta-row,
.jis-ing-detail-meta-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 10px 14px;
  align-items: start;
  font-size: 0.88rem;
}

.jis-pack-detail-meta-row dt,
.jis-ing-detail-meta-row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(156, 145, 140, 0.75);
}

.jis-pack-detail-meta-row dd,
.jis-ing-detail-meta-row dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.jis-pack-detail-actions,
.jis-ing-detail-actions {
  margin-top: 4px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.jis-pack-detail-actions--save,
.jis-ing-detail-actions--save {
  margin-top: 0;
  justify-content: stretch;
}

.jis-pack-detail-actions--save .btn,
.jis-ing-detail-actions--save .btn {
  width: 100%;
  justify-content: center;
}

.jis-detail-edit-field {
  margin-bottom: 0;
}

.jis-detail-img-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: rgba(156, 145, 140, 0.65);
  line-height: 1.45;
}

.jis-btn-danger {
  color: #f5d4d8;
  background: rgba(120, 40, 52, 0.45);
  border: 1px solid rgba(200, 100, 110, 0.45);
  box-shadow: 0 6px 20px rgba(60, 20, 26, 0.35);
}

.jis-btn-danger:hover {
  background: rgba(140, 48, 58, 0.58);
  border-color: rgba(220, 120, 130, 0.55);
  color: #fff;
}

.jis-btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ================================================================
   Responsive overrides
   ================================================================ */
@media (max-width: 520px) {
  .jis-pack-grid,
  .jis-ing-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .jis-pack-add-btn,
  .jis-ing-add-btn {
    width: 100%;
    justify-content: center;
  }

  .jis-pack-search-wrap,
  .jis-ing-search-wrap {
    flex-basis: 100%;
  }

  .jis-modal-header,
  .jis-modal-body {
    padding-inline: 18px;
  }

  .jis-pack-detail-meta-row,
  .jis-ing-detail-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .jis-pack-detail-meta-row dt,
  .jis-ing-detail-meta-row dt {
    margin-bottom: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jis-pack-card,
  .jis-pack-card--new,
  .jis-ing-card,
  .jis-ing-card--new {
    animation: none;
    opacity: 1;
  }

  .jis-pack-card:hover,
  .jis-ing-card:hover {
    transform: none;
  }

  .jis-modal-backdrop,
  .jis-modal {
    transition: none;
  }
}

/* ================================================================
   Extra breakpoints — small phones, landscape, ingredient toolbar
   ================================================================ */
@media (max-width: 480px) {
  .jis-pack-toolbar,
  .jis-ing-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .jis-pack-search-wrap,
  .jis-ing-search-wrap {
    flex-basis: auto;
    width: 100%;
  }

  .jis-pack-add-btn,
  .jis-ing-add-btn {
    width: 100%;
  }

  .jis-page-title {
    font-size: clamp(1.28rem, 6.5vw, 1.85rem);
    word-wrap: break-word;
  }

  .jis-coming-soon {
    padding: clamp(18px, 5vw, 28px) clamp(14px, 4vw, 22px);
    min-height: 200px;
  }

  .jis-dash-tile {
    min-height: 0;
    padding: 18px 16px 16px;
  }

  .jis-modal-backdrop {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }

  .jis-modal {
    max-height: min(calc(100dvh - 24px), calc(100vh - 24px));
  }
}

@media (max-width: 380px) {
  .jis-app-topbar-username {
    max-width: 4.5rem;
  }

  .jis-app-topbar-logout {
    padding-inline: 7px;
    font-size: 0.68rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .jis-login-wrap {
    gap: 12px;
    padding-block: 8px;
  }

  .jis-login-card .auth-sub {
    margin-bottom: 12px;
  }

  .jis-login-card .auth-form {
    gap: 12px;
  }
}

/* Snappier taps on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .jis-back-btn,
  .jis-dash-tile,
  .jis-settings-tile,
  .jis-sidebar-item,
  .jis-app-topbar-logout,
  .jis-sidebar-logout {
    -webkit-tap-highlight-color: rgba(255, 240, 235, 0.08);
  }
}

/* ================================================================
   Products — ingredient picker & card count badge
   ================================================================ */

/* Wider add modal to give the picker more room */
.jis-prod-modal,
.jis-prod-detail-modal {
  max-width: min(560px, 100%);
}

/* Scrollable picker container */
.jis-prod-ing-picker {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 240, 235, 0.09);
  background: rgba(8, 6, 7, 0.55);
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 95, 105, 0.3) transparent;
}

.jis-prod-ing-picker::-webkit-scrollbar {
  width: 4px;
}
.jis-prod-ing-picker::-webkit-scrollbar-track {
  background: transparent;
}
.jis-prod-ing-picker::-webkit-scrollbar-thumb {
  background: rgba(180, 95, 105, 0.3);
  border-radius: 2px;
}

.jis-prod-ing-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

/* Each selectable ingredient tile */
.jis-prod-ing-picker-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 240, 235, 0.07);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  /* Allow the per-hamper quantity row to render below the image without clipping */
  overflow: visible;
  transition: border-color 180ms ease, background 180ms ease,
              box-shadow 180ms ease, transform 180ms ease;
  outline: none;
}

.jis-prod-ing-picker-card:hover {
  border-color: rgba(180, 95, 105, 0.35);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.jis-prod-ing-picker-card:focus-visible {
  border-color: rgba(180, 95, 105, 0.55);
  box-shadow: 0 0 0 2px rgba(180, 95, 105, 0.22);
}

.jis-prod-ing-picker-card.is-selected {
  border-color: rgba(180, 95, 105, 0.80);
  background: rgba(180, 95, 105, 0.12);
  box-shadow: 0 0 0 2px rgba(180, 95, 105, 0.18),
              0 4px 16px rgba(180, 95, 105, 0.18);
  transform: translateY(-1px);
}

/* Checkmark overlay on image — hidden unless selected */
.jis-prod-ing-picker-card-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(180, 95, 105, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 1;
}

.jis-prod-ing-picker-card.is-selected .jis-prod-ing-picker-card-check {
  opacity: 1;
  transform: scale(1);
}

/* Square image area — fills the card top */
.jis-prod-ing-picker-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}

.jis-prod-ing-picker-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease;
}

.jis-prod-ing-picker-card:hover .jis-prod-ing-picker-img {
  transform: scale(1.05);
}

.jis-prod-ing-picker-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.03);
}

/* Ingredient name sits in a padded footer strip */
.jis-prod-ing-picker-name {
  margin: 0;
  padding: 5px 6px 6px;
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  color: var(--text);
  opacity: 0.78;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.18);
}

.jis-prod-ing-picker-card.is-selected .jis-prod-ing-picker-name {
  color: #f5d4d8;
  opacity: 1;
}

/* Hint text below the picker */
.jis-prod-picker-hint {
  margin: 7px 0 0;
  font-size: 0.73rem;
  color: rgba(156, 145, 140, 0.45);
  display: flex;
  align-items: center;
  gap: 5px;
}

.jis-prod-picker-hint::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(156, 145, 140, 0.35);
  flex-shrink: 0;
}

/* Empty message when no ingredients exist */
.jis-prod-picker-empty {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 12px 4px;
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

/* Ingredient count badge on the product card */
.jis-prod-card-ing-count {
  margin: 2px 0 0;
  font-size: 0.64rem;
  color: var(--muted);
  opacity: 0.7;
  line-height: 1;
}

@media (max-width: 480px) {
  .jis-prod-ing-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
  }

  .jis-prod-ing-picker-card:hover {
    transform: none;
  }
}

/* Product detail — available weights */
.jis-prod-weights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 8px;
}

.jis-prod-weights-placeholder {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.75;
}

.jis-prod-weights-loading,
.jis-prod-weights-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  padding: 4px 0;
}

.jis-prod-weight-add-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.jis-prod-weight-input {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
}

.jis-prod-weight-unit {
  font-size: 0.82rem;
  color: var(--muted);
}

.jis-prod-weight-add-btn {
  flex: 1 1 auto;
  min-width: 120px;
}

.jis-prod-weight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 240, 235, 0.08);
}

.jis-prod-weight-item-left {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.jis-prod-weight-price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.jis-prod-weight-price-input {
  width: 5.5rem;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.jis-prod-weight-price-save {
  font-size: 0.72rem;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ---- Selling Price (per 100 g) page ---- */

.jis-selling-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.jis-selling-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 240, 235, 0.1);
  background: rgba(10, 8, 9, 0.45);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jis-selling-card-media {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.25);
}

.jis-selling-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jis-selling-card-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.45;
}

.jis-selling-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.jis-selling-card-stock {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.jis-selling-card-field {
  margin: 0;
}

.jis-selling-card-feedback {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.78rem;
}

.jis-selling-card-feedback.is-success {
  color: rgba(160, 210, 170, 0.95);
}

.jis-selling-card-feedback.is-error {
  color: rgba(240, 160, 170, 0.95);
}

.jis-prod-weight-grams {
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.jis-prod-weight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.jis-prod-weight-pkg-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(180, 95, 105, 0.14);
  border: 1px solid rgba(180, 95, 105, 0.28);
  color: rgba(245, 210, 216, 0.92);
}

.jis-prod-weight-del {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.jis-prod-weight-del:hover {
  background: rgba(200, 100, 110, 0.18);
  color: #f5d4d8;
}

.jis-prod-weight-feedback {
  display: none;
  margin: 8px 0 0;
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 6px 10px;
}

.jis-prod-weight-feedback.is-error {
  display: block;
  background: var(--danger-muted);
  border: 1px solid var(--danger-border);
  color: #f5c6cb;
}

.jis-prod-weight-feedback.is-success {
  display: block;
  background: var(--success-muted);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

/* Packaging picker — above product detail modal */
.jis-pkg-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.jis-pkg-picker-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.jis-pkg-picker-modal {
  position: relative;
  width: 100%;
  max-width: min(500px, 100%);
  max-height: min(calc(100dvh - 32px), calc(100vh - 32px));
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: rgba(14, 10, 12, 0.98);
  border: 1px solid rgba(255, 240, 235, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.2s ease;
}

.jis-pkg-picker-backdrop.is-open .jis-pkg-picker-modal {
  transform: translateY(0) scale(1);
}

.jis-pkg-picker-actions {
  margin-top: 16px;
}

/* Hamper boxes (edit-packages) */
.jis-hamper-modal,
.jis-hamper-detail-modal {
  max-width: min(720px, 96vw);
}

.jis-hamper-picker-block {
  margin-bottom: 4px;
}

/* Per-item quantity used inside hamper pickers (inline; avoids blocked window.prompt) */
.jis-hamper-picker-qty {
  padding: 8px 8px 10px;
  border-top: 1px solid rgba(255, 240, 235, 0.08);
  background: rgba(8, 6, 7, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jis-hamper-picker-qty-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(235, 230, 225, 0.62);
}

.jis-hamper-picker-qty-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.82rem;
  min-height: 36px;
}

.jis-hamper-card-summary {
  margin: 2px 0 0;
  font-size: 0.64rem;
  color: var(--muted);
  opacity: 0.78;
  line-height: 1.2;
}

.jis-hamper-combined-hint {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Bills */
.jis-bills-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2.5vh, 24px);
  position: relative;
  z-index: 200;
}

.jis-bill-new-wrap {
  position: relative;
  z-index: 201;
}

/* Make the bills toolbar buttons feel consistent */
.jis-bills-toolbar .btn {
  min-height: var(--touch-min);
  padding: 12px 16px;
  font-size: 0.95rem;
}

.jis-bills-toolbar--split {
  width: 100%;
}

.jis-bills-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.jis-bills-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 clamp(16px, 2.2vh, 22px);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 240, 235, 0.1);
  background: rgba(10, 8, 9, 0.35);
}

.jis-bills-filter-label {
  font-weight: 650;
  font-size: 0.82rem;
  color: rgba(235, 230, 225, 0.72);
}

.jis-bills-filter-select {
  min-width: 132px;
  max-width: 100%;
}

.jis-bills-filter-apply {
  min-height: var(--touch-min);
}

.jis-bills-filter-hint {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.jis-bills-month-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.jis-bills-sum-row td {
  border-top: 1px solid rgba(255, 240, 235, 0.12);
  padding-top: 12px;
  padding-bottom: 4px;
  background: rgba(8, 6, 7, 0.25);
}

.jis-bills-sum-inline {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: rgba(235, 230, 225, 0.88);
}

.jis-bill-new-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-md);
  /* Fully opaque so nothing behind receives clicks or shows through */
  background-color: #1a1618;
  background-image: none;
  border: 1px solid rgba(255, 240, 235, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  z-index: 202;
  pointer-events: auto;
}

.jis-bill-new-menu[hidden] {
  display: none !important;
}

.jis-bill-new-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background-color: #1a1618;
  color: var(--text);
  font-size: 0.86rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  pointer-events: auto;
}

.jis-bill-new-menu-item:hover {
  background-color: #252022;
}

.jis-bills-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 240, 235, 0.08);
  background: rgba(10, 8, 9, 0.35);
}

.jis-bills-empty {
  margin: 0;
  padding: clamp(20px, 4vw, 32px);
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.jis-bills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.jis-bills-table th,
.jis-bills-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
  vertical-align: top;
}

.jis-bills-table th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.jis-bills-table tbody tr:last-child td {
  border-bottom: none;
}

.jis-bills-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.jis-bills-table-wrap--minimal {
  border-color: rgba(255, 240, 235, 0.06);
}

.jis-bills-table--minimal th,
.jis-bills-table--minimal td {
  padding: 9px 12px;
  vertical-align: middle;
}

.jis-row-clickable {
  cursor: pointer;
}

.jis-row-clickable:focus {
  outline: 2px solid rgba(130, 150, 95, 0.55);
  outline-offset: -2px;
}

.jis-row-detail-modal {
  max-width: min(560px, 96vw);
}

.jis-row-detail-body {
  font-size: 0.88rem;
  line-height: 1.45;
}

.jis-row-detail-dl {
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.jis-row-detail-dl-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 1rem;
  align-items: baseline;
}

.jis-row-detail-dl-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.jis-row-detail-dl-row dd {
  margin: 0;
  color: rgba(245, 238, 235, 0.92);
}

.jis-row-detail-subh {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.jis-row-detail-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.jis-row-detail-lines th,
.jis-row-detail-lines td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 240, 235, 0.06);
}

.jis-row-detail-lines th {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.15);
}

.jis-row-detail-lines tbody tr:last-child td {
  border-bottom: none;
}

.jis-row-detail-empty {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.jis-mfg-detail-product {
  margin-bottom: 1.15rem;
}

.jis-mfg-detail-product:last-child {
  margin-bottom: 0;
}

.jis-mfg-detail-product-head {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  color: rgba(245, 238, 235, 0.9);
}

.jis-mfg-detail-ing-table {
  margin-top: 0.25rem;
}

.jis-mfg-detail-no-ing {
  margin-top: 0.25rem;
}

.jis-bills-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.jis-bills-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 240, 235, 0.06);
  border: 1px solid rgba(255, 240, 235, 0.12);
  color: rgba(245, 238, 235, 0.88);
}

.jis-bills-cat--ingredient {
  background: rgba(130, 150, 95, 0.14);
  border-color: rgba(130, 150, 95, 0.32);
  color: rgba(220, 235, 200, 0.96);
}

.jis-bills-cat--packaging {
  background: rgba(100, 155, 200, 0.14);
  border-color: rgba(120, 175, 215, 0.35);
  color: rgba(200, 228, 248, 0.96);
}

.jis-bills-cat--other {
  background: rgba(200, 150, 115, 0.12);
  border-color: rgba(215, 165, 125, 0.32);
  color: rgba(255, 220, 195, 0.95);
}

.jis-bills-details {
  color: rgba(245, 238, 235, 0.78);
  line-height: 1.45;
  max-width: 36rem;
}

.jis-bills-extra-reason {
  color: rgba(245, 238, 235, 0.72);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 14rem;
}

.jis-bill-ing-extra-input {
  max-width: 12rem;
}

.jis-bill-ing-modal {
  max-width: min(520px, 96vw);
}

.jis-bill-ing-lines-hint {
  margin: 0 0 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.jis-bill-ing-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.jis-bill-ing-line,
.jis-bill-pkg-line {
  display: grid;
  grid-template-columns: 1fr 88px 88px 32px;
  gap: 8px;
  align-items: center;
}

@media (max-width: 520px) {
  .jis-bill-ing-line,
  .jis-bill-pkg-line {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .jis-bill-ing-line .jis-bill-ing-sel,
  .jis-bill-pkg-line .jis-bill-pkg-sel {
    grid-column: 1 / -1;
  }

  .jis-bill-ing-rm {
    justify-self: end;
  }
}

.jis-bill-ing-rm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(200, 100, 110, 0.12);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}

.jis-bill-ing-rm:hover {
  background: rgba(200, 100, 110, 0.22);
  color: #f5d4d8;
}

.jis-bill-ing-add-line {
  margin-top: 4px;
}

.jis-bill-ing-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 240, 235, 0.08);
}

.jis-bill-ing-total-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.jis-bill-ing-total-val {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Manufactured batches ---- */
.jis-mfg-toolbar-hint {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 0.82rem;
  color: var(--muted);
  align-self: center;
}

.jis-mfg-toolbar {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.jis-mfg-modal {
  max-width: min(560px, 96vw);
}

.jis-mfg-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 240, 235, 0.08);
}

.jis-mfg-section-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.jis-mfg-ing-block {
  margin-top: 8px;
}

.jis-mfg-ing-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.jis-mfg-ing-row {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 120px) auto;
  gap: 10px;
  align-items: center;
}

.jis-mfg-ing-label {
  font-size: 0.84rem;
  color: var(--text);
}

.jis-mfg-ing-unit {
  font-size: 0.78rem;
  color: var(--muted);
}

.jis-mfg-produced-input {
  max-width: 12rem;
}

.jis-mfg-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jis-mfg-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 240, 235, 0.08);
}

.jis-mfg-queue-body {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.jis-mfg-queue-ing {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.jis-mfg-queue-rm {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.78rem;
}
