:root {
  --sj-cyan: #00a3d3;
  --sj-cyan-dark: #007fa6;
  --sj-cyan-deep: #0a5f7a;
  --sj-red: #f10720;
  --sj-ink: #101828;
  --sj-muted: #667085;
  --sj-soft: #eef2f6;
  --sj-line: #e4e7ec;
  --sj-card: #ffffff;
  --sj-radius: 24px;
  --sj-radius-sm: 16px;
  --sj-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --sj-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sj-font);
  color: var(--sj-ink);
  background: var(--sj-soft);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.sj-shell {
  min-height: 100vh;
  padding: 20px 28px 40px;
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  max-width: 100vw;
}

.sj-topbar {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  margin-bottom: 28px;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 0;
  background: linear-gradient(to bottom, var(--sj-soft) 70%, transparent);
}

.sj-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sj-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sj-brand strong {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.sj-brand span {
  display: block;
  font-size: 0.7rem;
  color: var(--sj-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sj-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sj-nav button {
  border: 0;
  background: transparent;
  color: var(--sj-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.18s ease;
}

.sj-nav button:hover {
  color: var(--sj-ink);
  background: rgba(255, 255, 255, 0.7);
}

.sj-nav button.is-active {
  color: var(--sj-ink);
  background: #fff;
  box-shadow: var(--sj-shadow);
}

.sj-utils {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.sj-ico {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sj-ico-fill {
  fill: currentColor;
  stroke: none;
}

.sj-kpi-logo .sj-ico {
  width: 20px;
  height: 20px;
}

.sj-icon-btn .sj-ico,
.sj-user button .sj-ico,
.sj-mobile-toggle .sj-ico {
  width: 18px;
  height: 18px;
}

.sj-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--sj-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--sj-shadow);
}

.sj-notify-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sj-red);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

.sj-notify-badge[hidden] {
  display: none !important;
}

.sj-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--sj-shadow);
  max-width: min(220px, 42vw);
}

.sj-user strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sj-logout-btn {
  box-shadow: none;
  background: var(--sj-soft);
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sj-view {
  display: none;
}

.sj-view.is-active {
  display: block;
}

.sj-grid-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  margin-bottom: 18px;
}

.sj-card {
  background: var(--sj-card);
  border-radius: var(--sj-radius);
  box-shadow: var(--sj-shadow);
  padding: 24px;
}

.sj-card-hero h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--sj-muted);
  font-weight: 600;
}

.sj-card-hero .meta {
  margin-top: 6px;
  color: var(--sj-muted);
  font-size: 0.85rem;
}

.sj-balance {
  margin: 18px 0 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  line-height: 1.15;
}

.sj-balance-num {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.sj-balance-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sj-muted);
}

.sj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sj-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.sj-btn-primary {
  background: var(--sj-cyan-deep);
  color: #fff;
}

.sj-btn-primary:hover {
  background: var(--sj-cyan-dark);
}

.sj-btn-ghost {
  background: var(--sj-soft);
  color: var(--sj-ink);
}

.sj-btn-ghost:hover {
  background: #e2e8f0;
}

.sj-promo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--sj-cyan-deep), var(--sj-cyan) 55%, #38bdf8);
  color: #fff;
  min-height: 220px;
}

.sj-promo::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.sj-promo::after {
  content: "";
  position: absolute;
  left: -10%;
  bottom: 18%;
  width: 140%;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.18), transparent 70%);
  transform: rotate(-8deg);
}

.sj-promo > * {
  position: relative;
  z-index: 1;
}

.sj-promo h3 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  line-height: 1.2;
  max-width: 12ch;
}

.sj-promo p {
  margin: 0 0 18px;
  opacity: 0.9;
  font-size: 0.9rem;
  max-width: 28ch;
}

.sj-promo .sj-btn {
  background: #fff;
  color: var(--sj-cyan-deep);
}

.sj-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.sj-kpi {
  padding: 18px;
}

.sj-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sj-kpi-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sj-soft);
  overflow: hidden;
}

.sj-kpi-logo img {
  width: 26px;
  height: 26px;
}

