:root {
  color-scheme: light;
  --ink: #16212a;
  --muted: #64717c;
  --line: #d9e1e8;
  --surface: rgba(255, 255, 255, 0.94);
  --field: #f6f8fa;
  --blue: #1769e0;
  --blue-dark: #114d9e;
  --teal: #0f766e;
  --red: #b42318;
  --shadow: 0 24px 70px rgba(22, 33, 42, 0.16);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(23, 105, 224, 0.16), transparent 26%),
    radial-gradient(circle at 84% 28%, rgba(15, 118, 110, 0.16), transparent 26%),
    linear-gradient(180deg, #f7fafc 0%, #eaf1f6 100%);
}

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

.shell {
  width: min(960px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 52px 0;
}

body.is-app .shell,
.shell.app-shell {
  width: 100%;
  max-width: none;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}

body.is-app .page-hero,
.shell.app-shell .page-hero {
  display: none;
}

.page-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 32px;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(22, 33, 42, 0.22);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1;
  letter-spacing: 0;
}

.login-visual,
.auth-panel-brand,
.auth-welcome {
  display: none;
}

body.is-auth {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(72, 154, 255, 0.26), transparent 26%),
    radial-gradient(circle at 38% 74%, rgba(18, 196, 225, 0.16), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(57, 84, 204, 0.18), transparent 24%),
    linear-gradient(116deg, #f8fbff 0%, #e9f4ff 44%, #dbeaf7 100%);
}

body.is-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 34% 32%, rgba(34, 118, 220, 0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 52% 14%, rgba(255, 255, 255, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 71% 28%, rgba(42, 130, 238, 0.34) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 49%, rgba(255, 255, 255, 0.42) 49% 58%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(17, 77, 158, 0.045) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(17, 77, 158, 0.035) 0 1px, transparent 1px 96px);
  animation: authFieldDrift 18s ease-in-out infinite alternate;
}

body.is-auth::after {
  content: "";
  position: fixed;
  right: -6vw;
  bottom: -10vh;
  width: 62vw;
  height: 76vh;
  pointer-events: none;
  opacity: 0.42;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(228, 239, 252, 0.58)) 9% 66% / 13% 29% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(218, 234, 251, 0.58)) 24% 50% / 16% 45% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(223, 237, 253, 0.55)) 46% 62% / 18% 33% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(216, 232, 250, 0.58)) 67% 45% / 17% 48% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(223, 237, 252, 0.58)) 88% 64% / 15% 31% no-repeat;
  filter: drop-shadow(0 36px 38px rgba(17, 77, 158, 0.08));
  animation: skylineFloat 12s ease-in-out infinite alternate;
}

body.is-auth .shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(420px, 570px);
  align-items: center;
  justify-content: center;
  gap: clamp(42px, 8vw, 132px);
  margin: 0;
  padding: clamp(38px, 6vw, 86px) clamp(34px, 7vw, 118px);
}

body.is-auth .page-hero {
  position: relative;
  min-height: min(66vh, 660px);
  display: grid;
  place-items: center;
  text-align: center;
}

body.is-auth .page-hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.is-auth .login-visual {
  position: relative;
  width: min(48vw, 690px);
  min-width: 420px;
  aspect-ratio: 1.22;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

body.is-auth .login-visual::before {
  content: "";
  position: absolute;
  inset: 9% -4% 1%;
  border: 1px solid rgba(92, 169, 255, 0.42);
  border-radius: 50%;
  transform: perspective(900px) rotateX(62deg) rotateZ(0deg);
  box-shadow:
    0 0 0 12px rgba(255, 255, 255, 0.18),
    0 0 0 30px rgba(85, 154, 236, 0.04),
    0 0 88px rgba(23, 105, 224, 0.24);
  animation: orbitSpin 24s linear infinite;
}

body.is-auth .login-visual::after {
  content: "";
  position: absolute;
  bottom: 4%;
  width: 86%;
  height: 31%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(52, 132, 228, 0.08), rgba(255, 255, 255, 0.76), rgba(47, 199, 230, 0.1)),
    radial-gradient(ellipse at center, rgba(47, 141, 236, 0.22), transparent 72%);
  filter: blur(4px);
  animation: visualShadowPulse 6s ease-in-out infinite;
}

body.is-auth .visual-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.55;
  background:
    linear-gradient(90deg, rgba(35, 117, 219, 0.11) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 117, 219, 0.09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle, #000 0 54%, transparent 76%);
  animation: gridDrift 16s linear infinite;
}

body.is-auth .visual-orbit {
  position: absolute;
  border: 1px solid rgba(63, 143, 234, 0.34);
  border-radius: 50%;
  transform: perspective(900px) rotateX(64deg) rotateZ(0deg);
}

body.is-auth .orbit-one {
  inset: 18% -11% 5%;
  border-color: rgba(43, 136, 239, 0.42);
  animation: orbitSpin 18s linear infinite;
}

body.is-auth .orbit-two {
  inset: 28% 2% 16%;
  border-style: dashed;
  opacity: 0.72;
  animation: orbitSpinReverse 26s linear infinite;
}

body.is-auth .orbit-three {
  inset: 38% 14% 26%;
  border-color: rgba(58, 205, 232, 0.38);
  box-shadow: 0 0 22px rgba(58, 205, 232, 0.16);
  animation: orbitSpin 12s linear infinite;
}

body.is-auth .visual-scan {
  position: absolute;
  width: 66%;
  height: 66%;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 68%, rgba(42, 140, 242, 0.28) 72%, transparent 79%),
    radial-gradient(circle, transparent 0 48%, rgba(109, 184, 255, 0.18) 49% 50%, transparent 51%);
  animation: scanSweep 9s linear infinite;
}

body.is-auth .visual-node {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 3px;
  background: linear-gradient(135deg, #38d2f0, #1769e0);
  box-shadow: 0 0 18px rgba(42, 140, 242, 0.62);
  animation: nodeOrbit 13s linear infinite;
}

body.is-auth .node-one {
  --node-radius: 274px;
  animation-duration: 14s;
}

body.is-auth .node-two {
  --node-radius: 228px;
  animation-duration: 19s;
  animation-delay: -6s;
}

body.is-auth .node-three {
  --node-radius: 178px;
  animation-duration: 11s;
  animation-delay: -3s;
}

body.is-auth .visual-stream {
  position: absolute;
  z-index: 1;
  width: 54%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(49, 138, 239, 0.82), rgba(66, 218, 239, 0.58), transparent);
  filter: drop-shadow(0 0 8px rgba(40, 142, 246, 0.36));
  opacity: 0.82;
  animation: streamFlow 5.6s ease-in-out infinite;
}

body.is-auth .stream-one {
  top: 34%;
  left: 7%;
  transform: rotate(-13deg);
}

body.is-auth .stream-two {
  right: 4%;
  bottom: 29%;
  transform: rotate(15deg);
  animation-delay: -2.3s;
}

body.is-auth .visual-core {
  position: relative;
  z-index: 4;
  width: min(54%, 344px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 36px;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(155, 210, 255, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.86), transparent 18%),
    radial-gradient(circle at 62% 70%, rgba(32, 215, 232, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(78, 166, 255, 0.86), rgba(18, 77, 171, 0.9) 58%, rgba(11, 38, 112, 0.86));
  box-shadow:
    inset 0 0 32px rgba(255, 255, 255, 0.76),
    inset 0 -24px 46px rgba(2, 23, 76, 0.24),
    0 24px 70px rgba(23, 105, 224, 0.34),
    0 0 92px rgba(72, 181, 245, 0.28);
  backdrop-filter: blur(14px);
  animation: coreFloat 5.8s ease-in-out infinite;
}

body.is-auth .visual-core::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 20deg, rgba(65, 211, 239, 0), rgba(65, 211, 239, 0.34), rgba(42, 114, 236, 0.06), rgba(255, 255, 255, 0.42), rgba(65, 211, 239, 0));
  filter: blur(1px);
  animation: coreHalo 11s linear infinite;
}

body.is-auth .visual-core::after {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 18px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.logo-shield-wrapper {
  position: relative;
  z-index: 2;
  width: min(48%, 132px);
  aspect-ratio: 1;
}

.logo-shield-wrapper .visual-logo {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(10, 45, 117, 0.24);
}

.logo-shield-wrapper .shield-glow {
  position: absolute;
  inset: -6px;
  z-index: 3;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  overflow: visible;
  pointer-events: none;
  opacity: 0.92;
}

body.is-auth .visual-core span {
  position: relative;
  z-index: 1;
  max-width: 220px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(4, 25, 75, 0.26);
}

body.is-auth .visual-core small {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.92;
}

@keyframes authFieldDrift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 16px -10px, -12px 18px, 20px 8px, -18px -16px, 0 0, 28px 0, 0 24px;
  }
}

@keyframes skylineFloat {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-18px, -10px, 0);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
    transform: rotate(0deg);
  }
  to {
    background-position: 72px 36px, 36px 72px;
    transform: rotate(3deg);
  }
}

@keyframes orbitSpin {
  from {
    transform: perspective(900px) rotateX(64deg) rotateZ(0deg);
  }
  to {
    transform: perspective(900px) rotateX(64deg) rotateZ(360deg);
  }
}

@keyframes orbitSpinReverse {
  from {
    transform: perspective(900px) rotateX(64deg) rotateZ(360deg);
  }
  to {
    transform: perspective(900px) rotateX(64deg) rotateZ(0deg);
  }
}

@keyframes scanSweep {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes nodeOrbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg) translateX(var(--node-radius)) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) translateX(var(--node-radius)) rotate(-360deg);
  }
}

@keyframes streamFlow {
  0%, 100% {
    opacity: 0.24;
    clip-path: inset(0 100% 0 0);
  }
  45%, 68% {
    opacity: 0.92;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes coreFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.015);
  }
}

