:root {
  --bg: #f4f5f7;
  --bg-2: #eef2f8;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.52);
  --edge: rgba(255, 255, 255, 0.76);
  --line: rgba(15, 23, 42, 0.08);
  --text: #111827;
  --muted: #667085;
  --sidebar: rgba(255, 255, 255, 0.62);
  --sidebar-edge: rgba(17, 24, 39, 0.08);
  --blue: #0a84ff;
  --cyan: #5ac8fa;
  --infrared: #ff5f57;
  --gold: #d39a2f;
  --gold-soft: #ffd86e;
  --violet-soft: #b8b4ff;
  --rose-soft: #ffc4dd;
  --night-soft: #32456f;
  --night-deep: #1c2754;
  --cloud: rgba(255, 255, 255, 0.82);
  --ice: #cfe2ff;
  --mint: #d9f4f1;
  --shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 12%, rgba(90, 200, 250, 0.16), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(255, 95, 87, 0.1), transparent 22%),
    radial-gradient(circle at 78% 78%, rgba(10, 132, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, var(--bg-2) 100%);
  font-family: "SF Pro Display", "Avenir Next", "Segoe UI Variable Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.01em;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
  border-radius: 50%;
}

body::before {
  width: 360px;
  height: 360px;
  top: 8vh;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 95, 87, 0.12), transparent 70%);
}

body::after {
  width: 320px;
  height: 320px;
  left: -110px;
  bottom: 10vh;
  background: radial-gradient(circle, rgba(90, 200, 250, 0.16), transparent 70%);
}

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

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

button {
  border: 0;
  border-radius: 999px;
  padding: 0.86rem 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(10, 132, 255, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover,
.ghost-btn:hover,
.hero-link:hover,
.sidebar-nav a:hover {
  transform: translateY(-1px);
}

button:hover {
  box-shadow: 0 22px 38px rgba(10, 132, 255, 0.28);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  height: 100vh;
  padding: 28px 18px 24px;
  color: var(--night-soft);
  background:
    linear-gradient(180deg, rgba(252, 250, 255, 0.88) 0%, rgba(236, 244, 255, 0.78) 58%, rgba(243, 239, 255, 0.8) 100%);
  border-right: 1px solid rgba(125, 155, 219, 0.14);
  box-shadow: 18px 0 44px rgba(92, 122, 180, 0.12);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  padding: 8px 10px 0;
}

.sidebar-brand h1 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.sidebar-brand .muted {
  color: var(--muted);
  line-height: 1.55;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.sidebar-nav a {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 13px 15px;
  border-radius: 18px;
  color: var(--night-soft);
  border: 1px solid rgba(125, 155, 219, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 246, 255, 0.9) 42%, rgba(238, 236, 255, 0.84) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(168, 160, 255, 0.1),
    0 10px 22px rgba(92, 122, 180, 0.1);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 52%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.14));
  pointer-events: none;
}

.sidebar-nav a::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 216, 110, 0), rgba(255, 216, 110, 0.6), rgba(255, 216, 110, 0));
  opacity: 0.72;
  pointer-events: none;
}

.sidebar-nav a.active {
  color: #f6f8ff;
  border-color: rgba(168, 160, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(37, 53, 111, 0.96) 0%, rgba(77, 92, 180, 0.94) 48%, rgba(118, 160, 255, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 216, 110, 0.24),
    0 14px 28px rgba(70, 99, 186, 0.22);
}

.sidebar-nav a.active::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02));
}

