:root {
  --fo-blue: #0071e3;
  --fo-blue-hover: #0077ed;
  --fo-blue-soft: #eaf4ff;
  --fo-green: #30b566;
  --fo-red: #ff3b30;
  --fo-orange: #ff9f0a;
  --fo-ink: #1d1d1f;
  --fo-muted: #6e6e73;
  --fo-subtle: #86868b;
  --fo-bg: #f5f5f7;
  --fo-surface: rgba(255, 255, 255, 0.86);
  --fo-surface-solid: #ffffff;
  --fo-border: rgba(29, 29, 31, 0.1);
  --fo-border-strong: rgba(29, 29, 31, 0.16);
  --fo-shadow: 0 12px 36px rgba(0, 0, 0, 0.055);
  --fo-shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.13);
  --fo-radius: 22px;
  --fo-radius-sm: 14px;
  --fo-sidebar-width: 272px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--fo-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fo-ink);
  background:
    radial-gradient(circle at 82% 2%, rgba(0, 113, 227, 0.08), transparent 28rem),
    var(--fo-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--fo-blue);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  width: var(--fo-sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  color: var(--fo-ink);
  background: rgba(250, 250, 252, 0.82);
  border-right: 1px solid var(--fo-border);
  box-shadow: 10px 0 42px rgba(0, 0, 0, 0.025);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  z-index: 1030;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 28px;
  color: var(--fo-ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 113, 227, 0.1);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.12), inset 0 1px rgba(255, 255, 255, 0.72);
}

.brand-mark img {
  width: 35px;
  height: 35px;
  display: block;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  margin-top: 2px;
  color: var(--fo-subtle);
  font-size: 0.72rem;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  gap: 6px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 13px;
  color: #515154;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sidebar-nav .nav-link i {
  width: 21px;
  text-align: center;
  color: #79797e;
  font-size: 1rem;
}

.sidebar-nav .nav-link:hover {
  color: var(--fo-ink);
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-nav .nav-link.active {
  color: #005ebc;
  font-weight: 650;
  background: var(--fo-blue-soft);
  border-color: rgba(0, 113, 227, 0.08);
}

.sidebar-nav .nav-link.active i {
  color: var(--fo-blue);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--fo-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--fo-radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.sidebar-user > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--fo-blue);
  font-size: 1.1rem;
  border-radius: 50%;
  background: var(--fo-blue-soft);
}

.sidebar-user-meta {
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user-name {
  overflow: hidden;
  color: var(--fo-ink);
  font-size: 0.88rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  margin-top: 3px;
  color: var(--fo-subtle);
  font-size: 0.72rem;
}

#logoutBtn {
  min-height: 38px;
  color: var(--fo-muted);
  background: transparent;
  border-color: transparent;
}

#logoutBtn:hover {
  color: var(--fo-red);
  background: rgba(255, 59, 48, 0.08);
}

/* ---------- App content ---------- */
.content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding: 20px 36px;
  background: rgba(245, 245, 247, 0.74);
  border-bottom: 1px solid rgba(29, 29, 31, 0.07);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.page-heading {
  min-width: 0;
}

.page-title {
  margin: 0;
  color: var(--fo-ink);
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  font-weight: 720;
  letter-spacing: -0.035em;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--fo-muted);
  font-size: 0.84rem;
}

.page-body {
  width: 100%;
  max-width: 1660px;
  margin: 0 auto;
  padding: 32px 36px 52px;
  flex: 1;
}

.jt-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: var(--fo-muted);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.045);
}

.jt-channel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}

.jt-channel.is-online {
  color: #167b41;
  background: rgba(48, 181, 102, 0.1);
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
}

.dot-on {
  background: var(--fo-green);
  box-shadow: 0 0 0 3px rgba(48, 181, 102, 0.14);
}

.dot-off {
  background: #b6b6bb;
}

/* ---------- Cards and sections ---------- */
.card {
  overflow: hidden;
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius);
  background: var(--fo-surface);
  box-shadow: var(--fo-shadow) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.card-body {
  padding: 24px;
}

.card-body > .d-flex.justify-content-between {
  gap: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  color: var(--fo-ink);
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--fo-blue);
  border-radius: 12px;
  background: var(--fo-blue-soft);
}

.section-copy {
  min-width: 0;
}

.section-copy p {
  margin: 4px 0 0;
  color: var(--fo-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.apple-note {
  padding: 12px 14px;
  color: #55555a;
  font-size: 0.8rem;
  line-height: 1.55;
  border: 1px solid rgba(0, 113, 227, 0.08);
  border-radius: 13px;
  background: rgba(0, 113, 227, 0.055);
}

.image-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--fo-border);
  border-radius: 15px;
  background: rgba(250, 250, 252, 0.74);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
}

