:root {
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-ink: #17233a;
  --app-ink-soft: #253853;
  --app-muted: #64748b;
  --app-line: rgba(148, 163, 184, 0.24);
  --app-teal: #0f766e;
  --app-amber: #c87925;
  --app-rose: #b85c72;
  --app-leaf: #4d8f63;
  --app-radius: 8px;
  --app-shadow: 0 18px 48px -34px rgba(23, 35, 58, 0.5);
  --app-shadow-soft: 0 10px 30px -24px rgba(23, 35, 58, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--app-bg);
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--app-ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.5) 1px, transparent 1px),
    linear-gradient(180deg, rgba(226, 232, 240, 0.48) 1px, transparent 1px),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%) !important;
  background-size: 56px 56px, 56px 56px, auto !important;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.18) 46%, rgba(255, 255, 255, 0.76) 100%);
}

a {
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select,
label[for] {
  touch-action: manipulation;
}

button,
[role="button"] {
  border-radius: var(--app-radius) !important;
}

input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  border-color: #d8e0ea !important;
  border-radius: var(--app-radius) !important;
  background-color: #ffffff !important;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: var(--app-teal) !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12) !important;
}

.shadow-soft {
  box-shadow: var(--app-shadow-soft) !important;
}

.grid > * {
  min-width: 0;
}

.overflow-x-auto {
  max-width: 100%;
}

.ring-slate-200 {
  --tw-ring-color: var(--app-line) !important;
}

.bg-ink {
  background-color: var(--app-ink) !important;
}

.text-ink {
  color: var(--app-ink) !important;
}

.bg-leaf {
  background-color: var(--app-leaf) !important;
}

.bg-sunrise {
  background-color: var(--app-amber) !important;
}

.rounded-\[30px\],
.rounded-\[28px\],
.rounded-\[26px\],
.rounded-\[24px\],
.rounded-\[22px\],
.rounded-\[18px\],
.rounded-2xl {
  border-radius: var(--app-radius) !important;
}

.app-shell {
  width: min(100%, 1240px);
}

.app-topbar {
  position: sticky;
  top: calc(10px + var(--safe-top, 0px));
  z-index: 30;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--app-shadow-soft);
  backdrop-filter: blur(18px);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-nav a,
.app-nav button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px !important;
  color: #536278 !important;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.app-nav a:hover,
.app-nav button:hover {
  color: var(--app-ink) !important;
  background: #eef2f7;
}

.app-nav a.text-ink,
.app-nav .is-active {
  color: #ffffff !important;
  background: var(--app-ink);
}

.app-status {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.app-topbar-right {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-session {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px -24px rgba(23, 35, 58, 0.42);
}

.auth-session-label {
  display: grid;
  min-width: 160px;
  max-width: min(44vw, 340px);
  gap: 3px;
  overflow: hidden;
  color: #536278;
  font-weight: 750;
  line-height: 1.15;
}

.auth-session-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 0.8rem;
  white-space: nowrap;
}

.auth-session-name {
  color: var(--app-ink);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-session-scope {
  flex: 0 0 auto;
  color: #64748b;
}

.auth-session-logout {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #be123c;
  color: #ffffff;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 22px -14px rgba(190, 18, 60, 0.65);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.auth-session-logout:hover {
  background: #9f1239;
  box-shadow: 0 12px 26px -14px rgba(190, 18, 60, 0.78);
}

.auth-session-logout:active {
  transform: scale(0.98);
}

.auth-session-logout:focus-visible {
  outline: 3px solid rgba(251, 113, 133, 0.35);
  outline-offset: 2px;
}

.auth-session-logout:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.app-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 35, 58, 0.2);
  border-radius: var(--app-radius) !important;
  background:
    linear-gradient(135deg, #17233a 0%, #1e4758 55%, #4d6743 100%) !important;
  box-shadow: var(--app-shadow) !important;
}

.app-hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 38%);
}

.app-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero {
  display: grid;
  gap: 22px;
  align-items: end;
  min-height: 260px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(23, 35, 58, 0.2);
  border-radius: var(--app-radius);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(23, 35, 58, 0.98) 0%, rgba(29, 71, 88, 0.96) 56%, rgba(77, 103, 67, 0.96) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 48%);
  box-shadow: var(--app-shadow);
}

.home-hero-main {
  max-width: 720px;
}

.home-hero h1 {
  margin: 12px 0 0;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: 0;
}

.home-hero p {
  max-width: 680px;
  margin: 16px 0 0;
  color: rgba(226, 232, 240, 0.92);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.85;
}

.home-hero-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-stat {
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.home-stat strong {
  display: block;
  color: #ffffff;
  font-size: 1.85rem;
  font-weight: 950;
  line-height: 1;
}

.home-stat span {
  display: block;
  margin-top: 8px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.78rem;
  font-weight: 850;
}

.home-workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: start;
}

.home-main-panel,
.home-side-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--app-shadow-soft);
}

.home-main-panel {
  padding: 20px;
}

.home-section-head,
.home-side-title {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.home-section-head h2,
.home-side-title h2 {
  margin: 0;
  color: var(--app-ink);
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0;
}

.home-section-head p,
.home-side-title p {
  margin: 6px 0 0;
  color: var(--app-muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.55;
}

.home-side-title a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--app-ink);
  font-size: 0.8rem;
  font-weight: 900;
  background: #f1f5f9;
}

