:root {
  --ink: #132b32;
  --ink-soft: #466068;
  --muted: #72858a;
  --line: #dce7e5;
  --line-strong: #c8d8d5;
  --paper: #f7faf9;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --navy: #0c2f38;
  --navy-2: #123e47;
  --green: #18a56f;
  --green-deep: #087f55;
  --green-soft: #e6f7ef;
  --cyan: #25aeb5;
  --amber: #eaa43a;
  --amber-soft: #fff5df;
  --red: #d85c5c;
  --red-soft: #fff0ef;
  --blue-soft: #eaf3ff;
  --shadow: 0 12px 36px rgba(12, 47, 56, 0.08);
  --shadow-soft: 0 5px 18px rgba(12, 47, 56, 0.06);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 250px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

::selection { background: #bcebd9; color: var(--navy); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: #dcefed;
  background:
    radial-gradient(circle at 15% 12%, rgba(37, 174, 181, .2), transparent 25%),
    radial-gradient(circle at 88% 82%, rgba(24, 165, 111, .18), transparent 30%),
    linear-gradient(168deg, #0a2b34, #103b43 64%, #092d34);
  overflow-y: auto;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 1px 7px 23px;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, #6ee7b7, #25aeb5);
  box-shadow: 0 8px 24px rgba(37, 174, 181, .25);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: #0d3640;
  border-radius: 999px;
}

.brand-mark::before { width: 18px; height: 6px; left: 11px; top: 10px; transform: rotate(-40deg); }
.brand-mark::after { width: 6px; height: 20px; left: 17px; top: 12px; transform: rotate(34deg); }

.brand strong { display: block; font-size: 15px; letter-spacing: .04em; color: #fff; }
.brand small { display: block; margin-top: 1px; color: #91b7b6; font-size: 10px; letter-spacing: .16em; }

.nav-group { margin-bottom: 18px; }
.nav-label { padding: 0 12px 7px; color: #6f9999; font-size: 11px; letter-spacing: .12em; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 3px 0;
  padding: 9px 12px;
  border-radius: 11px;
  color: #b9d1cf;
  transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(33, 187, 127, .25), rgba(37, 174, 181, .12)); box-shadow: inset 3px 0 #4ce0a5; }
.nav-icon { width: 20px; text-align: center; color: #77cdb2; font-size: 17px; }
.nav-item.active .nav-icon { color: #73e4b8; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.1); color: #cce7e2; font-size: 11px; text-align: center; }

.sidebar-footer { margin-top: auto; }
.system-pill {
  margin: 10px 5px 14px;
  padding: 12px;
  border: 1px solid rgba(134, 222, 198, .18);
  border-radius: 13px;
  background: rgba(3, 27, 33, .32);
}
.system-pill .status-row { display: flex; align-items: center; gap: 7px; color: #d8eeeb; font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #54e5a9; box-shadow: 0 0 0 4px rgba(84,229,169,.12); }
.system-pill small { display: block; margin-top: 7px; color: #7fa5a5; }

.main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(210, 225, 222, .8);
  background: rgba(247, 250, 249, .9);
  backdrop-filter: blur(14px);
}
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.topbar-title { min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 18px; letter-spacing: .01em; }
.topbar-title p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: .18s ease;
}
.icon-button:hover { transform: translateY(-1px); border-color: #a9cfc3; box-shadow: var(--shadow-soft); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.avatar { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--green), var(--cyan)); font-size: 12px; font-weight: 700; }
.avatar.alt { background: linear-gradient(135deg, #5572d8, #8d64c9); }
.avatar.amber { background: linear-gradient(135deg, #e6a137, #d86c49); }
.avatar.gray { background: linear-gradient(135deg, #789098, #47616a); }
.user-chip strong { display: block; font-size: 12px; }
.user-chip small { display: block; color: var(--muted); font-size: 10px; }

.content { max-width: 1540px; margin: 0 auto; padding: 28px 30px 50px; }
.content.narrow { max-width: 1200px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.page-head p { max-width: 720px; margin: 5px 0 0; color: var(--ink-soft); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn.primary { border-color: var(--green); color: #fff; background: linear-gradient(135deg, #19aa73, #16968c); }
.btn.dark { border-color: var(--navy); color: #fff; background: var(--navy); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--red); border-color: #efcaca; background: var(--red-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 20px 14px; }
.card-head h3 { margin: 0; font-size: 16px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 0 20px 20px; }

.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); }

.metric-card { position: relative; min-height: 132px; padding: 19px; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -25px; bottom: -35px; border-radius: 50%; background: var(--green-soft); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.metric-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--green-soft); color: var(--green-deep); font-size: 16px; }
.metric-value { margin: 15px 0 4px; font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.metric-foot { color: var(--muted); font-size: 11px; }
.trend-up { color: var(--green-deep); font-weight: 650; }
.trend-down { color: var(--red); font-weight: 650; }

.status, .tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.status.success, .tag.green { color: #08744f; background: #e3f6ed; }
.status.warning, .tag.amber { color: #9a650d; background: var(--amber-soft); }
.status.danger, .tag.red { color: #ad4141; background: var(--red-soft); }
.status.info, .tag.blue { color: #38679a; background: var(--blue-soft); }
.tag.gray { color: #5f7379; background: #edf2f2; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; color: var(--muted); background: #f6f9f8; font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
td { padding: 13px; border-top: 1px solid #edf2f1; color: var(--ink-soft); vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
.cell-title { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.file-icon { width: 34px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: #fff; background: #d34f50; font-size: 10px; font-weight: 800; }
.file-icon.docx { background: #4578bc; }
.cell-title strong { display: block; color: var(--ink); font-size: 12px; }
.cell-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.search-box { position: relative; min-width: 260px; }
.search-box input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fff; }
.search-box input:focus { border-color: #75bda7; box-shadow: 0 0 0 3px rgba(24,165,111,.09); }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 8px; color: var(--muted); font-size: 18px; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.select, .input { min-height: 39px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; }
.input:focus, .select:focus { border-color: #75bda7; box-shadow: 0 0 0 3px rgba(24,165,111,.08); }

.progress { height: 7px; overflow: hidden; border-radius: 999px; background: #e7efed; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--cyan)); }
.progress.amber span { background: linear-gradient(90deg, #f2b84c, #e88c43); }
.progress.red span { background: linear-gradient(90deg, #ea7770, #d65050); }

.list { display: grid; gap: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf2f1; }
.list-row:first-child { border-top: 0; }
.list-row-main { min-width: 0; flex: 1; }
.list-row strong { display: block; color: var(--ink); font-size: 12px; }
.list-row small { display: block; margin-top: 2px; color: var(--muted); }

.hero-panel {
  position: relative;
  min-height: 210px;
  padding: 30px;
  overflow: hidden;
  color: #e6f6f3;
  background:
    radial-gradient(circle at 82% 18%, rgba(109, 231, 183, .25), transparent 28%),
    radial-gradient(circle at 65% 95%, rgba(37,174,181,.24), transparent 35%),
    linear-gradient(135deg, #0b313a, #104d50);
}
.hero-panel::after { content: ""; position: absolute; width: 270px; height: 270px; right: -80px; top: -110px; border: 1px solid rgba(162,245,214,.14); border-radius: 50%; box-shadow: 0 0 0 35px rgba(162,245,214,.035), 0 0 0 70px rgba(162,245,214,.02); }
.hero-eyebrow { color: #79e0bd; font-size: 11px; letter-spacing: .16em; }
.hero-panel h2 { max-width: 650px; margin: 12px 0 8px; color: #fff; font-size: 29px; line-height: 1.27; }
.hero-panel p { max-width: 680px; margin: 0; color: #b9d3d0; }
.hero-actions { display: flex; gap: 10px; margin-top: 23px; }
.hero-stat { position: absolute; right: 35px; bottom: 27px; display: flex; gap: 24px; z-index: 2; }
.hero-stat strong { display: block; color: #fff; font-size: 21px; }
.hero-stat span { color: #8fb7b3; font-size: 10px; }

.chat-layout { height: calc(100vh - 112px); min-height: 650px; display: grid; grid-template-columns: 240px minmax(0, 1fr) 310px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.chat-history { padding: 16px; border-right: 1px solid var(--line); background: #f4f8f7; overflow-y: auto; }
.new-chat { width: 100%; margin-bottom: 16px; }
.history-label { margin: 14px 7px 7px; color: var(--muted); font-size: 10px; }
.history-item { position: relative; display: block; padding: 10px; margin-bottom: 4px; border-radius: 10px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.history-item:hover, .history-item.active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(13,54,64,.06); }
.history-item span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item small { color: var(--muted); font-size: 9px; }
.chat-main { min-width: 0; display: flex; flex-direction: column; background: #fbfdfc; }
.chat-main-head { height: 61px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #fff; }
.model-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 9px; background: var(--green-soft); color: var(--green-deep); font-size: 11px; font-weight: 650; }
.chat-messages { flex: 1; padding: 24px clamp(18px, 4vw, 60px); overflow-y: auto; }
.message { display: flex; gap: 12px; max-width: 900px; margin: 0 auto 22px; }
.message.user { justify-content: flex-end; }
.message-avatar { width: 33px; height: 33px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--navy); color: #7fe1be; font-size: 14px; }
.message-content { min-width: 0; max-width: calc(100% - 48px); }
.message-meta { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.message.user .message-content { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { padding: 13px 15px; border: 1px solid var(--line); border-radius: 5px 16px 16px; background: #fff; box-shadow: 0 4px 14px rgba(12,47,56,.04); }
.message.user .bubble { border: 0; border-radius: 16px 5px 16px 16px; color: #fff; background: linear-gradient(135deg, #168b68, #167f84); }
.bubble p { margin: 0 0 10px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble h4 { margin: 13px 0 6px; font-size: 13px; }
.bubble ol, .bubble ul { margin: 7px 0 10px; padding-left: 22px; }
.bubble li { margin: 4px 0; }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin: 0 2px; border: 0; border-radius: 6px; color: var(--green-deep); background: var(--green-soft); font-size: 9px; font-weight: 750; cursor: pointer; vertical-align: 2px; }
.answer-tools { display: flex; gap: 5px; margin-top: 8px; }
.answer-tools button { border: 0; border-radius: 7px; padding: 4px 7px; color: var(--muted); background: transparent; cursor: pointer; }
.answer-tools button:hover { color: var(--ink); background: var(--surface-soft); }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: #7ca49c; animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity:.45 } 30% { transform: translateY(-5px); opacity:1 } }
.chat-composer { padding: 12px clamp(18px, 4vw, 60px) 18px; background: linear-gradient(180deg, rgba(251,253,252,0), #fbfdfc 20%); }
.composer-box { max-width: 900px; margin: auto; padding: 10px 10px 8px 13px; border: 1px solid #bcd3cf; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(12,47,56,.08); }
.composer-box textarea { width: 100%; min-height: 48px; max-height: 120px; padding: 5px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; }
.composer-footer { display: flex; align-items: center; gap: 7px; }
.composer-footer small { margin-left: auto; color: var(--muted); }
.send-button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; color: #fff; background: var(--green); cursor: pointer; }
.source-panel { padding: 17px; border-left: 1px solid var(--line); background: #fff; overflow-y: auto; }
.source-panel h3 { margin: 2px 0 14px; font-size: 14px; }
.source-card { margin-bottom: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; cursor: pointer; transition: .18s ease; }
.source-card:hover, .source-card.active { border-color: #8fcab7; background: #f3faf7; }
.source-card .source-no { color: var(--green-deep); font-size: 10px; font-weight: 750; }
.source-card strong { display: block; margin: 4px 0; font-size: 11px; line-height: 1.4; }
.source-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.source-excerpt { margin-top: 13px; padding: 12px; border-left: 3px solid var(--green); background: var(--green-soft); color: #315f53; font-size: 11px; }

.doc-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 18px; }
.tree, .toc { padding: 16px; }
.tree-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 9px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.tree-item:hover, .tree-item.active { background: var(--green-soft); color: var(--green-deep); }
.tree-item.indent { padding-left: 30px; }
.tree-item .count { margin-left: auto; color: var(--muted); font-size: 10px; }
.document-view { min-height: 720px; padding: 28px 34px; }
.document-view h2 { margin: 0 0 8px; font-size: 23px; line-height: 1.35; }
.doc-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; color: var(--muted); font-size: 11px; }
.paper-body { max-width: 760px; margin: 0 auto; color: #2e4247; line-height: 1.85; }
.paper-body h3 { margin: 28px 0 9px; color: var(--ink); }
.paper-body mark { padding: 1px 3px; background: #dff5e9; color: #185f46; }
.toc a { display: block; padding: 7px 10px; border-left: 2px solid #e3ecea; color: var(--muted); font-size: 11px; }
.toc a.active { border-left-color: var(--green); color: var(--green-deep); background: var(--green-soft); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 7px; bottom: 7px; width: 2px; background: #dbe8e5; }
.timeline-item { position: relative; padding: 0 0 20px 12px; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; border: 3px solid #eaf7f2; border-radius: 50%; background: var(--green); }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item p { margin: 3px 0; color: var(--ink-soft); font-size: 11px; }
.timeline-item small { color: var(--muted); font-size: 10px; }

.chart-bars { height: 210px; display: flex; align-items: flex-end; gap: 10px; padding: 20px 4px 0; border-bottom: 1px solid var(--line); }
.bar { position: relative; flex: 1; min-width: 14px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #28b781, #1a8d72); }
.bar.secondary { background: linear-gradient(180deg, #69cbd0, #2ba3a8); }
.bar::after { content: attr(data-label); position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); color: var(--muted); font-size: 9px; }
.bar:hover::before { content: attr(data-value); position: absolute; left: 50%; top: -27px; transform: translateX(-50%); padding: 3px 6px; border-radius: 6px; color: #fff; background: var(--navy); font-size: 9px; white-space: nowrap; }
.donut { --value: 84%; width: 120px; height: 120px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--value), #e5eeec 0); }
.donut::before { content: attr(data-value); width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--ink); font-size: 22px; font-weight: 750; }
.legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--green); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.field small { color: var(--muted); font-size: 10px; }
.field textarea { min-height: 90px; resize: vertical; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid #edf2f1; }
.switch-row:first-child { border-top: 0; }
.switch-row strong { display: block; font-size: 12px; }
.switch-row small { color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd8d5; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(430px, .92fr);
  background: #eef5f3;
}
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(40px, 6vw, 90px); overflow: hidden; color: #dcefed; background: linear-gradient(145deg, #082932, #0d4048 60%, #0b3438); }
.login-visual::before { content: ""; position: absolute; width: 520px; height: 520px; left: -180px; bottom: -250px; border: 1px solid rgba(101,224,184,.16); border-radius: 50%; box-shadow: 0 0 0 55px rgba(101,224,184,.035), 0 0 0 110px rgba(101,224,184,.02); }
.login-visual::after { content: ""; position: absolute; width: 300px; height: 300px; right: -130px; top: -90px; border-radius: 45% 55% 63% 37%; background: linear-gradient(135deg, rgba(45,201,148,.2), rgba(35,159,171,.05)); transform: rotate(28deg); }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.login-copy { position: relative; z-index: 2; max-width: 630px; }
.login-copy .eyebrow { color: #73e4b8; font-size: 12px; letter-spacing: .18em; }
.login-copy h1 { margin: 18px 0 14px; color: #fff; font-size: clamp(34px, 4vw, 56px); line-height: 1.16; letter-spacing: -.04em; }
.login-copy p { max-width: 550px; color: #a9c9c6; font-size: 15px; }
.feature-strip { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.feature-mini { padding: 15px; border: 1px solid rgba(154,220,203,.15); border-radius: 14px; background: rgba(5,34,40,.33); backdrop-filter: blur(8px); }
.feature-mini strong { display: block; color: #fff; font-size: 18px; }
.feature-mini span { color: #86aaa7; font-size: 10px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #f7faf9; }
.login-card { width: 100%; max-width: 430px; }
.login-card h2 { margin: 0; font-size: 27px; }
.login-card > p { margin: 7px 0 26px; color: var(--muted); }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.login-field input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 11px; outline: 0; background: #fff; }
.login-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,165,111,.09); }
.login-options { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0 20px; color: var(--muted); font-size: 11px; }
.login-submit { width: 100%; height: 45px; }
.demo-accounts { margin-top: 25px; padding-top: 19px; border-top: 1px solid var(--line); }
.demo-accounts > small { color: var(--muted); }
.account-list { display: grid; gap: 8px; margin-top: 10px; }
.account-demo { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.account-demo:hover { border-color: #96cbb9; background: #f5fbf8; }
.account-demo strong { display: block; font-size: 11px; }
.account-demo span { margin-left: auto; color: var(--green-deep); font-size: 10px; }

.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 17px; background: var(--surface-soft); color: var(--green-deep); font-size: 24px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 360px; padding: 12px 15px; border: 1px solid #a8d7c6; border-radius: 12px; color: #165a44; background: #effbf6; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .23s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5,30,35,.48); backdrop-filter: blur(4px); }
.modal-backdrop.open { display: flex; }
.modal { width: min(560px, 100%); padding: 22px; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(5,30,35,.22); }
.modal h3 { margin: 0 0 6px; }
.modal p { color: var(--muted); }
.drop-zone { padding: 28px; border: 1px dashed #91c9b7; border-radius: 14px; background: #f4fbf8; text-align: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

.subtle { color: var(--muted); }
.text-green { color: var(--green-deep); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.mt-18 { margin-top: 18px; }
.mb-18 { margin-bottom: 18px; }
.p-20 { padding: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.wrap { flex-wrap: wrap; }

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 210px minmax(0,1fr); }
  .source-panel { display: none; }
  .doc-grid { grid-template-columns: 230px minmax(0,1fr); }
  .toc { display: none; }
  .hero-stat { position: static; margin-top: 24px; }
}

@media (max-width: 860px) {
  :root { --sidebar: 260px; }
  .sidebar { transform: translateX(-105%); transition: .25s ease; box-shadow: 18px 0 45px rgba(4,29,35,.2); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content:""; position: fixed; inset: 0; z-index: 35; background: rgba(5,30,35,.35); }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 23px 18px 40px; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .chat-layout { height: calc(100vh - 105px); grid-template-columns: 1fr; }
  .chat-history { display: none; }
  .doc-grid { grid-template-columns: 1fr; }
  .tree { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 460px; padding: 36px 28px; }
  .login-panel { padding: 35px 22px; }
}

@media (max-width: 600px) {
  .topbar-title p, .user-chip strong, .user-chip small { display: none; }
  .user-chip { padding-right: 6px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h2 { font-size: 22px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .search-box { width: 100%; min-width: 0; }
  .hero-panel { padding: 24px; }
  .hero-panel h2 { font-size: 24px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-stat { gap: 16px; flex-wrap: wrap; }
  .chat-messages { padding: 18px 12px; }
  .chat-composer { padding: 9px 10px 12px; }
  .message-content { max-width: calc(100% - 42px); }
  .document-view { padding: 22px 18px; }
  .feature-strip { grid-template-columns: 1fr; }
  .login-visual { min-height: 550px; }
  .topbar { gap: 9px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button:first-child { display: none; }
}

/* Unified quotation demo portal link */
.portal-back {
  position: fixed;
  left: 17px;
  bottom: 17px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 11px 6px 7px;
  border: 1px solid rgba(112, 211, 177, .24);
  border-radius: 999px;
  color: #dff9ef;
  background: rgba(6, 40, 47, .94);
  box-shadow: 0 10px 28px rgba(5, 30, 35, .22);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 800;
  transition: .18s ease;
}
.portal-back:hover { color: #fff; border-color: rgba(112,211,177,.48); transform: translateY(-2px); }
.portal-back span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #073b31; background: #63d9ad; font-size: 13px; }
.portal-back em { font-style: normal; }
@media (max-width: 600px) { .portal-back { bottom: 13px; left: 12px; } .portal-back em { display: none; } .portal-back { padding-right: 7px; } }