.image-option-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--fo-blue);
  border-radius: 11px;
  background: var(--fo-blue-soft);
}

.image-option-copy {
  min-width: 0;
}

.image-option-copy label {
  display: block;
  margin: 0;
  color: var(--fo-ink);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.image-option-copy p {
  margin: 3px 0 0;
  color: var(--fo-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.image-option-switch {
  min-height: 0;
  margin: 0;
  padding-left: 0;
}

.image-option-switch .form-check-input {
  width: 42px;
  height: 24px;
  margin: 0;
  cursor: pointer;
  border-color: rgba(29, 29, 31, 0.16);
  background-color: #d2d2d7;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.image-option-switch .form-check-input:checked {
  border-color: var(--fo-blue);
  background-color: var(--fo-blue);
}

.image-option-switch .form-check-input:focus {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.btn-primary {
  color: #fff;
  background: var(--fo-blue);
  border-color: var(--fo-blue);
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background: var(--fo-blue-hover);
  border-color: var(--fo-blue-hover);
  box-shadow: 0 9px 24px rgba(0, 113, 227, 0.24);
}

.btn-outline-primary {
  color: var(--fo-blue);
  border-color: rgba(0, 113, 227, 0.28);
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--fo-blue);
  border-color: var(--fo-blue);
}

.btn-outline-secondary {
  color: #5c5c61;
  background: rgba(255, 255, 255, 0.68);
  border-color: var(--fo-border-strong);
}

.btn-outline-secondary:hover {
  color: var(--fo-ink);
  background: #fff;
  border-color: rgba(29, 29, 31, 0.24);
}

.btn-outline-danger,
.btn-danger {
  border-color: rgba(255, 59, 48, 0.28);
}

.btn-outline-danger {
  color: var(--fo-red);
  background: rgba(255, 255, 255, 0.62);
}

.btn-outline-danger:hover,
.btn-danger {
  color: #fff;
  background: var(--fo-red);
}

/* ---------- Forms ---------- */
.form-label {
  margin-bottom: 7px;
  color: #3a3a3c;
  font-size: 0.82rem;
  font-weight: 620;
}

.form-control,
.form-select {
  min-height: 46px;
  padding: 10px 13px;
  color: var(--fo-ink);
  border: 1px solid var(--fo-border-strong);
  border-radius: 12px;
  background-color: rgba(250, 250, 252, 0.9);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.015);
}

.form-control::placeholder {
  color: #aaaaaf;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--fo-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.form-check-input:checked {
  background-color: var(--fo-blue);
  border-color: var(--fo-blue);
}

.form-text,
.text-muted {
  color: var(--fo-muted) !important;
}

hr {
  margin: 22px 0;
  border-color: var(--fo-border);
  opacity: 1;
}

/* ---------- Tables ---------- */
.table-responsive {
  border: 1px solid var(--fo-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(0, 113, 227, 0.035);
  margin-bottom: 0;
  color: var(--fo-ink);
  font-size: 0.86rem;
}

.table > :not(caption) > * > * {
  padding: 13px 15px;
  border-bottom-color: var(--fo-border);
}

.table thead th {
  color: #5b5b60;
  background: rgba(245, 245, 247, 0.86);
  font-size: 0.76rem;
  font-weight: 680;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.history-task-row {
  cursor: pointer;
}

.history-task-row > * {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.history-task-row:hover > * {
  background: rgba(0, 113, 227, 0.055);
}

.history-task-row.is-selected > * {
  background: rgba(0, 113, 227, 0.1);
}

.history-task-row.is-selected > :first-child {
  box-shadow: inset 3px 0 0 var(--fo-blue);
}

.history-task-row:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.28);
  outline-offset: -3px;
}

.detail-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--fo-border);
  border-radius: 14px;
  background: rgba(250, 250, 252, 0.72);
}

.detail-table td {
  padding: 10px 12px !important;
  border-bottom-color: var(--fo-border) !important;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.detail-table td:first-child {
  width: 38%;
  color: var(--fo-muted);
  font-size: 0.78rem;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  font-weight: 650;
}

.bg-secondary {
  color: #5b5b60 !important;
  background: #ededf0 !important;
}

.bg-success {
  color: #167b41 !important;
  background: #e8f8ee !important;
}

.bg-warning {
  color: #936000 !important;
  background: #fff4d8 !important;
}

.bg-danger {
  color: #b3261e !important;
  background: #ffeceb !important;
}

.bg-primary {
  color: #005ebc !important;
  background: var(--fo-blue-soft) !important;
}

.download-module-badge {
  color: #005ebc;
  border: 1px solid rgba(0, 113, 227, 0.2);
  background: #e8f3ff;
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.01em;
}

/* ---------- Task entry and progress ---------- */
.input-mode-toggle {
  padding: 3px;
  border-radius: 12px;
  background: #ededf0;
}

.input-mode-toggle .btn {
  min-height: 30px;
  padding: 4px 13px;
  color: var(--fo-muted);
  border: 0;
  border-radius: 9px !important;
  background: transparent;
  box-shadow: none;
}

.input-mode-toggle .btn.active {
  color: var(--fo-ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submit-input-area {
  height: 240px;
  min-height: 240px;
}

#waybillsInput.submit-input-area {
  resize: none;
  line-height: 1.65;
}

.drop-zone {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px dashed rgba(0, 113, 227, 0.28);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(234, 244, 255, 0.7), rgba(255, 255, 255, 0.82));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--fo-blue);
  background: var(--fo-blue-soft);
  transform: translateY(-1px);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: rgba(48, 181, 102, 0.32);
  background: rgba(232, 248, 238, 0.76);
}

.drop-zone-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  text-align: center;
  pointer-events: none;
}