.home-module-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-module-card {
  position: relative;
  display: grid;
  min-height: 132px;
  gap: 12px;
  grid-template-columns: 12px 44px minmax(0, 1fr) 38px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--app-ink);
  background: #ffffff;
  box-shadow: 0 12px 34px -28px rgba(23, 35, 58, 0.48);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.home-module-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--module-accent, var(--app-teal)), transparent);
}

.home-module-card:hover {
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 20px 48px -34px rgba(23, 35, 58, 0.62);
  transform: translateY(-2px);
}

.home-module-card-primary {
  grid-column: span 2;
}

.home-module-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--module-accent, var(--app-teal));
}

.home-module-icon svg,
.home-quick-tile svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.3;
}

.home-module-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.home-module-copy strong {
  display: block;
  color: var(--app-ink);
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1.15;
}

.home-module-copy small {
  display: block;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 680;
  line-height: 1.55;
}

.home-side {
  display: grid;
  gap: 12px;
}

.home-side-card {
  padding: 18px;
}

.home-pending-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.home-pending-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: inherit;
  background: #f8fafc;
}

.home-pending-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--app-amber);
}

.home-pending-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.home-pending-copy strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 0.94rem;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-pending-copy small {
  overflow: hidden;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-empty {
  padding: 18px 12px;
  border: 1px dashed rgba(148, 163, 184, 0.38);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 720;
  text-align: center;
}

.home-quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.home-quick-tile {
  display: grid;
  gap: 9px;
  min-height: 92px;
  align-content: center;
  justify-items: center;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: var(--app-ink);
  background: #f8fafc;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.home-quick-tile:hover {
  border-color: rgba(15, 118, 110, 0.24);
  background: #ffffff;
  transform: translateY(-1px);
}

.home-quick-tile span {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--module-accent, var(--app-teal));
}

.home-quick-tile strong {
  color: var(--app-ink);
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1.1;
}

.module-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--app-shadow-soft);
}

.module-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--module-accent, var(--app-teal)), transparent);
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 22px 52px -34px rgba(23, 35, 58, 0.62);
}

.module-index {
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--module-accent, var(--app-teal));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.module-index::after,
.module-index::before {
  content: none;
}

.quick-entry-list {
  gap: 10px;
}

.quick-entry-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: inherit;
  background: #f8fafc;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.quick-entry-item:hover {
  border-color: rgba(15, 118, 110, 0.24);
  background: #ffffff;
  transform: translateY(-1px);
}

.quick-entry-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  background: var(--module-accent, var(--app-teal));
  box-shadow: 0 10px 18px -16px rgba(15, 23, 42, 0.5);
}

.module-arrow {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--app-ink);
  font-size: 1.05rem;
  font-weight: 900;
  background: #f1f5f9;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease;
}

.module-card:hover .module-arrow {
  transform: translateX(2px);
  background: #e2e8f0;
}

.soft-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--app-shadow-soft);
}

.eyebrow {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #526173;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
}

.scroll-soft {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.42) transparent;
}

.choices__inner,
.choices__list--dropdown {
  border-radius: var(--app-radius) !important;
}

@media (max-width: 768px) {
  body {
    background-size: 44px 44px, 44px 44px, auto !important;
  }

  .app-shell,
  body > main,
  body > div.mx-auto {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  .app-topbar {
    position: relative;
    top: auto;
    padding: 8px;
  }

  .app-nav {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .app-nav::-webkit-scrollbar {
    display: none;
  }

  .app-nav a,
  .app-nav button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 11px;
  }

  .app-status {
    width: 100%;
    padding: 2px 4px 0;
    white-space: normal;
  }

  .app-topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .auth-session,
  .auth-session-label {
    width: 100%;
  }

  .auth-session {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .home-hero {
    min-height: 0;
    padding: 22px;
  }

  .home-hero-stats {
    grid-template-columns: 1fr;
  }

  .home-workbench,
  .home-module-grid {
    grid-template-columns: 1fr;
  }

  .home-module-card,
  .home-module-card-primary {
    grid-column: auto;
  }

  .home-module-card {
    grid-template-columns: 12px 40px minmax(0, 1fr) 34px;
    min-height: 116px;
    padding: 15px;
  }

  .home-module-icon {
    width: 40px;
    height: 40px;
  }

  .auth-session-label {
    max-width: 100%;
  }

  .auth-session-logout {
    width: 100%;
    min-height: 38px;
  }

  .app-hero {
    padding: 20px !important;
  }

  .app-hero h1 {
    font-size: 1.65rem !important;
    line-height: 1.18 !important;
  }

  .app-hero p {
    line-height: 1.65 !important;
  }

  .min-w-\[280px\] {
    min-width: 0 !important;
    width: 100% !important;
  }

  .module-card {
    min-height: auto;
  }

  .report-paper,
  .report-page {
    min-height: auto !important;
  }
}
.sel-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(button, a[href], input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid #f6a55f;
  outline-offset: 3px;
}

@media (pointer: coarse) {
  :where(button, a[href], input:not([type="hidden"]), select, textarea, [role="button"]) {
    min-block-size: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sel-page-hidden *,
.sel-page-hidden *::before,
.sel-page-hidden *::after {
  animation-play-state: paused !important;
}

img:not([width]):not([height]) {
  max-inline-size: 100%;
  block-size: auto;
}