@keyframes coreHalo {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes visualShadowPulse {
  0%, 100% {
    opacity: 0.72;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.04);
  }
}

body.is-auth .auth-panel {
  width: 100%;
  min-height: 604px;
  padding: clamp(36px, 4vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 28px 74px rgba(48, 92, 148, 0.12);
  backdrop-filter: blur(20px);
}

body.is-auth .auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 900;
}

body.is-auth .auth-panel-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

body.is-auth .auth-welcome {
  display: block;
  margin-bottom: 36px;
  color: var(--blue);
  font-size: 36px;
  line-height: 1.08;
  font-weight: 900;
}

body.is-auth .shell.is-register-panel .auth-welcome {
  display: none;
}

body.is-auth .tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 28px;
  padding: 0;
  background: transparent;
}

body.is-auth .tab {
  width: auto;
  min-height: 28px;
  padding: 0 14px;
  color: #111820;
  background: transparent;
  font-size: 15px;
  line-height: 1;
}

body.is-auth .tab:first-child {
  padding-left: 0;
}

body.is-auth .tab + .tab {
  border-left: 2px solid rgba(17, 24, 32, 0.72);
}

body.is-auth .tab.active {
  color: var(--blue);
  background: transparent;
}

body.is-auth .form-heading h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.is-auth .form-heading p {
  display: none;
}

body.is-auth .panel:not(#login) .form-heading h2 {
  position: static;
  width: auto;
  height: auto;
  margin-bottom: 8px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  font-size: 24px;
}

body.is-auth .panel:not(#login) .form-heading p {
  display: block;
  margin-bottom: 22px;
  color: rgba(53, 66, 77, 0.72);
  line-height: 1.55;
}

body.is-auth label {
  margin-bottom: 22px;
}

body.is-auth label > span {
  margin-bottom: 12px;
  color: #111820;
  font-size: 16px;
}

body.is-auth input,
body.is-auth select,
body.is-auth textarea {
  min-height: 52px;
  border-color: rgba(206, 218, 230, 0.76);
  background: rgba(236, 240, 244, 0.9);
}

body.is-auth .primary-action {
  min-height: 52px;
  margin-top: 2px;
}

body.is-auth .text-action {
  margin: 16px 0 0;
  color: var(--blue);
}

body.is-auth .auth-link-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 16px;
}

body.is-auth .auth-link-row .text-action {
  min-height: 24px;
  margin: 0;
  padding: 0 14px;
  line-height: 1;
}

body.is-auth .auth-link-row .text-action:first-child {
  padding-left: 0;
}

body.is-auth .auth-link-row .text-action + .text-action {
  border-left: 1px solid rgba(17, 24, 32, 0.42);
}

body.is-auth .code-row {
  align-items: end;
}

body.is-auth .secondary-action.code-action {
  height: 52px;
  min-height: 52px;
}