.drop-zone-inner i {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  color: var(--fo-blue);
  font-size: 1.55rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.1);
}

.drop-zone-title {
  color: var(--fo-ink);
  font-weight: 650;
}

.drop-zone-hint {
  color: var(--fo-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.rule-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fo-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.rule-strip i {
  color: var(--fo-blue);
}

.progress {
  height: 10px !important;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e7ea;
}

.progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #0071e3, #44a5ff);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-chip {
  padding: 11px 12px;
  color: var(--fo-muted);
  border: 1px solid var(--fo-border);
  border-radius: 13px;
  background: rgba(250, 250, 252, 0.76);
  font-size: 0.76rem;
}

.stat-chip b {
  display: block;
  margin-top: 2px;
  color: var(--fo-ink);
  font-size: 1rem;
}

#progressCard.task-recall-mode {
  margin-top: 0 !important;
}

.task-workspace {
  position: relative;
}

.task-workspace.is-transitioning {
  overflow: hidden;
  transition: height 240ms cubic-bezier(0.22, 0.78, 0.25, 1);
}

.view-panel-exit {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  transform-origin: center top;
  animation: view-panel-exit 180ms ease-in both;
}

.view-panel-enter {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  transform-origin: center top;
  animation: view-panel-enter 240ms cubic-bezier(0.22, 0.78, 0.25, 1) both;
}

@keyframes view-panel-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes view-panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.return-panel-exit {
  pointer-events: none;
  transform-origin: center top;
  animation: return-panel-exit 90ms ease-in both;
}

.return-panel-enter {
  transform-origin: center top;
  animation: return-panel-enter 170ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes return-panel-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-3px) scale(0.997);
  }
}

@keyframes return-panel-enter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.997);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Alerts, modals and toasts ---------- */
.alert {
  border: 0;
  border-radius: 14px;
  font-size: 0.86rem;
}

.alert-success {
  color: #166b3b;
  background: #eaf8ef;
}

.alert-warning {
  color: #805500;
  background: #fff5dc;
}

.alert-danger {
  color: #a72921;
  background: #ffedeb;
}

.alert-secondary {
  color: #55555a;
  background: #ededf0;
}

.modal-backdrop.show {
  opacity: 0.28;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-content {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: var(--fo-shadow-lg);
}

.modal-header,
.modal-footer {
  padding: 18px 22px;
  border-color: var(--fo-border);
}

.modal-body {
  padding: 22px;
}

.toast {
  overflow: hidden;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #f6faff url("/static/img/login-flow-bg.png") center center / cover no-repeat fixed;
}

.auth-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 38vw);
  align-items: center;
  gap: clamp(36px, 5vw, 96px);
  padding: clamp(42px, 6vw, 106px) clamp(44px, 8vw, 154px);
}

.auth-story {
  min-width: 0;
  display: flex;
  align-items: center;
  padding-bottom: 4vh;
}

.auth-story-copy {
  max-width: 700px;
}