.sidebar-nav a:hover {
  color: #2b3f71;
  border-color: rgba(125, 155, 219, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(168, 160, 255, 0.12),
    0 14px 28px rgba(92, 122, 180, 0.14);
}

.sidebar-meta {
  display: grid;
  gap: 14px;
  padding: 0 10px;
}

.user-pill {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.user-pill strong {
  font-size: 0.98rem;
}

.user-pill span {
  font-size: 0.9rem;
  color: var(--muted);
}

.sidebar-logout {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(17, 24, 39, 0.06);
}

.main-shell {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 24px 0 0;
  margin: 0 22px;
}

.topbar strong {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.topbar-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.page {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 54px;
}

.page-guest {
  padding-top: 52px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero,
.panel,
.auth-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--edge);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.68) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.hero::before,
.panel::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 34%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 18px;
  padding: 24px 26px;
  min-height: 0;
  margin-bottom: 22px;
  align-items: start;
}

.hero-copy,
.hero-aside,
.panel-head,
.form-grid,
.stack,
.list-row,
table {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-copy h1 {
  margin: 0 0 12px;
  max-width: none;
  white-space: nowrap;
  font-size: clamp(1.28rem, 2.1vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.hero-copy p.muted {
  max-width: 60ch;
  line-height: 1.62;
  font-size: 0.92rem;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.32rem 0.74rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.04);
  border: 1px solid rgba(17, 24, 39, 0.06);
  color: #344054;
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(17, 24, 39, 0.06);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.hero-link-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  border-color: transparent;
}

.hero-aside {
  display: grid;
  gap: 14px;
}

.hero-visual-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(255, 255, 255, 0.78) 100%);
  border: 1px solid rgba(17, 24, 39, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mini-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-card-head strong {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.mini-card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.spectrum-svg {
  width: 100%;
  height: 92px;
  display: block;
}

.spectrum-svg path {
  fill: none;
  stroke: url(#spectrumLine);
  stroke-width: 4.5;
  stroke-linecap: round;
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.mesh-card p {
  margin: 10px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.mesh {
  position: relative;
  height: 104px;
  margin-top: 4px;
  background:
    linear-gradient(rgba(10, 132, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 132, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 18px;
}

.mesh::before,
.mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
}

.mesh::before {
  background-image:
    linear-gradient(#9bbfff, #9bbfff),
    linear-gradient(#9bbfff, #9bbfff),
    linear-gradient(#ff9f8a, #ff9f8a),
    linear-gradient(#78d9ff, #78d9ff);
  background-size: 84px 2px, 72px 2px, 92px 2px, 78px 2px;
  background-position: 48px 32px, 132px 64px, 186px 28px, 96px 82px;
  transform: rotate(-8deg);
  opacity: 0.8;
}

.node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.7);
}

.node-a { left: 44px; top: 28px; background: #5ac8fa; }
.node-b { left: 126px; top: 58px; background: #0a84ff; }
.node-c { left: 196px; top: 24px; background: #ff5f57; }
.node-d { left: 250px; top: 50px; background: #ffd166; }
.node-e { left: 94px; top: 76px; background: #74d99f; }

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel,
.auth-card {
  padding: 26px;
  margin-bottom: 22px;
}

.panel-subtle {
  margin: -8px 0 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head h1,
.panel-head h2,
.panel h1,
.panel h2,
.auth-card h1 {
  margin: 0;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.panel-head h1,
.panel h1,
.auth-card h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.panel-head h2,
.panel h2 {
  font-size: 1.36rem;
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 22px;
}

.panel-grid {
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: start;
}

.dashboard-grid {
  align-items: stretch;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 320px;
}

.dashboard-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-list::-webkit-scrollbar {
  width: 6px;
}

.dashboard-list::-webkit-scrollbar-thumb {
  background: rgba(118, 160, 255, 0.28);
  border-radius: 999px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  min-height: 136px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -14px;
  bottom: -16px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.58), transparent 68%);
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: rgba(17, 24, 39, 0.62);
  font-size: 0.92rem;
}

.stat-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(1.85rem, 2.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-cool {
  background: linear-gradient(180deg, rgba(232, 245, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.stat-neutral {
  background: linear-gradient(180deg, rgba(244, 246, 248, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.stat-infrared {
  background: linear-gradient(180deg, rgba(255, 236, 234, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.stat-ice {
  background: linear-gradient(180deg, rgba(235, 243, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.stat-gold {
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.96) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.list-row:first-of-type {
  border-top: 0;
}

.list-copy {
  min-width: 0;
  flex: 1;
}

.list-copy strong,
.list-copy p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-copy strong {
  -webkit-line-clamp: 2;
}

.list-copy p {
  -webkit-line-clamp: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.08);
  color: var(--blue);
  border: 1px solid rgba(10, 132, 255, 0.1);
  font-size: 0.86rem;
  white-space: nowrap;
}

.tag-warn {
  margin-left: 8px;
  background: rgba(255, 184, 107, 0.16);
  color: #b85c1c;
  border-color: rgba(184, 92, 28, 0.12);
}

.tag-ai {
  background: rgba(104, 138, 255, 0.16);
  color: #365bcb;
  border-color: rgba(54, 91, 203, 0.12);
}

.tag-manual {
  background: rgba(116, 217, 159, 0.18);
  color: #2b7a55;
  border-color: rgba(43, 122, 85, 0.12);
}

.tag-pending {
  background: rgba(244, 246, 248, 0.88);
  color: #667085;
  border-color: rgba(102, 112, 133, 0.12);
}

.tag-submitted {
  background: rgba(232, 245, 255, 0.9);
  color: #2a5e9c;
  border-color: rgba(42, 94, 156, 0.12);
}

.tag-running {
  background: rgba(255, 247, 222, 0.9);
  color: #9c6b18;
  border-color: rgba(156, 107, 24, 0.12);
}

.tag-done {
  background: rgba(229, 248, 238, 0.9);
  color: #2b7a55;
  border-color: rgba(43, 122, 85, 0.12);
}

.flash {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(16px);
}

.flash.success {
  background: rgba(228, 248, 243, 0.92);
}

.flash.error {
  background: rgba(255, 236, 234, 0.92);
}

.duplicate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.26);
  backdrop-filter: blur(8px);
}

.duplicate-modal {
  position: relative;
  overflow: hidden;
  width: min(460px, calc(100vw - 32px));
  padding: 28px 26px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 247, 244, 0.92) 100%);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.16);
}

.duplicate-modal-glow {
  position: absolute;
  inset: -40px auto auto -20px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 95, 87, 0.18), transparent 70%);
  pointer-events: none;
}

.duplicate-modal-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  color: #d45a3d;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.duplicate-modal h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 1.7rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.duplicate-modal-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.duplicate-modal-detail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.duplicate-modal-detail span {
  color: var(--muted);
  font-size: 0.86rem;
}

.duplicate-modal-detail strong {
  line-height: 1.5;
}

.duplicate-modal-close {
  position: relative;
  z-index: 1;
  min-width: 120px;
}

.duplicate-modal-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}


.ai-processing-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 35, 68, 0.24);
  backdrop-filter: blur(10px);
}

.ai-processing-modal {
  position: relative;
  overflow: hidden;
  width: min(360px, calc(100vw - 32px));
  padding: 30px 24px 24px;
  text-align: center;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 248, 255, 0.92) 100%);
  box-shadow: 0 30px 70px rgba(46, 74, 145, 0.18);
}

.ai-processing-modal h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.ai-processing-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ai-processing-orb {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 40%),
    linear-gradient(145deg, rgba(90, 200, 250, 0.95) 0%, rgba(118, 160, 255, 0.92) 48%, rgba(255, 196, 221, 0.9) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 30px rgba(90, 200, 250, 0.26);
  animation: orbFloat 1.6s ease-in-out infinite;
}

.ai-processing-stars {
  position: absolute;
  inset: 18px 22px auto auto;
  display: flex;
  gap: 8px;
}

.ai-processing-stars span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd86e, #ffb870);
  box-shadow: 0 0 0 5px rgba(255, 216, 110, 0.14);
  animation: starTwinkle 1.4s ease-in-out infinite;
}

.ai-processing-stars span:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-processing-stars span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.auth-card {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 34px;
}

.login-stage {
  width: min(560px, calc(100% - 32px));
  margin: 40px auto 0;
  padding: 24px 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-hero {
  position: relative;
  width: 100%;
  padding: 0 6px;
  margin-bottom: 18px;
  text-align: center;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-align: center;
}

.login-stage::before {
  content: none;
}

.auth-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-orbit {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 150px;
  height: 150px;
  pointer-events: none;
}

.orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(10, 132, 255, 0.14);
}

.orbit-a {
  inset: 8px;
}

.orbit-b {
  inset: 28px;
  border-color: rgba(90, 200, 250, 0.2);
}

.orbit-c {
  inset: 50px;
  border-color: rgba(255, 95, 87, 0.2);
  background: radial-gradient(circle, rgba(255, 95, 87, 0.14), transparent 72%);
}

.stack {
  display: grid;
  gap: 15px;
  margin: 24px 0;
}

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

.form-grid label,
.stack label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.core-field {
  padding: 12px;
  border-radius: 16px;
  background: rgba(232, 245, 255, 0.56);
  border: 1px solid rgba(10, 132, 255, 0.12);
}

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

input,
select,
textarea {
  width: 100%;
  padding: 0.96rem 1rem;
  color: var(--text);
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 24, 39, 0.06);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 0 4px rgba(10, 132, 255, 0.12);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.65;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}

.table-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.table-delete-btn {
  min-height: 34px;
  padding: 0.46rem 0.86rem;
  background: linear-gradient(145deg, rgba(201, 79, 68, 0.96) 0%, rgba(255, 120, 105, 0.9) 100%);
  box-shadow: 0 10px 20px rgba(201, 79, 68, 0.18);
}

.upload-status {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 24, 39, 0.06);
  color: var(--muted);
  line-height: 1.6;
}

.upload-status[data-state="checking"] {
  background: rgba(232, 245, 255, 0.82);
  border-color: rgba(10, 132, 255, 0.16);
  color: #2a5e9c;
}

.upload-status[data-state="duplicate"] {
  background: rgba(255, 238, 230, 0.88);
  border-color: rgba(214, 90, 55, 0.18);
  color: #b45534;
}

.upload-status[data-state="ready"] {
  background: rgba(229, 248, 238, 0.9);
  border-color: rgba(60, 158, 112, 0.18);
  color: #2b7a55;
}

.upload-status[data-state="warn"] {
  background: rgba(255, 247, 222, 0.9);
  border-color: rgba(211, 154, 47, 0.18);
  color: #9c6b18;
}

.danger-panel {
  border-color: rgba(201, 79, 68, 0.16);
  background: linear-gradient(180deg, rgba(255, 248, 247, 0.96) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.year-group + .year-group {
  margin-top: 20px;
}

.year-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.year-group-head h3 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.year-group-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.34);
}

.prose ol {
  padding-left: 20px;
  line-height: 1.7;
}

.draft-batch {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.draft-batch:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.draft-batch-head {
  margin-bottom: 14px;
}

.draft-card {
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.9) 0%, rgba(255, 255, 255, 0.72) 100%);
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: var(--shadow-soft);
}

.draft-card:last-child {
  margin-bottom: 0;
}

.draft-alert {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.draft-alert strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.draft-alert p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.draft-alert-suggestion {
  margin-top: 8px !important;
  color: #c65633 !important;
  font-weight: 600;
}

.draft-alert-needs_attention {
  background: rgba(255, 238, 230, 0.88);
  border-color: rgba(214, 90, 55, 0.18);
}

.draft-alert-review_recommended {
  background: rgba(255, 247, 222, 0.9);
  border-color: rgba(211, 154, 47, 0.18);
}

.draft-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.draft-card-head h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.draft-card-head p {
  margin: 0;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.draft-grid div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(17, 24, 39, 0.05);
}

.draft-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.draft-grid strong {
  display: block;
  font-size: 1rem;
  line-height: 1.4;
}

.draft-notes {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(17, 24, 39, 0.05);
}

.draft-notes + .draft-notes {
  margin-top: 12px;
}

.draft-notes h4 {
  margin: 0 0 8px;
  font-size: 0.94rem;
}

.draft-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.draft-notes-secondary {
  background: rgba(244, 246, 248, 0.7);
}

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

  .panel-grid,
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    margin: 0 10px;
    flex-direction: column;
    align-items: start;
  }

  .page {
    width: min(100% - 20px, 1280px);
  }

  .login-stage {
    width: min(560px, calc(100% - 20px));
    margin-top: 20px;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    white-space: normal;
  }

  .draft-grid {
    grid-template-columns: 1fr;
  }

}

.site-footer {
  padding: 18px 16px 22px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}