.sj-kpi-logo.tone-cyan { background: rgba(0, 163, 211, 0.12); color: var(--sj-cyan-dark); }
.sj-kpi-logo.tone-red { background: rgba(241, 7, 32, 0.1); color: var(--sj-red); }
.sj-kpi-logo.tone-violet { background: rgba(121, 40, 202, 0.1); color: #7928ca; }
.sj-kpi-logo.tone-amber { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.sj-menu-dots {
  border: 0;
  background: transparent;
  color: var(--sj-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.sj-kpi .label {
  font-size: 0.78rem;
  color: var(--sj-muted);
  margin-bottom: 8px;
}

.sj-kpi .value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sj-kpi .hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #12b76a;
  font-weight: 600;
}

.sj-bottom {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.sj-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.sj-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.sj-link {
  color: var(--sj-cyan-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sj-link .sj-ico {
  width: 14px;
  height: 14px;
}

.sj-btn .sj-ico {
  width: 16px;
  height: 16px;
}

.sj-table {
  width: 100%;
  border-collapse: collapse;
}

.sj-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sj-muted);
  padding: 0 8px 12px;
  font-weight: 700;
}

.sj-table td {
  padding: 14px 8px;
  border-top: 1px solid var(--sj-line);
  font-size: 0.9rem;
  vertical-align: middle;
}

.sj-entity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sj-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  background: rgba(0, 163, 211, 0.12);
  color: var(--sj-cyan-dark);
  flex-shrink: 0;
}

.sj-entity strong {
  display: block;
  font-size: 0.9rem;
}

.sj-entity span {
  color: var(--sj-muted);
  font-size: 0.78rem;
}

.sj-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--sj-soft);
  color: var(--sj-ink);
}

.sj-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.sj-pill.food { color: #7928ca; background: rgba(121, 40, 202, 0.1); }
.sj-pill.gold { color: #b45309; background: rgba(245, 158, 11, 0.14); }
.sj-pill.ok { color: #027a48; background: rgba(18, 183, 106, 0.12); }
.sj-pill.warn { color: #b54708; background: rgba(247, 144, 9, 0.14); }
.sj-pill.danger { color: #b42318; background: rgba(241, 7, 32, 0.1); }
.sj-pill.info { color: var(--sj-cyan-dark); background: rgba(0, 163, 211, 0.12); }

.sj-amount {
  font-weight: 800;
  white-space: nowrap;
}

.sj-amount.pos {
  color: #027a48;
}

.sj-analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.sj-analytics-stats > div {
  background: var(--sj-soft);
  border-radius: 14px;
  padding: 12px;
}

.sj-analytics-stats span {
  display: block;
  color: var(--sj-muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.sj-analytics-stats strong {
  font-size: 1rem;
}

.sj-chart-wrap {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
  align-items: center;
}

.sj-chart-box {
  position: relative;
  max-width: 220px;
  margin: 0 auto;
}

.sj-chart-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.sj-chart-center strong {
  font-size: 1.1rem;
  display: block;
}

.sj-chart-center span {
  color: var(--sj-muted);
  font-size: 0.75rem;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 auto;
  display: block;
}

.sj-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.sj-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--sj-muted);
  min-width: 0;
}

.sj-legend li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sj-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.sj-table-wrap.is-empty {
  display: none;
}

.sj-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sj-input,
.sj-select {
  border: 1px solid var(--sj-line);
  background: #fff;
  border-radius: 999px;
  padding: 11px 16px;
  min-width: min(180px, 100%);
  max-width: 100%;
  outline: none;
}

textarea.sj-input {
  border-radius: 16px;
  min-width: 100%;
  resize: vertical;
  font: inherit;
}

.sj-input:focus,
.sj-select:focus {
  border-color: var(--sj-cyan);
  box-shadow: 0 0 0 3px rgba(0, 163, 211, 0.15);
}

.sj-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.sj-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sj-stat-tile h4 {
  margin: 0 0 8px;
  color: var(--sj-muted);
  font-size: 0.85rem;
}

.sj-stat-tile .big {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.sj-stat-tile p {
  margin: 8px 0 0;
  color: var(--sj-muted);
  font-size: 0.8rem;
}

.sj-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.sj-zone-card h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.sj-zone-card p {
  margin: 0 0 14px;
  color: var(--sj-muted);
  font-size: 0.88rem;
}

.sj-zone-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.sj-ticket,
.sj-report {
  border: 1px solid var(--sj-line);
  border-radius: var(--sj-radius-sm);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  background: #fff;
}

.sj-ticket h4,
.sj-report h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.sj-ticket p,
.sj-report p {
  margin: 0;
  color: var(--sj-muted);
  font-size: 0.8rem;
}

.sj-empty {
  color: var(--sj-muted);
  font-size: 0.92rem;
  padding: 8px 0;
}

.sj-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sj-shadow);
  cursor: pointer;
  flex-shrink: 0;
  place-items: center;
}

/* —— Responsive breakpoints —— */

@media (max-width: 1200px) {
  .sj-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .sj-panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1100px) {
  .sj-grid-hero,
  .sj-bottom,
  .sj-zone-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sj-shell {
    padding: 18px 20px 36px;
  }

  .sj-nav {
    gap: 4px;
  }

  .sj-nav button {
    font-size: 0.84rem;
    padding: 9px 12px;
  }
}

@media (max-width: 960px) {
  .sj-topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .sj-mobile-toggle {
    display: grid;
    place-items: center;
    order: 0;
  }

  .sj-brand {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .sj-utils {
    order: 2;
    margin-left: 0;
  }

  .sj-nav {
    display: none;
    order: 3;
    width: 100%;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 18px;
    padding: 8px;
    box-shadow: var(--sj-shadow);
    overflow: visible;
    max-height: min(70vh, 480px);
    overflow-y: auto;
  }

  .sj-nav.is-open {
    display: flex;
  }

  .sj-nav button {
    text-align: left;
    border-radius: 12px;
    padding: 12px 14px;
  }

  .sj-user {
    padding: 0;
    background: transparent;
    box-shadow: none;
    max-width: none;
  }

  .sj-user strong {
    display: none;
  }

  .sj-logout-btn {
    background: #fff;
    box-shadow: var(--sj-shadow);
  }
}

@media (max-width: 860px) {
  .sj-shell {
    padding: 12px 14px 28px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .sj-grid-hero,
  .sj-bottom,
  .sj-kpi-row,
  .sj-panel-grid,
  .sj-zone-grid,
  .sj-chart-wrap,
  .sj-analytics-stats {
    grid-template-columns: 1fr;
  }

  .sj-card {
    padding: 18px 16px;
    border-radius: 20px;
  }

  .sj-card-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .sj-promo {
    min-height: auto;
  }

  .sj-promo h3 {
    max-width: none;
    font-size: 1.35rem;
  }

  .sj-promo p {
    max-width: none;
  }

  .sj-balance-num {
    font-size: clamp(1.75rem, 8vw, 2.4rem);
  }

  .sj-chart-wrap {
    gap: 20px;
  }

  .sj-legend {
    grid-template-columns: 1fr;
  }

  .sj-table-wrap:not(.is-empty) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sj-table-wrap:not(.is-empty) .sj-table {
    min-width: 520px;
  }

  .sj-toolbar .sj-input,
  .sj-toolbar .sj-select {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .sj-toolbar .sj-btn {
    flex: 1 1 auto;
  }

  #users-prev,
  #users-next {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .sj-ticket,
  .sj-report {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sj-ticket .sj-actions,
  .sj-report .sj-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }

  .sj-zone-metrics {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sj-chart-wrap {
    justify-items: center;
  }

  .sj-legend {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .sj-toast {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: none;
  }
}

@media (max-width: 520px) {
  .sj-brand span {
    display: none;
  }

  .sj-brand strong {
    font-size: 1.05rem;
  }

  .sj-utils {
    gap: 6px;
  }

  .sj-icon-btn {
    width: 38px;
    height: 38px;
  }

  .sj-kpi .value {
    font-size: 1.25rem;
  }

  .sj-stat-tile .big {
    font-size: 1.6rem;
  }

  .sj-table-wrap:not(.is-empty) .sj-table {
    min-width: 460px;
    font-size: 0.85rem;
  }

  .sj-table th,
  .sj-table td {
    padding: 10px 6px;
  }

  .sj-actions .sj-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  #pkg-form .sj-input,
  #pkg-form .sj-select,
  #promo-form .sj-input,
  #promo-form .sj-select {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .sj-shell {
    padding: 10px;
  }

  .sj-card {
    padding: 14px 12px;
  }
}

/* Login */
.sj-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 163, 211, 0.18), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(241, 7, 32, 0.12), transparent 30%),
    var(--sj-soft);
}

.sj-login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.1);
  padding: clamp(24px, 5vw, 36px) clamp(18px, 4vw, 32px);
}

.sj-login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.sj-login-brand img {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
}

.sj-login-brand h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.sj-login-brand p {
  margin: 8px 0 0;
  color: var(--sj-muted);
  font-size: 0.9rem;
}

.sj-field {
  margin-bottom: 16px;
}

.sj-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.sj-field input {
  width: 100%;
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  background: #fafbfc;
}

.sj-field input:focus {
  border-color: var(--sj-cyan);
  box-shadow: 0 0 0 3px rgba(0, 163, 211, 0.15);
}

.sj-login-card .sj-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
}

.sj-login-foot {
  margin-top: 22px;
  text-align: center;
  color: var(--sj-muted);
  font-size: 0.75rem;
}

.sj-alert {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(241, 7, 32, 0.08);
  color: #b42318;
  font-size: 0.85rem;
  font-weight: 600;
}

.sj-alert.is-visible {
  display: block;
}

.sj-empty {
  text-align: center;
  color: var(--sj-muted);
  padding: 28px 12px;
  font-size: 0.9rem;
}

.sj-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.sj-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sj-toast.is-error {
  background: #b42318;
}

.sj-toolbar .sj-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sj-ticket .sj-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Recruiter dialog */
.sj-dialog {
  border: none;
  padding: 0;
  border-radius: var(--sj-radius);
  background: transparent;
  max-width: 96vw;
}
.sj-dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
}
.sj-dialog[open] {
  display: block;
}
.sj-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.sj-badge-active { background: #e6f7fc; color: #007fa6; }
.sj-badge-archived { background: #f2f4f7; color: #667085; }
.sj-badge-declined { background: #fef3f2; color: #b42318; }
.sj-badge-job-on { background: #ecfdf3; color: #027a48; }
.sj-badge-job-off { background: #f2f4f7; color: #667085; }

/* Messaging + swipe */
.sj-msg-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  min-height: 62vh;
}
.sj-msg-list, .sj-msg-thread {
  display: flex;
  flex-direction: column;
  min-height: 62vh;
}
.sj-conv-list {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sj-conv-item {
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
}
.sj-conv-item.is-active, .sj-conv-item:hover {
  border-color: var(--sj-cyan);
  background: #f3fbfe;
}
.sj-conv-item strong { display:block; margin-bottom: 2px; }
.sj-thread-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sj-line);
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--sj-ink);
}
.sj-thread-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
  max-height: 48vh;
}
.sj-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.sj-bubble-me {
  align-self: flex-end;
  background: #00a3d3;
  color: #fff;
}
.sj-bubble-them {
  align-self: flex-start;
  background: #f2f4f7;
  color: var(--sj-ink);
}
.sj-msg-form {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.sj-msg-form input {
  flex: 1;
  border: 1px solid var(--sj-line);
  border-radius: 12px;
  padding: 12px 14px;
}
.sj-swipe-stage {
  margin-top: 18px;
  min-height: 280px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.sj-swipe-card {
  width: min(420px, 100%);
  border: 1px solid var(--sj-line);
  border-radius: 20px;
  padding: 22px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: var(--sj-shadow);
}
.sj-swipe-card h3 { margin: 0 0 6px; }
.sj-swipe-empty {
  padding: 48px 16px;
  text-align: center;
}
textarea {
  width: 100%;
  border: 1px solid var(--sj-line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
}
@media (max-width: 860px) {
  .sj-msg-layout {
    grid-template-columns: 1fr;
  }
  .sj-msg-list, .sj-msg-thread {
    min-height: auto;
  }
  .sj-thread-messages { max-height: 40vh; }
}