.auth-story h1 {
  margin: 0;
  color: #161d29;
  font-size: clamp(3.4rem, 5vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

.auth-story h1 span {
  color: var(--fo-blue);
}

.auth-story p {
  max-width: 620px;
  margin: 28px 0 0;
  color: #545e6e;
  font-size: clamp(1rem, 1.2vw, 1.3rem);
  line-height: 1.8;
  letter-spacing: 0.005em;
}

.auth-panel {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 500px);
  min-height: 592px;
  padding: 62px 56px 44px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 30px 80px rgba(70, 104, 148, 0.16), 0 8px 26px rgba(70, 104, 148, 0.08), inset 0 1px rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(150%) blur(28px);
  backdrop-filter: saturate(150%) blur(28px);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #121a27;
  font-size: clamp(1.75rem, 2.3vw, 2.35rem);
  font-weight: 720;
  letter-spacing: -0.045em;
}

.auth-logo img {
  width: 70px;
  height: 70px;
  display: block;
  object-fit: contain;
}

.auth-heading {
  margin: 38px 0 25px;
}

.auth-heading h2 {
  margin: 0;
  color: #141b27;
  font-size: 1.75rem;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.auth-form-group {
  margin-bottom: 19px;
}

.auth-form-group .form-label {
  margin-bottom: 9px;
  color: #394454;
  font-size: 0.85rem;
  font-weight: 620;
}

.auth-field {
  position: relative;
}

.auth-field > i {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 2;
  color: #9aa5b5;
  font-size: 1.05rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-field .form-control {
  height: 58px;
  padding: 12px 50px;
  color: #1c2635;
  border: 1px solid rgba(94, 111, 134, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.94rem;
  box-shadow: inset 0 1px 2px rgba(36, 54, 77, 0.025);
}

.auth-field .form-control:focus {
  border-color: rgba(0, 113, 227, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 13px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #929eae;
  border: 0;
  border-radius: 9px;
  background: transparent;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--fo-blue);
  background: var(--fo-blue-soft);
  outline: none;
}

.auth-error {
  margin: 0 0 16px;
  padding: 10px 13px;
  font-size: 0.8rem;
}

.auth-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 8px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 680;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.22);
}

.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  color: #758195;
  font-size: 0.75rem;
}

.auth-security i {
  color: var(--fo-blue);
  font-size: 0.9rem;
}

/* ---------- QR and utilities ---------- */
#imageQrBox {
  width: fit-content;
  margin-inline: auto;
  padding: 14px;
  border: 1px solid var(--fo-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
}

#imageQrImg {
  border-radius: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 42px 20px;
  color: var(--fo-muted);
}

.empty-state i {
  color: #aaaab0;
  font-size: 1.8rem;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--fo-border);
  border-radius: 14px;
  background: rgba(250, 250, 252, 0.72);
}

.list-page-summary {
  color: var(--fo-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.list-page-summary strong {
  color: var(--fo-ink);
  font-weight: 680;
}

.list-page-actions,
.list-page-jump {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-page-jump {
  margin-left: 4px;
  color: var(--fo-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.list-page-input.form-control {
  width: 68px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 9px;
  text-align: center;
}

.list-page-actions .btn {
  white-space: nowrap;
}

.task-pagination,
.task-pagination .list-page-actions {
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--fo-border);
  }

  .brand {
    padding: 0 2px 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark img {
    width: 30px;
    height: 30px;
  }

  .sidebar-nav {
    flex-direction: row !important;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav .nav-link {
    min-height: 38px;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: relative;
    min-height: 88px;
    padding: 18px 22px;
  }

  .page-body {
    padding: 24px 22px 40px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 58px 28px 68px;
  }

  .auth-story {
    justify-content: center;
    padding: 0;
    text-align: center;
  }

  .auth-story-copy {
    max-width: 650px;
  }

  .auth-story h1 {
    font-size: clamp(2.8rem, 8vw, 4rem);
  }

  .auth-panel {
    align-items: flex-start;
  }

  .auth-card {
    width: min(100%, 500px);
  }
}

@media (max-width: 767.98px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .jt-status-badge {
    width: 100%;
    justify-content: space-between;
  }

  .page-body {
    padding: 18px 14px 34px;
  }

  .card-body {
    padding: 19px;
  }

  .list-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .list-page-summary {
    text-align: center;
  }

  .list-page-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .list-page-jump {
    margin-left: 0;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-body {
    background-position: 38% center;
  }

  .auth-layout {
    min-height: 100svh;
    gap: 28px;
    padding: 42px 16px 36px;
  }

  .auth-story h1 {
    font-size: clamp(2.35rem, 11vw, 3.15rem);
    line-height: 1.1;
  }

  .auth-story p {
    margin-top: 18px;
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .auth-copy-break {
    display: none;
  }

  .auth-card {
    min-height: auto;
    padding: 35px 24px 28px;
    border-radius: 22px;
  }

  .auth-logo {
    gap: 12px;
    font-size: 1.6rem;
  }

  .auth-logo img {
    width: 52px;
    height: 52px;
  }

  .auth-heading {
    margin: 26px 0 21px;
  }

  .auth-heading h2 {
    font-size: 1.5rem;
  }

  .auth-field .form-control,
  .auth-submit {
    height: 54px;
    min-height: 54px;
  }

  .submit-input-area {
    height: 210px;
    min-height: 210px;
  }

  .image-option {
    gap: 10px;
    padding: 11px;
  }

  .image-option-copy p {
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