.auth-panel {
  width: min(620px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel.app-panel {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.shell.app-shell .auth-panel.app-panel {
  width: 100%;
  max-width: none;
  min-height: 100vh;
}

.admin-layout {
  --sidebar-width: clamp(212px, 14vw, 238px);
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.admin-sidebar {
  position: fixed;
  z-index: 40;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  min-height: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: #e8eefc;
  border-right: 1px solid rgba(194, 207, 232, 0.72);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.52);
}

.user-card {
  display: grid;
  gap: 8px;
  padding: 0 10px 14px;
  border-bottom: 1px solid rgba(197, 211, 236, 0.72);
}

.sidebar-brand-row {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sidebar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.sidebar-brand img {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}

.sidebar-brand span {
  display: block;
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  width: 46px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  align-self: flex-end;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #4562e7;
  background: rgba(23, 105, 224, 0.08);
  cursor: pointer;
  box-shadow: none;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-toggle:hover {
  color: #fff;
  background: linear-gradient(90deg, #3266ff 0%, #8195ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 6px 14px rgba(70, 97, 235, 0.14);
}

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: #2f56e8;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(180, 196, 230, 0.76);
  font-size: 26px;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-card strong,
.user-name-link {
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-name-link:hover {
  text-decoration: underline;
}

.user-card small {
  color: #64748b;
}

.admin-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.nav-item,
.ghost-action {
  min-height: 42px;
  border: 0;
  color: #111820;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 900;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-decoration: none;
  appearance: none;
  font: inherit;
  line-height: 1;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.nav-item::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.nav-item[data-nav-icon="dashboard"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Cpath d='M14 15h6M14 19h6'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="project"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5A2.5 2.5 0 0 1 6.5 4H10l2 2h5.5A2.5 2.5 0 0 1 20 8.5v9A2.5 2.5 0 0 1 17.5 20h-11A2.5 2.5 0 0 1 4 17.5z'/%3E%3Cpath d='M8 12h8M8 16h5'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="files"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5A2.5 2.5 0 0 1 6.5 4H10l2 2h5.5A2.5 2.5 0 0 1 20 8.5v2.5'/%3E%3Cpath d='M4 10h16v7.5A2.5 2.5 0 0 1 17.5 20h-11A2.5 2.5 0 0 1 4 17.5z'/%3E%3Cpath d='M8 14h5M8 17h8'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="publish"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h8l4 4v14H7z'/%3E%3Cpath d='M15 3v5h5M10 13h6M10 17h4'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="supplier"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V8l8-4 8 4v12'/%3E%3Cpath d='M8 20v-7h8v7M8 10h.01M12 10h.01M16 10h.01'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="approval"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4h6l1 2h3v15H5V6h3z'/%3E%3Cpath d='M9 13l2 2 4-5'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="library"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='6' rx='7' ry='3'/%3E%3Cpath d='M5 6v6c0 1.7 3.1 3 7 3s7-1.3 7-3V6M5 12v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="backend"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='11' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="logs"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h10l3 3v15H6z'/%3E%3Cpath d='M16 3v4h4M9 11h7M9 15h7M9 19h5'/%3E%3C/svg%3E");
}

.nav-item[data-nav-icon="ai"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='7' width='14' height='12' rx='2'/%3E%3Cpath d='M9 11h.01M15 11h.01M9 15h6M12 3v4M3 12h2M19 12h2'/%3E%3C/svg%3E");
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(90deg, #3266ff 0%, #8195ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 14px rgba(70, 97, 235, 0.14);
}

.nav-item:not(.active):hover {
  color: #2857df;
  border-color: transparent;
  background: rgba(69, 107, 239, 0.12);
  box-shadow: none;
}

.ghost-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 0 10px;
  color: #344155;
}

.ghost-action::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (min-width: 901px), (orientation: landscape) {
  .admin-layout.sidebar-collapsed {
    --sidebar-width: 78px;
  }

  .admin-layout.sidebar-collapsed .admin-sidebar {
    align-items: center;
    gap: 14px;
    padding: 18px 10px;
  }

  .admin-layout.sidebar-collapsed .sidebar-toggle {
    align-self: center;
    margin: 0;
  }

  .admin-layout.sidebar-collapsed .sidebar-brand-row {
    min-height: 44px;
    justify-content: center;
  }

  .admin-layout.sidebar-collapsed .sidebar-brand {
    justify-content: center;
  }

  .admin-layout.sidebar-collapsed .sidebar-brand img {
    display: block;
  }

  .admin-layout.sidebar-collapsed .sidebar-brand span {
    display: none;
  }

  .admin-layout.sidebar-collapsed .sidebar-toggle::before {
    transform: rotate(180deg);
  }

  .admin-layout.sidebar-collapsed .user-card {
    justify-items: center;
    width: 100%;
    padding: 0 0 12px;
  }

  .admin-layout.sidebar-collapsed .avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
  }

  .admin-layout.sidebar-collapsed .user-name-link,
  .admin-layout.sidebar-collapsed .user-card small {
    display: none;
  }

  .admin-layout.sidebar-collapsed .admin-nav {
    align-items: center;
  }

  .admin-layout.sidebar-collapsed .nav-item {
    width: 46px;
    height: 42px;
    justify-content: center;
    gap: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .admin-layout.sidebar-collapsed .nav-item::before {
    width: 18px;
    height: 18px;
  }

  .admin-layout.sidebar-collapsed .ghost-action {
    width: 46px;
    min-width: 46px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 0;
  }

  .admin-layout.sidebar-collapsed .ghost-action::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

.operation-log-table .nowrap-cell {
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 2px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-link,
.pagination-current,
.pagination-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(198, 213, 238, 0.95);
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.pagination-link:hover,
.pagination-current {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.pagination-disabled {
  color: #9aa7b8;
  background: rgba(239, 243, 249, 0.82);
}

.pagination-ellipsis {
  color: var(--muted);
  font-weight: 900;
}

.operation-log-json {
  max-height: 560px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #f4f7fc;
  color: #253247;
  font: 12px/1.6 Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 700px) {
  .table-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-pages {
    justify-content: flex-start;
  }
}

.admin-main {
  position: relative;
  grid-column: 2;
  width: 100%;
  min-width: 0;
  padding: clamp(24px, 3vw, 48px);
  padding-top: 72px;
}

.admin-main::before {
  content: "";
  position: absolute;
  z-index: 10;
  top: 56px;
  left: clamp(24px, 3vw, 48px);
  right: clamp(24px, 3vw, 48px);
  height: 1px;
  background: rgba(190, 205, 230, 0.82);
}

.app-user-bar {
  position: absolute;
  z-index: 20;
  top: 14px;
  right: clamp(24px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.app-user-entry {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.app-user-entry:hover strong {
  color: #1769e0;
}

.app-user-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: #5579f5;
  box-shadow: 0 3px 8px rgba(50, 89, 226, 0.22);
}

.app-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-user-avatar-fallback {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4.8 20c.7-4.2 3.1-6.3 7.2-6.3s6.5 2.1 7.2 6.3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4.8 20c.7-4.2 3.1-6.3 7.2-6.3s6.5 2.1 7.2 6.3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

.app-user-entry strong {
  max-width: min(220px, 30vw);
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-logout {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: #344155;
  background: transparent;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.app-user-logout::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.app-user-logout:hover {
  color: #1769e0;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading.with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.list-filter-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.list-filter-form select,
.list-filter-form input {
  width: auto;
  min-width: 160px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 0 12px;
  color: var(--ink);
  font-weight: 800;
}

.list-filter-form input {
  min-width: 240px;
}

.list-filter-form input[type="date"] {
  min-width: 150px;
}

.list-filter-form .table-action {
  min-height: 38px;
  margin-right: 0;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.compact-heading {
  margin-bottom: 16px;
}

.todo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.todo-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 14px;
  padding: 18px;
  background: #f7fafc;
  border: 1px solid var(--line);
}

.todo-item > span {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  background: var(--blue);
  border-radius: 50%;
}

.todo-item strong {
  display: block;
  margin-bottom: 5px;
}

.todo-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.profile-form {
  max-width: 920px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.module-grid article {
  min-height: 112px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: #f7fafc;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card {
  --card-ink: #1769e0;
  --card-bg: rgba(248, 252, 255, 0.92);
  --card-mid: rgba(23, 105, 224, 0.34);
  --card-strong: #1769e0;
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: hidden;
  padding: 18px 66px 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-mid);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.48),
    0 14px 30px rgba(22, 33, 42, 0.08);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.dashboard-card > * {
  position: relative;
  z-index: 1;
}

a.dashboard-card {
  color: inherit;
  text-decoration: none;
}

.dashboard-card-link {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.dashboard-card-link:hover {
  border-color: var(--card-strong);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.56),
    0 18px 36px rgba(22, 33, 42, 0.12);
  filter: saturate(1.06);
  transform: translateY(-2px);
}

.dashboard-card-link.active {
  border-color: var(--card-strong);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 18px 40px rgba(23, 105, 224, 0.14);
}

.dashboard-card-disabled {
  cursor: default;
}

.dashboard-card-violet {
  --card-ink: #6058f2;
  --card-bg: rgba(250, 249, 255, 0.94);
  --card-mid: rgba(113, 97, 245, 0.34);
  --card-strong: #6d5df2;
}

.dashboard-card-cyan {
  --card-ink: #2b9cb4;
  --card-bg: rgba(248, 254, 255, 0.94);
  --card-mid: rgba(45, 178, 196, 0.34);
  --card-strong: #28a8bc;
}

.dashboard-card-blue {
  --card-ink: #1769e0;
  --card-bg: rgba(248, 251, 255, 0.94);
  --card-mid: rgba(23, 105, 224, 0.32);
  --card-strong: #1769e0;
}

.dashboard-card-pink {
  --card-ink: #e94aa5;
  --card-bg: rgba(255, 249, 253, 0.94);
  --card-mid: rgba(241, 83, 184, 0.34);
  --card-strong: #e94aa5;
}

.dashboard-card-label {
  color: #141d28;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.dashboard-card strong {
  display: block;
  max-width: 100%;
  color: var(--card-ink);
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-card p {
  max-width: 100%;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-card-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 0 8px 0 14px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), var(--card-strong));
  box-shadow: 0 9px 18px rgba(22, 33, 42, 0.14);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-card-visual {
  position: absolute;
  right: 18px;
  bottom: 22px;
  z-index: 0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.92) 0 4px, transparent 5px),
    linear-gradient(145deg, var(--card-strong), rgba(255, 255, 255, 0.42));
  box-shadow: 0 12px 22px rgba(22, 33, 42, 0.16);
  opacity: 0.82;
  transform: rotate(-8deg);
}

.dashboard-card-visual::before,
.dashboard-card-visual::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.dashboard-card-visual::before {
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
}

.dashboard-card-visual::after {
  width: 14px;
  height: 14px;
  right: 9px;
  top: 9px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.dashboard-icon-total-projects::before {
  inset: 10px 13px 12px 11px;
  border-radius: 5px;
  box-shadow: 6px 5px 0 rgba(255, 255, 255, 0.22), -5px -4px 0 rgba(255, 255, 255, 0.18);
}

.dashboard-icon-unfinished-projects::before {
  inset: auto 9px 14px 9px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
}

.dashboard-icon-unfinished-projects::after {
  inset: 11px auto auto 12px;
  width: 20px;
  height: 20px;
  border: 0;
  border-right: 3px solid rgba(255, 255, 255, 0.86);
  border-top: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 0;
  transform: rotate(45deg);
}

.dashboard-icon-published-requests::before {
  inset: 13px 10px 14px 13px;
  border: 0;
  background: rgba(255, 255, 255, 0.82);
  clip-path: polygon(0 30%, 58% 0, 58% 100%, 0 70%);
}

.dashboard-icon-published-requests::after {
  left: 11px;
  bottom: 9px;
  width: 8px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  transform: rotate(-18deg);
}

.dashboard-icon-purchased-quotes::before,
.dashboard-icon-pending-purchase::before {
  inset: 14px 10px 9px 10px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 6px;
}

.dashboard-icon-purchased-quotes::after,
.dashboard-icon-pending-purchase::after {
  left: 17px;
  top: 8px;
  width: 10px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.dashboard-icon-pending-design::before {
  left: 12px;
  top: 8px;
  width: 10px;
  height: 27px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  transform: rotate(35deg);
}

.dashboard-icon-pending-design::after {
  right: 13px;
  bottom: 9px;
  width: 12px;
  height: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(35deg);
}

.dashboard-icon-pending-pre-audit::before,
.dashboard-icon-pending-approval::before {
  inset: 9px 12px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 5px;
}

.dashboard-icon-pending-pre-audit::after {
  left: 16px;
  top: 17px;
  width: 17px;
  height: 12px;
  border: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)) 0 0 / 17px 2px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)) 0 6px / 14px 2px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)) 0 12px / 10px 2px no-repeat;
}

.dashboard-icon-pending-approval::after {
  left: 15px;
  top: 17px;
  width: 18px;
  height: 10px;
  border: 0;
  border-left: 3px solid rgba(255, 255, 255, 0.86);
  border-bottom: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 0;
  transform: rotate(-45deg);
}

.dashboard-icon-pending-construction::before {
  left: 10px;
  top: 11px;
  width: 24px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-top-width: 7px;
  border-radius: 5px;
}

.dashboard-icon-pending-construction::after {
  left: 9px;
  bottom: 10px;
  width: 26px;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}

.dashboard-icon-pending-completion::before {
  left: 13px;
  top: 9px;
  width: 3px;
  height: 27px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.dashboard-icon-pending-completion::after {
  left: 16px;
  top: 10px;
  width: 18px;
  height: 15px;
  border: 0;
  border-radius: 2px 8px 8px 2px;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-task-panel {
  margin-top: 24px;
}

#todo > .section-heading h2 {
  font-size: 24px;
}

.dashboard-task-panel .section-heading h2 {
  font-size: 20px;
}

.dashboard-task-stack {
  display: grid;
  gap: 18px;
}

.dashboard-task-section {
  scroll-margin-top: 18px;
}

.dashboard-task-heading {
  margin-bottom: 10px;
}

.dashboard-task-heading h2 {
  font-size: 18px;
}

.project-form {
  margin-bottom: 28px;
  padding: 18px;
  background: #f7fafc;
  border: 1px solid var(--line);
}

.project-page {
  display: none;
}

.project-page.active {
  display: block;
}

.compact-action {
  width: fit-content;
  min-width: 0;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.top-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.top-add-button:hover {
  background: var(--blue-dark);
}

.secondary-top-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary-top-button:hover {
  color: #fff;
  background: var(--ink);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.breadcrumb button {
  border: 0;
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.breadcrumb a {
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 900;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-upload-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.inline-upload-field span {
  margin: 0;
  white-space: nowrap;
}

.inline-upload-field input[type="file"] {
  width: min(360px, 48vw);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.text-action {
  width: fit-content;
  min-height: 34px;
  margin: 8px auto 0;
  padding: 0;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.text-action:hover {
  text-decoration: underline;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.code-row label {
  margin-bottom: 0;
}

.code-action {
  min-height: 46px;
  height: 46px;
  align-self: end;
  white-space: nowrap;
}

.project-list-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(216, 226, 240, 0.9);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.data-table {
  width: 100%;
  min-width: 840px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.data-table th,
.data-table td {
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid rgba(207, 218, 235, 0.72);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #243445;
  background: #dfe8f8;
  font-size: 13px;
  font-weight: 900;
}

.data-table th:first-child {
  border-radius: 3px 0 0 3px;
}

.data-table th:last-child {
  border-radius: 0 3px 3px 0;
}

.data-table td {
  color: var(--ink);
  background: rgba(248, 250, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
}

.data-table tbody tr:hover td {
  background: rgba(241, 246, 255, 0.96);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 3px;
  color: var(--blue-dark);
  background: rgba(23, 105, 224, 0.1);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}

.stage-pill.is-cancelled {
  color: #6b7280;
  background: #e5e7eb;
}

.table-actions {
  white-space: nowrap;
}

.table-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  min-height: 30px;
  margin-right: 6px;
  padding: 0 9px;
  border: 0;
  border-radius: 3px;
  color: var(--blue);
  background: rgba(23, 105, 224, 0.09);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
}

.table-action:hover {
  color: #fff;
  background: var(--blue);
}

.table-action.danger {
  color: var(--red);
  background: rgba(180, 35, 24, 0.08);
}

.table-action.danger:hover {
  color: #fff;
  background: var(--red);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-manager-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.file-browser-layout {
  display: block;
}

.file-tree-panel,
.file-browser-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.file-tree-panel {
  padding: 14px;
}

.file-tree-panel > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.file-tree {
  display: grid;
  gap: 6px;
}

.file-tree a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.file-tree a.active,
.file-tree a:hover {
  color: var(--blue);
  background: rgba(23, 105, 224, 0.1);
}

.file-browser-panel {
  min-width: 0;
  padding: 14px;
}

.file-browser-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.file-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.file-breadcrumb a {
  color: var(--blue-dark);
  text-decoration: none;
}

.file-upload-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.file-upload-form select {
  width: 220px;
  min-width: 180px;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.file-upload-form .secondary-action {
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
}

.file-pick-action {
  position: relative;
  overflow: hidden;
  margin-right: 0;
}

.file-pick-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-download-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.file-table .file-check-cell {
  width: 36px;
  text-align: center;
}

.file-name-cell {
  min-width: 240px;
}

.file-name-cell a {
  color: var(--blue-dark);
  font-weight: 900;
  text-decoration: none;
}

.file-name-cell a:hover {
  text-decoration: underline;
}

.file-type-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  background: currentColor;
}

.file-type-icon.is-folder {
  color: #c0842d;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 6.75A2.75 2.75 0 0 1 5.75 4H10l2 2h6.25A2.75 2.75 0 0 1 21 8.75v8.5A2.75 2.75 0 0 1 18.25 20H5.75A2.75 2.75 0 0 1 3 17.25z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M3 6.75A2.75 2.75 0 0 1 5.75 4H10l2 2h6.25A2.75 2.75 0 0 1 21 8.75v8.5A2.75 2.75 0 0 1 18.25 20H5.75A2.75 2.75 0 0 1 3 17.25z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.file-type-icon.is-file {
  color: #64748b;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6 3h8l4 4v14H6zM13 4.5V8h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6 3h8l4 4v14H6zM13 4.5V8h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 900px) {
  .file-manager-layout {
    grid-template-columns: 1fr;
  }

  .file-browser-toolbar,
  .file-upload-form {
    align-items: stretch;
    flex-direction: column;
  }

  .file-upload-form select,
  .file-upload-form .table-action,
  .file-upload-form .secondary-action {
    width: 100%;
  }
}

.management-panel {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.status-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  font-weight: 900;
}

.status-tabs a.active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.ai-analysis-actions {
  justify-content: flex-start;
  margin: 16px 0 20px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.analysis-summary-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.analysis-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.analysis-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.analysis-note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.analysis-note strong {
  display: block;
  margin-bottom: 8px;
}

.analysis-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.ai-model-note {
  margin-bottom: 18px;
  border-left: 4px solid var(--blue);
}

.ai-model-note .form-message {
  margin: 0;
}

.ai-text-output {
  white-space: normal;
}

.ai-structured-output {
  display: grid;
  gap: 12px;
}

.ai-structured-output p {
  margin: 0;
}

.ai-findings-table {
  min-width: 980px;
}

.ai-findings-table td:last-child {
  min-width: 240px;
  line-height: 1.7;
}

.compare-selector {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.compare-selector label {
  font-weight: 900;
}

.compare-selector select,
.compare-selector input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--field);
  font-weight: 800;
}

.data-table tr.status-disabled td,
.data-table tr.status-disabled:hover td {
  color: #6b7280;
  background: #f3f4f6;
}

.account-table {
  min-width: 1180px;
}

.purchase-table {
  min-width: 760px;
}

.excel-preview-table {
  table-layout: auto;
}

.excel-preview-table td {
  min-width: 88px;
  white-space: pre-wrap;
}

.excel-preview-table .excel-section-row td {
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.purchase-panel {
  margin-bottom: 18px;
}

.purchase-disclosure {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.purchase-disclosure.is-cancelled {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #d1d5db;
}

.purchase-disclosure.is-cancelled summary small {
  color: #6b7280;
}

.purchase-disclosure.is-cancelled .quote-summary-title,
.purchase-disclosure.is-cancelled .quote-summary-meta,
.purchase-disclosure.is-cancelled .quote-summary-actions {
  color: #6b7280;
}

.purchase-disclosure.is-cancelled .purchase-disclosure-body {
  opacity: 0.72;
}

.purchase-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 900;
}

.purchase-disclosure summary::-webkit-details-marker,
.audit-log-disclosure summary::-webkit-details-marker,
.quote-preview summary::-webkit-details-marker {
  display: none;
}

.purchase-disclosure summary::before,
.audit-log-disclosure summary::before,
.quote-preview summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--blue-dark);
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}

.purchase-disclosure[open] > summary::before,
.audit-log-disclosure[open] > summary::before,
.quote-preview[open] > summary::before {
  transform: rotate(90deg);
}

.purchase-disclosure summary.quote-summary-row {
  display: grid;
  grid-template-columns:
    7px
    minmax(220px, 1.35fr)
    minmax(128px, 0.58fr)
    minmax(116px, 0.52fr)
    minmax(130px, 0.58fr)
    minmax(190px, 0.78fr)
    minmax(112px, 0.52fr)
    minmax(170px, 0.75fr);
  align-items: center;
  justify-content: stretch;
  column-gap: 16px;
  row-gap: 12px;
}

.quote-summary-title,
.quote-summary-meta {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
}

.quote-summary-title {
  min-width: 0;
}

.quote-summary-meta {
  font-size: 13px;
  min-width: 0;
}

.quote-summary-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  margin-left: 0;
}

.quote-summary-actions .table-action {
  flex: 0 0 auto;
}

.purchase-disclosure summary small {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}

.purchase-disclosure-body {
  padding: 0 18px 18px;
}

@media (max-width: 720px) {
  .purchase-disclosure summary:not(.quote-summary-row) {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-disclosure summary.quote-summary-row {
    grid-template-columns: 12px 1fr;
  }

  .purchase-disclosure summary small {
    text-align: left;
  }

  .quote-summary-title,
  .quote-summary-meta {
    grid-column: 2;
    white-space: normal;
  }

  .quote-summary-title {
    width: 100%;
  }

  .quote-summary-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-left: 0;
  }

  .analysis-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .compare-selector {
    grid-template-columns: 1fr;
  }

  .supplier-quote-chart {
    --chart-height: 300px;
    gap: 14px;
    min-width: max(680px, calc(var(--project-count) * 112px));
  }
}

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

.quote-preview summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 900;
}

.quote-preview .project-list-wrap {
  margin-top: 10px;
  max-width: 780px;
}

.quote-missing-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quote-missing-block.has-missing > strong {
  color: var(--red);
}

.quote-missing-block .data-table th,
.quote-missing-block .data-table td {
  color: var(--red);
  background: #fff5f5;
}

.quote-missing-block .data-table tr.excel-section-row td {
  color: var(--red);
  background: #fee2e2;
}

.audit-actions {
  justify-content: flex-start;
  margin: 12px 0 16px;
}

.audit-log-disclosure {
  margin: 12px 0 16px;
}

.audit-log-disclosure summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 900;
}

.audit-log-section {
  margin: 12px 0 16px;
}

.audit-log-section h3 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 900;
}

.quote-row-opinion-cell {
  min-width: 220px;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-row-opinion {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.quote-row-opinion strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.quote-row-opinion p,
.quote-opinion-list {
  margin: 0;
}

.quote-row-opinion p {
  color: var(--ink);
  line-height: 1.6;
}

.quote-opinion-list {
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.7;
}

.audit-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.audit-modal[hidden] {
  display: none;
}

.audit-modal-card {
  width: min(620px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.audit-modal-card .section-heading {
  margin-bottom: 12px;
}

.audit-modal-card .section-heading .audit-modal-title {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
}

.audit-opinion-textarea {
  min-height: 144px;
}

.audit-modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.audit-modal-actions .primary-action,
.audit-modal-actions .secondary-action {
  min-height: 38px;
  padding: 0 16px;
}

.audit-modal-actions .danger-action {
  color: var(--red);
  border-color: #fecaca;
}

.payment-summary-grid {
  margin-bottom: 24px;
}

.payment-field {
  margin-top: 24px;
}

.payment-field .field-label {
  margin: 0 0 10px;
  color: #35424d;
  font-size: 14px;
  font-weight: 900;
}

.payment-field input {
  display: block;
}

.payment-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.payment-modal-actions .primary-action,
.payment-modal-actions .secondary-action {
  width: auto;
  min-width: 86px;
  min-height: 42px;
  padding: 0 20px;
  line-height: 1;
  text-decoration: none;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.chart-legend span {
  position: relative;
  padding-left: 18px;
}

.chart-legend span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
}

.chart-legend .legend-total::before {
  background: #4f83bd;
}

.chart-legend .legend-paid::before {
  background: #c6534e;
}

.supplier-quote-chart {
  --chart-height: 360px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--project-count), minmax(96px, 1fr));
  align-items: end;
  gap: 18px;
  min-width: max(760px, calc(var(--project-count) * 124px));
  min-height: calc(var(--chart-height) + 92px);
  padding: 22px 18px 0;
  border: 1px solid var(--line);
  border-bottom: 1px solid #cfd8df;
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent calc(var(--chart-height) / 6 - 1px),
      rgba(104, 116, 126, 0.23) calc(var(--chart-height) / 6 - 1px),
      rgba(104, 116, 126, 0.23) calc(var(--chart-height) / 6)
    ),
    rgba(255, 255, 255, 0.74);
  overflow-x: auto;
}

.supplier-chart-column {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: var(--chart-height) 78px;
  align-items: end;
  min-width: 0;
}

.supplier-column-bars {
  height: var(--chart-height);
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid #cfd8df;
}

.supplier-column-bar {
  position: relative;
  width: clamp(14px, 1.8vw, 22px);
  min-height: 0;
  transition: opacity 0.16s ease;
}

.supplier-column-bar:hover {
  opacity: 0.8;
}

.supplier-column-bar.is-total {
  background: #4f83bd;
}

.supplier-column-bar.is-paid {
  background: #c6534e;
}

.supplier-column-bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  transform-origin: center;
  color: #35424d;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.supplier-column-label {
  min-width: 0;
  padding-top: 12px;
  text-align: center;
}

.supplier-column-label strong,
.supplier-column-label span {
  display: block;
}

.supplier-column-label strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.supplier-column-label span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-missing-block > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
}

.account-table td small,
.account-table td strong {
  display: block;
}

.account-table td small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #35424d;
  background: #eef2f7;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.status-pending {
  color: #92400e;
  background: #fef3c7;
}

.status-pill.status-active {
  color: #166534;
  background: #dcfce7;
}

.status-pill.status-disabled {
  color: #991b1b;
  background: #fee2e2;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(218, 228, 244, 0.92);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(45, 84, 140, 0.05);
}

.detail-grid article {
  position: relative;
  min-height: 76px;
  padding: 14px 16px 14px 20px;
  overflow: hidden;
  background: rgba(230, 238, 255, 0.78);
  border: 1px solid rgba(210, 224, 248, 0.86);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.detail-grid article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(180deg, #8db7ff 0%, #9ebeff 45%, #c8d8ff 100%);
  border-radius: 6px 0 0 6px;
}

.detail-grid article.full {
  grid-column: 1 / -1;
}

.detail-grid span {
  display: block;
  margin-bottom: 7px;
  color: #536578;
  font-size: 13px;
  font-weight: 900;
}

.detail-grid strong,
.detail-grid p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  word-break: break-word;
}

.detail-content {
  grid-column: 1 / -1;
}

.link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.inline-form {
  display: inline;
  margin: 0;
}

.page-form {
  width: 100%;
  max-width: none;
}

.page-actions {
  margin-top: 22px;
}

.project-form.page-form {
  width: 100%;
  max-width: none;
}

.subtask-editor {
  margin: 22px 0;
}

.form-section {
  margin: 22px 0;
}

.form-section h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.subtask-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.subtask-heading span {
  display: block;
  margin-bottom: 6px;
  color: #35424d;
  font-size: 14px;
  font-weight: 900;
}

.subtask-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.subtask-table {
  min-width: 960px;
}

.subtask-table-toolbar {
  min-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #f1f5f8;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.subtask-table-toolbar strong {
  color: #35424d;
}

.subtask-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.subtask-page {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.compact-breadcrumb {
  margin-bottom: 16px;
}

.node-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(88px, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
  overflow-x: auto;
}

.node-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--blue-dark);
  background: rgba(23, 105, 224, 0.1);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.table-node-strip {
  grid-template-columns: repeat(6, max-content);
  gap: 5px;
  margin: 0;
}

.table-node-strip span {
  min-height: 26px;
  font-size: 12px;
}

.gantt-section {
  margin-top: 30px;
}

.gantt-chart {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.gantt-header,
.gantt-row {
  min-width: 980px;
  display: grid;
  grid-template-columns: 180px repeat(4, minmax(150px, 1fr));
  align-items: stretch;
}

.gantt-header {
  color: #35424d;
  background: #f1f5f8;
  font-size: 13px;
  font-weight: 900;
}

.gantt-header span,
.gantt-row strong,
.gantt-node {
  padding: 13px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gantt-row strong {
  background: #fbfcfd;
}

.gantt-row strong small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.gantt-node {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 800;
}

.gantt-node.dated {
  color: var(--blue-dark);
  background: rgba(23, 105, 224, 0.08);
}

.gantt-node em {
  color: var(--ink);
  font-style: normal;
  font-size: 12px;
}

.gantt-board {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 12px;
  color: #35424d;
  font-size: 13px;
  font-weight: 900;
}

.gantt-legend span {
  position: relative;
  padding-left: 18px;
}

.gantt-legend span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--blue);
}

.gantt-legend .legend-actual::before {
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: #149a5a;
}

.gantt-legend .legend-late::before {
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: #d32222;
}

.gantt-axis,
.gantt-line {
  min-width: 1080px;
  display: grid;
  grid-template-columns: 190px minmax(760px, 1fr);
}

.gantt-axis {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #35424d;
  background: #f1f5f8;
  font-size: 13px;
  font-weight: 900;
}

.gantt-axis-title,
.gantt-axis-dates,
.gantt-name,
.gantt-track {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gantt-axis-title {
  padding: 14px;
}

.gantt-axis-dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.gantt-axis-dates span {
  padding: 14px 10px;
  border-left: 1px solid rgba(27, 42, 54, 0.08);
  white-space: nowrap;
}

.gantt-name {
  min-height: 128px;
  padding: 16px 14px;
  background: #fbfcfd;
}

.gantt-name strong,
.gantt-name small {
  display: block;
}

.gantt-name small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gantt-track {
  position: relative;
  min-height: 128px;
  background:
    linear-gradient(to right, rgba(27, 42, 54, 0.06) 1px, transparent 1px) 0 0 / calc(100% / 24) 100%,
    linear-gradient(to bottom, rgba(27, 42, 54, 0.04), rgba(27, 42, 54, 0.04));
}

.gantt-plan-bar,
.gantt-stage-segment {
  position: absolute;
  top: 52px;
  height: 30px;
  min-width: 42px;
  border-radius: 999px;
}

.gantt-plan-bar {
  background: #6257b8;
  opacity: 0.22;
}

.gantt-stage-segment {
  min-width: 8px;
  box-shadow: 0 6px 16px rgba(27, 42, 54, 0.12);
}

.gantt-stage-segment.is-ok {
  background: #8df05a;
}

.gantt-stage-segment.is-late {
  background: #d32222;
}

.gantt-stage-segment.is-pending {
  background: #94a3b8;
}

.gantt-stage-segment.is-neutral {
  background: #94a3b8;
}

.gantt-stage-segment em {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%);
  transform: translate(-50%, -50%);
  max-width: calc(100% - 12px);
  overflow: hidden;
  color: #12321f;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-stage-segment.is-late em {
  color: #fff;
}

.gantt-stage-segment.is-pending em,
.gantt-stage-segment.is-neutral em {
  color: #fff;
}

.gantt-actual-bar {
  position: absolute;
  top: 32px;
  height: 7px;
  min-width: 8px;
  border-radius: 999px;
  background: #149a5a;
  box-shadow: 0 3px 8px rgba(20, 154, 90, 0.18);
}

.gantt-actual-bar.is-late {
  background: #d32222;
  box-shadow: 0 3px 8px rgba(211, 34, 34, 0.2);
}

.gantt-actual-bar em {
  position: absolute;
  right: 0;
  bottom: 10px;
  transform: translateX(50%);
  color: #106541;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.gantt-actual-bar.is-late em {
  color: #b91c1c;
}

.gantt-bar-done {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: #8df05a;
  box-shadow: inset -4px 0 8px rgba(32, 75, 21, 0.16);
}

.gantt-bar-modern em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.gantt-point {
  position: absolute;
  transform: translateX(-50%);
  padding-top: 8px;
  color: #35424d;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.gantt-point::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--blue);
}

.gantt-point-plan {
  top: 92px;
}

.gantt-point-actual {
  top: 8px;
  padding-top: 0;
  padding-bottom: 8px;
  color: #106541;
}

.gantt-point-actual::before {
  top: auto;
  bottom: 0;
  background: #149a5a;
}

.gantt-point-actual.is-late {
  color: #b91c1c;
}

.gantt-point-actual.is-late::before {
  background: #d32222;
}

.gantt-overdue-segment {
  position: absolute;
  top: calc(42px + var(--lane-offset, 0px));
  height: 6px;
  min-width: 7px;
  border-radius: 999px;
  background: #d32222;
  box-shadow: 0 3px 8px rgba(211, 34, 34, 0.2);
}

.data-table tr.subtask-normal td,
.data-table tr.subtask-normal:hover td {
  background: #f0fdf4;
}

.data-table tr.subtask-overdue td,
.data-table tr.subtask-overdue:hover td {
  background: #fef2f2;
}

.data-table tr.subtask-overdue .stage-pill {
  color: #991b1b;
  background: #fee2e2;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
  padding: 6px;
  background: #e8eef3;
}

.tab {
  min-height: 42px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--ink);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.form-heading h2,
.signed-card h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.form-heading p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: block;
  margin-bottom: 16px;
}

label > span {
  display: block;
  margin-bottom: 8px;
  color: #35424d;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--ink);
  background: var(--field);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.14);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease;
}

.primary-action:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  transform: none;
}

.primary-action.compact-action {
  width: fit-content;
  min-width: 0;
  padding: 0 18px;
  white-space: nowrap;
}

.section-heading.with-action .compact-action {
  margin-left: auto;
}

.top-add-button,
.secondary-top-button,
.list-filter-form .table-action,
.section-heading.with-action .compact-action,
.section-heading.with-action .secondary-action,
.action-row > .compact-action,
.action-row > .secondary-action {
  width: fit-content;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid #cfdbea;
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transform: none;
}

.top-add-button:hover,
.secondary-top-button:hover,
.list-filter-form .table-action:hover,
.section-heading.with-action .compact-action:hover,
.section-heading.with-action .secondary-action:hover,
.action-row > .compact-action:hover,
.action-row > .secondary-action:hover {
  border-color: #aebfdb;
  color: var(--blue-dark);
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.1);
  transform: none;
}

.section-heading.with-action .file-upload-form {
  align-items: center;
}

.section-heading.with-action .file-upload-form .compact-action {
  margin-left: 0;
}

.section-heading.with-action .file-upload-form select,
.section-heading.with-action .file-upload-form .secondary-action {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  margin-top: 0;
  margin-bottom: 0;
  vertical-align: middle;
}

.section-heading.with-action .file-upload-form select {
  padding: 0 34px 0 14px;
  line-height: 42px;
}

.form-message {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--teal);
  font-weight: 800;
}

.form-message.error {
  color: var(--red);
}

.signed-card dl {
  margin: 20px 0 24px;
}

.signed-card div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.signed-card dt {
  color: var(--muted);
  font-weight: 800;
}

.signed-card dd {
  margin: 0;
}

@media (max-width: 1500px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .shell {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    gap: 18px;
    padding: 26px 0;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-panel.app-panel {
    padding: 0;
  }

  .field-grid,
  .module-grid,
  .dashboard-grid,
  .detail-grid,
  .tabs {
    grid-template-columns: 1fr;
  }

  .section-heading.with-action {
    align-items: stretch;
    flex-direction: column;
  }

  .list-filter-form {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .list-filter-form select,
  .list-filter-form input {
    width: 100%;
    min-width: 0;
  }

  .compact-action {
    width: fit-content;
  }

  .admin-sidebar {
    padding: 18px;
  }

  .admin-main {
    padding: 18px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .nav-item {
    text-align: left;
  }

  h1 {
    font-size: 40px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 28px;
  }

  .form-heading h2,
  .signed-card h2 {
    font-size: 24px;
  }
}

.mobile-card-menu-toggle {
  display: none;
}

.mobile-card-menu-panel {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 900px),
  (orientation: landscape) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-height: 720px),
  (orientation: landscape) and (max-width: 1180px) {
  .mobile-card-list-wrap {
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .data-table.mobile-card-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .mobile-card-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 14px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(216, 226, 240, 0.92);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 5px 14px rgba(60, 88, 136, 0.06);
  }

  .mobile-card-table tbody tr.mobile-card-menu-open {
    z-index: 30;
  }

  .mobile-card-table tbody tr.subtask-overdue {
    border-color: rgba(220, 53, 69, 0.45);
    background: rgba(255, 244, 245, 0.96);
  }

  .mobile-card-table tbody tr.status-disabled,
  .mobile-card-table tbody tr.is-cancelled {
    border-color: rgba(190, 198, 210, 0.8);
    background: rgba(241, 243, 247, 0.96);
  }

  .mobile-card-table tbody tr:hover td,
  .mobile-card-table tbody tr td {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 3px;
    padding: 3px 0;
    border: 0;
    color: #172434;
    background: transparent !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }

  .mobile-card-table tbody td::before {
    content: attr(data-label) "：";
    flex: 0 0 auto;
    color: #8792a3;
    font-weight: 500;
    white-space: nowrap;
  }

  .mobile-card-table tbody td[data-label=""]::before,
  .mobile-card-table tbody td.mobile-card-status::before,
  .mobile-card-table tbody td.mobile-card-actions::before {
    content: none;
  }

  .mobile-card-table tbody td.mobile-card-primary {
    grid-column: 1 / -1;
    min-height: 28px;
    align-items: center;
    padding: 0 92px 7px 16px;
    border-bottom: 1px solid rgba(223, 230, 241, 0.9);
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-card-table tbody td.mobile-card-primary::before {
    color: #243445;
    font-weight: 900;
  }

  .mobile-card-table tbody td.mobile-card-primary::after {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 9px;
    height: 9px;
    border: 1.5px solid #2789f5;
    border-radius: 2px;
    box-shadow: inset 0 2px 0 rgba(39, 137, 245, 0.18);
  }

  .mobile-card-table tbody td.mobile-card-status {
    position: absolute;
    top: 8px;
    right: 44px;
    z-index: 2;
    width: auto;
    min-height: 26px;
    align-items: center;
    padding: 0;
    white-space: nowrap;
  }

  .mobile-card-table tbody td.mobile-card-status > * {
    max-width: 118px;
  }

  .mobile-card-table tbody td.mobile-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 8;
    display: block;
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .mobile-card-table tbody td.mobile-card-actions-empty {
    display: none;
  }

  .mobile-card-menu-toggle {
    width: 30px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: #9aa6b6;
    background: transparent;
    font-size: 0;
    cursor: pointer;
  }

  .mobile-card-menu-toggle::before {
    content: "•••";
    font-size: 13px;
    letter-spacing: 1px;
    line-height: 1;
  }

  .mobile-card-actions.is-open .mobile-card-menu-toggle,
  .mobile-card-menu-toggle:hover {
    color: #1769e0;
    background: rgba(23, 105, 224, 0.08);
  }

  .mobile-card-menu-panel {
    position: absolute;
    top: 31px;
    right: 0;
    z-index: 20;
    display: none;
    min-width: 112px;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(205, 217, 237, 0.96);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(35, 59, 103, 0.16);
  }

  .mobile-card-actions.is-open .mobile-card-menu-panel {
    display: flex;
  }

  .mobile-card-menu-panel form {
    display: block;
    width: 100%;
  }

  .mobile-card-menu-panel .table-action,
  .mobile-card-menu-panel .secondary-action,
  .mobile-card-menu-panel button,
  .mobile-card-menu-panel a {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }

  .mobile-card-table tbody tr.mobile-card-message-row {
    display: block;
    padding: 14px;
  }

  .mobile-card-table tbody tr.mobile-card-message-row td {
    display: block;
    text-align: center;
    color: #718096;
  }
}

@media (max-width: 1080px) {
  body.is-auth .shell {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 30px 22px;
  }

  body.is-auth .page-hero {
    min-height: auto;
  }

  body.is-auth .login-visual {
    width: min(72vw, 420px);
    min-width: 0;
  }

  body.is-auth .visual-core {
    width: min(58%, 270px);
  }

  body.is-auth .visual-core span {
    max-width: 184px;
    font-size: 16px;
  }

  body.is-auth .visual-core small {
    font-size: 12px;
  }

  body.is-auth .node-one {
    --node-radius: 188px;
  }

  body.is-auth .node-two {
    --node-radius: 156px;
  }

  body.is-auth .node-three {
    --node-radius: 124px;
  }

  body.is-auth .auth-panel {
    max-width: 620px;
    min-height: auto;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  body.is-auth .shell {
    padding: 18px 14px;
  }

  body.is-auth .page-hero {
    display: none;
  }

  body.is-auth .auth-panel {
    padding: 26px 20px;
  }

  body.is-auth .auth-panel-brand {
    align-items: flex-start;
    font-size: 18px;
  }

  body.is-auth .auth-welcome {
    margin-bottom: 26px;
    font-size: 30px;
  }

  body.is-auth .tabs {
    gap: 10px 0;
  }

  body.is-auth .tab {
    font-size: 14px;
  }

  body.is-auth .code-row {
    grid-template-columns: 1fr;
  }

  body.is-auth .secondary-action.code-action {
    width: fit-content;
  }
}

/* 首页直接使用用户提供的科技背景图，登录区域覆盖在右侧可操作位置。 */
body.is-auth {
  background:
    linear-gradient(90deg, rgba(245, 250, 255, 0.18), rgba(245, 250, 255, 0.04)),
    url("../images/login-bg.png") center center / cover no-repeat fixed;
}

body.is-auth::before,
body.is-auth::after {
  display: none;
}

body.is-auth .shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0 clamp(48px, 10.8vw, 210px) 0 clamp(24px, 4vw, 80px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

body.is-auth .page-hero {
  display: none;
}

body.is-auth .auth-panel {
  width: min(570px, calc(100vw - 44px));
  min-height: 592px;
  padding: clamp(42px, 3.2vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

body.is-auth .auth-panel-brand {
  margin-bottom: 14px;
  color: #111820;
}

body.is-auth .auth-panel-brand img {
  width: 32px;
  height: 32px;
  padding: 3px;
  border-radius: 7px;
  background: #111820;
  object-fit: contain;
}

body.is-auth .auth-welcome {
  margin-bottom: 36px;
  color: #1769e0;
  font-size: 34px;
}

body.is-auth input,
body.is-auth select,
body.is-auth textarea {
  border-color: rgba(220, 226, 233, 0.9);
  background: rgba(235, 235, 235, 0.92);
}

@media (max-width: 1080px) {
  body.is-auth {
    background-position: 42% center;
  }

  body.is-auth .shell {
    padding: 24px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  body.is-auth {
    background:
      linear-gradient(180deg, rgba(246, 250, 255, 0.88), rgba(232, 242, 255, 0.92)),
      url("../images/login-bg.png") 34% center / cover no-repeat;
  }

  body.is-auth .shell {
    padding: 18px 14px;
  }

  body.is-auth .auth-panel {
    width: 100%;
    min-height: auto;
    padding: 26px 20px;
    background: rgba(255, 255, 255, 0.78);
  }
}

/* 最终首页排版：保持参考图左右结构，左侧使用背景图主体，右侧用真实登录界面覆盖原 UI 区。 */
body.is-auth {
  background: url("../images/login-bg-clean-v2.png") center center / cover no-repeat fixed;
}

body.is-auth .shell {
  width: 100%;
  min-height: 100vh;
  padding: 0 clamp(92px, 11.6vw, 224px) 0 clamp(42px, 5vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 570px);
  align-items: center;
  gap: clamp(44px, 6vw, 116px);
}

body.is-auth .auth-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 592px;
  grid-column: 2;
  padding: clamp(42px, 3.15vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 62px rgba(84, 125, 176, 0.12);
  backdrop-filter: blur(6px);
}

body.is-auth .auth-panel-brand img {
  width: 38px;
  height: 42px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

@media (max-width: 1080px) {
  body.is-auth {
    background-position: 40% center;
  }

  body.is-auth .shell {
    padding: 24px;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body.is-auth .page-hero {
    display: none;
  }

  body.is-auth .auth-panel {
    grid-column: 1;
    width: min(620px, 100%);
    min-height: auto;
  }
}

@media (max-width: 640px) {
  body.is-auth {
    background:
      linear-gradient(180deg, rgba(246, 250, 255, 0.82), rgba(232, 242, 255, 0.9)),
      url("../images/login-bg-clean-v2.png") 34% center / cover no-repeat;
  }

  body.is-auth .shell {
    padding: 18px 14px;
  }

  body.is-auth .auth-panel {
    width: 100%;
    padding: 26px 20px;
    background: rgba(255, 255, 255, 0.94);
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .admin-layout {
    display: block;
    min-height: 100vh;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 80;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    color: var(--ink);
    background: rgba(232, 238, 252, 0.96);
    border-top: 1px solid rgba(194, 207, 232, 0.82);
    border-right: 0;
    box-shadow: 0 -12px 30px rgba(65, 89, 132, 0.12);
    backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar::-webkit-scrollbar {
    display: none;
  }

  .admin-sidebar {
    scrollbar-width: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-brand-row {
    display: none;
  }

  .user-card {
    min-width: 128px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 0;
    border-right: 1px solid rgba(197, 211, 236, 0.86);
    border-bottom: 0;
  }

  .avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
  }

  .user-name-link {
    margin-top: 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .user-card small {
    display: none;
  }

  .admin-nav {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .nav-item {
    width: auto;
    min-width: 92px;
    height: 42px;
    justify-content: center;
    white-space: nowrap;
    font-size: 14px;
  }

  .ghost-action {
    flex: 0 0 auto;
    width: auto;
    min-width: 86px;
    min-height: 42px;
    margin-top: 0;
    padding: 0 12px;
    white-space: nowrap;
  }

  .admin-main {
    padding: 18px 14px calc(90px + env(safe-area-inset-bottom));
  }

  .app-user-bar {
    position: absolute;
    top: 8px;
    right: 14px;
  }

  .app-user-avatar {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .app-user-entry strong {
    max-width: 46vw;
    font-size: 14px;
  }

  .app-user-bar {
    gap: 10px;
  }

  .app-user-logout {
    font-size: 13px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-card {
    min-height: 118px;
    gap: 4px;
    padding: 16px 42px 14px 12px;
  }

  .dashboard-card-label {
    font-size: 14px;
  }

  .dashboard-card strong {
    font-size: 30px;
  }

  .dashboard-card p {
    font-size: 11px;
    line-height: 1.35;
  }

  .dashboard-card-badge {
    min-height: 24px;
    padding: 0 9px;
    font-size: 10px;
  }

  .dashboard-card-visual {
    right: 12px;
    bottom: 20px;
    width: 30px;
    height: 30px;
  }

  .dashboard-card-visual::before {
    inset: 9px;
    border-width: 1.5px;
  }

  .section-heading.with-action.project-list-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-filter-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-left: 0;
  }

  .project-filter-form .project-date-start {
    grid-column: 1 / span 3;
  }

  .project-filter-form .project-date-end {
    grid-column: 4 / span 3;
  }

  .project-filter-form .project-stage-filter {
    grid-column: 1 / span 2;
  }

  .project-filter-form .project-keyword-filter {
    grid-column: 3 / span 3;
  }

  .project-filter-form .project-search-action {
    grid-column: 6 / span 1;
    justify-self: stretch;
  }

  .project-filter-form .project-date-start,
  .project-filter-form .project-date-end,
  .project-filter-form .project-stage-filter,
  .project-filter-form .project-keyword-filter,
  .project-filter-form .project-search-action {
    width: 100%;
    min-width: 0;
  }

  .project-filter-form .project-search-action {
    padding: 0 12px;
  }

  .project-filter-form .project-reset-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .project-list-heading .top-add-button {
    width: 100%;
    justify-self: stretch;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-height: 720px),
  (orientation: landscape) and (max-width: 1180px) {
  .admin-layout {
    --sidebar-width: clamp(186px, 18vw, 206px);
  }

  .admin-sidebar {
    gap: 10px;
    padding: 12px 10px;
  }

  .sidebar-toggle {
    width: 38px;
    height: 36px;
    margin: -2px 0 0;
  }

  .user-card {
    gap: 6px;
    padding: 0 6px 10px;
  }

  .avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
  }

  .user-name-link {
    margin-top: 4px;
    font-size: 15px;
  }

  .admin-nav {
    gap: 6px;
  }

  .nav-item,
  .ghost-action {
    min-height: 36px;
    height: 36px;
    font-size: 13px;
  }

  .nav-item {
    padding: 0 10px;
  }

  .admin-main {
    padding: 14px 10px;
  }

  .section-heading h2 {
    white-space: nowrap;
    word-break: keep-all;
    line-height: 1.2;
  }

  .section-heading.with-action.project-list-heading {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    gap: 10px 12px;
  }

  .project-list-heading > div {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .project-list-heading .project-filter-form {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(112px, 0.82fr) minmax(112px, 0.82fr) minmax(160px, 1fr) max-content;
    align-items: center;
    justify-content: end;
    gap: 8px;
    width: 100%;
    margin-left: 0;
  }

  .project-filter-form .project-date-start {
    grid-column: 1 / span 2;
    grid-row: 1;
  }

  .project-filter-form .project-date-end {
    grid-column: 3 / span 2;
    grid-row: 1;
  }

  .project-filter-form .project-stage-filter {
    grid-column: 1;
    grid-row: 2;
  }

  .project-filter-form .project-keyword-filter {
    grid-column: 2 / span 2;
    grid-row: 2;
  }

  .project-filter-form.project-filter-active .project-keyword-filter {
    grid-column: 2;
  }

  .project-filter-form .project-reset-action {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .project-filter-form .project-search-action {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
  }

  .project-filter-form .project-date-start,
  .project-filter-form .project-date-end,
  .project-filter-form .project-stage-filter,
  .project-filter-form .project-keyword-filter,
  .project-filter-form .project-reset-action,
  .project-filter-form .project-search-action {
    width: 100%;
    min-width: 0;
  }

  .section-heading.with-action.project-list-heading .project-filter-form .project-reset-action,
  .section-heading.with-action.project-list-heading .project-filter-form .project-search-action {
    width: 78px;
    min-width: 78px;
    padding: 0 12px;
  }

  .section-heading.with-action.project-list-heading .top-add-button {
    grid-column: 2;
    grid-row: 2;
    width: 110px;
    min-width: 110px;
    justify-self: end;
  }

  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-card {
    min-height: 112px;
    gap: 4px;
    padding: 15px 46px 13px 14px;
  }

  .dashboard-card-label {
    font-size: 14px;
  }

  .dashboard-card strong {
    font-size: 32px;
  }

  .dashboard-card p {
    font-size: 11px;
    line-height: 1.35;
  }

  .dashboard-card-badge {
    min-height: 24px;
    padding: 0 9px;
    font-size: 10px;
  }

  .dashboard-card-visual {
    right: 12px;
    bottom: 18px;
    width: 32px;
    height: 32px;
  }

  .project-list-wrap {
    padding: 8px;
  }

  .data-table {
    min-width: 760px;
  }

  .data-table th,
  .data-table td {
    padding: 11px 10px;
    font-size: 13px;
  }

  .data-table th:last-child,
  .data-table td:last-child {
    white-space: nowrap;
  }

  .table-action {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .admin-layout.sidebar-collapsed {
    --sidebar-width: 58px;
  }

  .admin-layout.sidebar-collapsed .admin-sidebar {
    gap: 9px;
    padding: 10px 5px;
  }

  .admin-layout.sidebar-collapsed .avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 17px;
  }

  .admin-layout.sidebar-collapsed .nav-item,
  .admin-layout.sidebar-collapsed .ghost-action {
    width: 38px;
    min-width: 38px;
    height: 36px;
  }

  .admin-layout.sidebar-collapsed .nav-item::before,
  .admin-layout.sidebar-collapsed .ghost-action::before {
    width: 16px;
    height: 16px;
  }
}

.mobile-filter-toggle {
  display: none;
}

@media (max-width: 900px),
  (orientation: landscape) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-height: 720px),
  (orientation: landscape) and (max-width: 1180px) {
  .section-heading.with-action.has-mobile-filter {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-template-areas:
      "title toggle"
      "actions actions"
      "filter filter";
    align-items: center !important;
    gap: 10px;
  }

  .section-heading.with-action.has-mobile-filter > :first-child {
    grid-area: title;
    min-width: 0;
  }

  .section-heading.with-action.has-mobile-filter > h2:first-child {
    grid-area: title;
    min-width: 0;
  }

  .section-heading.with-action.has-mobile-filter > :not(:first-child):not(.mobile-filter-toggle):not(.list-filter-form) {
    grid-area: actions !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    justify-self: end;
  }

  .section-heading.with-action.has-mobile-filter .mobile-filter-toggle {
    grid-area: toggle;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    justify-self: end;
    border: 1px solid rgba(198, 213, 238, 0.95);
    border-radius: 4px;
    color: var(--blue-dark);
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(23, 105, 224, 0.08);
  }

  .section-heading.with-action.has-mobile-filter .mobile-filter-toggle::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid currentColor;
    transition: transform 0.16s ease;
  }

  .section-heading.with-action.has-mobile-filter.mobile-filter-open .mobile-filter-toggle::before {
    transform: rotate(180deg);
  }

  .section-heading.with-action.has-mobile-filter .list-filter-form {
    grid-area: filter !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    display: none !important;
    width: 100%;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(216, 226, 240, 0.9);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.66);
  }

  .section-heading.with-action.has-mobile-filter.mobile-filter-open .list-filter-form {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: center;
    justify-content: start;
    gap: 10px;
  }

  .section-heading.with-action.has-mobile-filter .list-filter-form input,
  .section-heading.with-action.has-mobile-filter .list-filter-form select {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .section-heading.with-action.has-mobile-filter .list-filter-form .table-action {
    grid-column: auto !important;
    grid-row: auto !important;
    width: fit-content !important;
    min-width: 74px !important;
    min-height: 38px;
    height: 38px;
    padding: 0 14px;
  }

  .section-heading.with-action.has-mobile-filter .list-filter-form button.table-action[type="submit"] {
    grid-column: -2 / -1 !important;
    justify-self: end;
  }
}

@media (min-width: 901px), (orientation: landscape) {
  .admin-sidebar .sidebar-toggle,
  .admin-layout.sidebar-collapsed .sidebar-toggle {
    position: fixed;
    z-index: 85;
    left: calc(var(--sidebar-width) - 14px);
    top: 50%;
    width: 14px;
    height: 68px;
    margin: 0;
    transform: translateY(-50%);
    border: 1px solid rgba(179, 197, 232, 0.95);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    color: #4562e7;
    background: #e8eefc;
    box-shadow:
      -5px 0 14px rgba(71, 96, 151, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .admin-sidebar .sidebar-toggle::before,
  .admin-layout.sidebar-collapsed .sidebar-toggle::before {
    width: 10px;
    height: 10px;
  }

  .admin-sidebar .sidebar-toggle:hover,
  .admin-layout.sidebar-collapsed .sidebar-toggle:hover {
    color: #fff;
    background: linear-gradient(180deg, #4b72ff 0%, #7189f7 100%);
    box-shadow: -6px 0 16px rgba(70, 97, 235, 0.18);
  }
}

@media (max-width: 900px) {
  .admin-main {
    padding-top: 58px;
  }

  .admin-main::before {
    top: 46px;
    left: 14px;
    right: 14px;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-height: 720px),
  (orientation: landscape) and (max-width: 1180px) {
  .admin-main {
    padding-top: 58px;
  }

  .admin-main::before {
    top: 46px;
    left: 10px;
    right: 10px;
  }
}

.ai-assistant-heading {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.ai-assistant-heading > h2 {
  flex: 0 0 auto;
  padding-top: 5px;
}

.ai-assistant-toolbar {
  width: min(1040px, calc(100% - 150px));
  margin-left: auto;
  display: grid;
  gap: 10px;
}

.ai-assistant-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ai-assistant-toolbar-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-assistant-toolbar-field > span,
.ai-assistant-toolbar-prompts > strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-assistant-toolbar-field select {
  width: 190px;
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  color: var(--ink);
  background-color: #fff;
  font-weight: 800;
}

.ai-assistant-project-field select {
  width: min(390px, 31vw);
}

.ai-assistant-toolbar .ai-assistant-prompts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-assistant-toolbar .ai-assistant-prompts button {
  min-height: 36px;
  padding: 0 12px;
  text-align: center;
}

.ai-assistant-toolbar .ai-assistant-readonly {
  margin: 0;
  padding: 0;
  border: 0;
  text-align: right;
}

.ai-assistant-shell {
  display: block;
  min-height: calc(100vh - 250px);
}

.ai-assistant-chat {
  border: 1px solid rgba(205, 218, 239, 0.94);
  background: rgba(255, 255, 255, 0.72);
}

.ai-assistant-prompts {
  display: grid;
  gap: 8px;
}

.ai-assistant-prompts button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(203, 216, 239, 0.9);
  color: #24415f;
  background: #f2f6fd;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.ai-assistant-prompts button:hover {
  border-color: #8db7ff;
  color: var(--blue-dark);
  background: #e8f0ff;
}

.ai-assistant-readonly {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.ai-assistant-chat {
  min-width: 0;
  min-height: calc(100vh - 250px);
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
}

.ai-assistant-messages {
  min-height: 0;
  max-height: calc(100vh - 390px);
  padding: 20px;
  overflow-y: auto;
}

.ai-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.ai-message-user {
  flex-direction: row-reverse;
}

.ai-message-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 50%;
  color: #fff;
  background: #5579f5;
}

.ai-message-avatar::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a2 2 0 0 1 2 2v1h3a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h3V4a2 2 0 0 1 2-2Zm-4 8a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm8 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-7 5v2h6v-2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a2 2 0 0 1 2 2v1h3a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h3V4a2 2 0 0 1 2-2Zm-4 8a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm8 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-7 5v2h6v-2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-message-user .ai-message-avatar {
  background: #2b9fb6;
}

.ai-message-user .ai-message-avatar::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4.8 20c.7-4.2 3.1-6.3 7.2-6.3s6.5 2.1 7.2 6.3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4.8 20c.7-4.2 3.1-6.3 7.2-6.3s6.5 2.1 7.2 6.3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-message-content {
  max-width: min(820px, 84%);
  padding: 12px 14px;
  border: 1px solid rgba(207, 220, 241, 0.9);
  background: #f5f8fd;
}

.ai-message-user .ai-message-content {
  background: #eaf2ff;
}

.ai-message-content strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.ai-message-content p {
  margin: 0;
  color: #26384d;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-message-content small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.ai-assistant-form {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(244, 248, 254, 0.9);
}

.ai-assistant-input-wrap {
  position: relative;
}

.ai-assistant-input-wrap textarea {
  width: 100%;
  min-height: 92px;
  padding: 13px 52px 13px 14px;
  resize: vertical;
  border: 1px solid rgba(187, 204, 232, 0.96);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
}

.ai-voice-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd8ee;
  border-radius: 50%;
  color: #3467e8;
  background: #edf3ff;
  cursor: pointer;
}

.ai-voice-button::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v5M8 22h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v5M8 22h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-voice-button.is-listening {
  color: #fff;
  background: #e83b71;
  animation: ai-voice-pulse 1.2s ease-in-out infinite;
}

.ai-voice-button.is-unavailable {
  color: #8a96a8;
  background: #eef1f5;
  cursor: help;
}

@keyframes ai-voice-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(232, 59, 113, 0.16);
  }
}

.ai-assistant-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ai-voice-status {
  flex: 1 1 360px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 10px;
  border: 1px solid rgba(190, 210, 238, 0.95);
  background: rgba(234, 242, 255, 0.9);
  color: #265078;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.ai-audio-device-select {
  width: min(260px, 100%);
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(190, 210, 238, 0.95);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ai-voice-status.is-recording {
  border-color: rgba(232, 59, 113, 0.35);
  background: rgba(255, 235, 243, 0.95);
  color: #b1184d;
}

.ai-voice-status.is-loading {
  border-color: rgba(52, 103, 232, 0.34);
  background: rgba(230, 239, 255, 0.96);
  color: #1353c7;
}

.ai-voice-status.is-success {
  border-color: rgba(20, 147, 117, 0.35);
  background: rgba(228, 249, 243, 0.96);
  color: #08735e;
}

.ai-voice-status.is-error {
  border-color: rgba(218, 70, 70, 0.34);
  background: rgba(255, 238, 238, 0.96);
  color: #b52222;
}

.ai-voice-preview {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(52, 103, 232, 0.22);
  background: #fff;
  color: #1353c7;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.ai-send-button {
  min-width: 82px;
  min-height: 38px;
}

@media (max-width: 900px) {
  .ai-assistant-heading {
    display: block;
  }

  .ai-assistant-toolbar {
    width: 100%;
    margin-top: 14px;
  }

  .ai-assistant-toolbar-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .ai-assistant-toolbar-field {
    flex: 1 1 280px;
  }

  .ai-assistant-toolbar-field select,
  .ai-assistant-project-field select {
    width: 100%;
  }

  .ai-assistant-toolbar .ai-assistant-prompts {
    justify-content: flex-start;
  }

  .ai-assistant-toolbar .ai-assistant-readonly {
    text-align: left;
  }

  .ai-assistant-shell {
    min-height: auto;
  }

  .ai-assistant-chat {
    min-height: auto;
  }

  .ai-assistant-messages {
    max-height: 55vh;
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .ai-assistant-toolbar-field {
    flex-basis: 100%;
  }

  .ai-assistant-toolbar-prompts {
    align-items: flex-start;
  }

  .ai-assistant-toolbar-prompts > strong {
    width: 100%;
  }

  .ai-assistant-toolbar .ai-assistant-prompts {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-message-content {
    max-width: calc(100% - 42px);
  }
}

/* Mobile portrait cards: keep each field readable on its own row. */
@media (max-width: 900px) and (orientation: portrait) {
  .mobile-card-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .mobile-card-table tbody tr td:not(.mobile-card-status):not(.mobile-card-actions) {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mobile-card-table tbody tr td:not(.mobile-card-primary):not(.mobile-card-status):not(.mobile-card-actions) {
    min-height: 28px;
    align-items: flex-start;
    padding: 5px 0;
  }

  .mobile-card-table tbody td.mobile-card-primary {
    position: relative;
    min-height: 34px;
    align-items: center;
    padding: 2px 92px 8px 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .mobile-card-table tbody td.mobile-card-primary::before {
    font-size: 13px;
    line-height: 1.45;
  }

  .mobile-card-table tbody td.mobile-card-primary::after {
    content: none;
  }

  .mobile-card-table tbody td.mobile-card-status .stage-pill,
  .mobile-card-table tbody td.mobile-card-status .status-pill {
    min-height: 22px;
    padding: 0 6px;
    font-size: 11px;
  }
}

/* Keep the chat and composer close together on mobile landscape screens. */
@media (orientation: landscape) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-width: 1180px) and (max-height: 560px) {
  .admin-sidebar {
    z-index: 90;
  }

  .admin-sidebar .sidebar-toggle,
  .admin-layout.sidebar-collapsed .sidebar-toggle {
    z-index: 110;
    overflow: visible;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .admin-sidebar .sidebar-toggle::after,
  .admin-layout.sidebar-collapsed .sidebar-toggle::after {
    content: "";
    position: absolute;
    inset: -10px -12px;
  }

  .ai-assistant-shell,
  .ai-assistant-chat {
    min-height: 0;
  }

  .ai-assistant-chat {
    grid-template-rows: auto auto;
  }

  .ai-assistant-messages {
    min-height: 0;
    max-height: 88vh;
    padding: 12px;
  }

  .ai-assistant-form {
    padding: 10px 12px;
  }

  .ai-assistant-input-wrap textarea {
    min-height: 68px;
    max-height: 96px;
  }

  .ai-assistant-form-actions {
    margin-top: 8px;
  }
}
