:root {
  --bg: #080b10;
  --panel: #10141b;
  --panel2: #131821;
  --line: #222936;
  --muted: #77808e;
  --text: #f3f5f7;
  --green: #78e59b;
  --violet: #8e72ff;
  --pink: #e875b3;
  --gold: #e9c46a;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
}
.ambient-one {
  width: 480px;
  height: 480px;
  background: #765dff;
  right: -180px;
  top: -180px;
}
.ambient-two {
  width: 360px;
  height: 360px;
  background: #30cf84;
  left: 30%;
  bottom: -250px;
}
.app-shell {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 26px 18px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(9, 12, 17, 0.94);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: white;
  padding: 0 8px 30px;
}
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: #8e72ff;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 10px 8px;
  box-shadow: 0 8px 28px #8e72ff44;
}
.brand-mark i {
  display: block;
  width: 5px;
  background: #fff;
  border-radius: 3px;
}
.brand-mark i:nth-child(1) {
  height: 9px;
  opacity: 0.6;
}
.brand-mark i:nth-child(2) {
  height: 19px;
}
.brand-mark i:nth-child(3) {
  height: 14px;
  opacity: 0.8;
}
.brand b {
  font: 700 18px "DM Mono";
}
.brand small {
  display: block;
  color: #777f8d;
  font-size: 10px;
  letter-spacing: 0.13em;
  margin-top: 1px;
}
.nav-label {
  color: #555e6d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin: 17px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #89929f;
  text-decoration: none;
  padding: 11px 13px;
  border-radius: 8px;
  margin: 2px 0;
  transition: 0.2s;
  position: relative;
}
.nav-item span {
  font-size: 17px;
  width: 18px;
  text-align: center;
}
.nav-item:hover {
  background: #141923;
  color: #fff;
}
.nav-item.active {
  background: #1b2030;
  color: #fff;
}
.nav-item.active:before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: var(--violet);
  position: absolute;
  left: -18px;
}
.nav-item.active span {
  color: #9b83ff;
}
.nav-item .badge {
  margin-left: auto;
  background: #2c264d;
  color: #b5a8ff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px var(--green);
}
.sidebar-card {
  margin-top: auto;
  background: linear-gradient(145deg, #171b25, #10141b);
  border: 1px solid #252b38;
  border-radius: 12px;
  padding: 15px;
}
.mini-icon {
  color: #8c75ff;
  font-size: 20px;
  margin-bottom: 7px;
}
.sidebar-card b {
  font-size: 12px;
}
.sidebar-card p {
  font-size: 10px;
  color: #69717e;
  margin: 4px 0 12px;
}
.status-line {
  font: 500 9px "DM Mono";
  color: #86909c;
}
.status-line span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.status-line em {
  float: right;
  font-style: normal;
  color: #4f5865;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  margin: 18px -2px 0;
  padding: 18px 4px 0;
}
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: linear-gradient(135deg, #694cf0, #a975ff);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.sidebar-footer b {
  font-size: 11px;
  display: block;
}
.sidebar-footer small {
  font-size: 9px;
  color: #69727f;
}
.sidebar-footer button {
  margin-left: auto;
  background: none;
  border: 0;
  color: #69717d;
  cursor: pointer;
}
main {
  min-width: 0;
}
.topbar {
  height: 70px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 35px;
  position: sticky;
  top: 0;
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(16px);
  z-index: 8;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.crumb span,
.crumb i {
  color: #616a77;
  font-style: normal;
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  display: flex;
  align-items: center;
  background: #0e1218;
  border: 1px solid #242b36;
  border-radius: 8px;
  height: 36px;
  padding: 0 10px;
  gap: 8px;
  color: #747d89;
}
.search input {
  width: 210px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ddd;
  font: 12px inherit;
}
.search kbd {
  font: 9px "DM Mono";
  color: #69717d;
  border: 1px solid #303744;
  padding: 2px 5px;
  border-radius: 4px;
}
.icon-btn,
.sync-btn {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #272e3a;
  background: #11161d;
  color: #a4acb7;
  cursor: pointer;
  position: relative;
}
.icon-btn {
  width: 37px;
}
.icon-btn i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f07385;
  right: 8px;
  top: 7px;
}
.sync-btn {
  padding: 0 14px;
  background: #f1f3f5;
  color: #12161c;
  font-weight: 700;
}
.sync-btn.loading > span:first-child svg {
  animation: spin 0.6s linear infinite;
  transform-origin: center;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.mobile-menu {
  display: none;
  background: none;
  border: 0;
  color: white;
  font-size: 22px;
  margin-right: 12px;
}
.content {
  padding: 35px;
  max-width: 1600px;
  margin: auto;
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 27px;
}
.eyebrow {
  font: 500 9px "DM Mono";
  letter-spacing: 0.15em;
  color: #626b78;
  margin: 0 0 8px;
}
.hero-row h1 {
  font-size: 27px;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.hero-row h1 span {
  color: #9077ff;
}
.hero-row > div > p:last-child {
  color: #737c89;
  margin: 0;
  font-size: 12px;
}
.hero-row p b {
  color: #d8dce1;
}
.market-clock {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #0e1218;
  border: 1px solid #242b37;
  border-radius: 9px;
  padding: 10px 14px;
}
.market-clock small {
  display: block;
  color: #606a77;
  font-size: 9px;
}
.market-clock b {
  font-size: 11px;
}
.market-clock i {
  height: 28px;
  width: 1px;
  background: #29303c;
  margin: 0 4px;
}
.pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px #78e59b18;
}
.mono {
  font-family: "DM Mono";
}
.metric-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.metric-card {
  position: relative;
  background: linear-gradient(145deg, #121720, #0d1117);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  min-height: 137px;
}
.metric-card.featured {
  background: linear-gradient(130deg, #171d27, #10151d);
}
.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #858e9b;
  font-size: 10px;
}
.metric-head i {
  font-style: normal;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #232936;
  display: grid;
  place-items: center;
  color: #a994ff;
  font-weight: 700;
}
.metric-card h2 {
  font: 500 23px "DM Mono";
  margin: 18px 0 15px;
  letter-spacing: -0.05em;
}
.metric-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  color: #68717e;
  position: relative;
}
.metric-foot b {
  color: var(--green);
  background: #78e59b12;
  padding: 3px 5px;
  border-radius: 4px;
}
.metric-foot.negative b {
  color: #ef7f8e;
  background: #ef7f8e12;
}
.metric-foot svg {
  position: absolute;
  width: 125px;
  height: 39px;
  right: 0;
  bottom: -5px;
  overflow: visible;
}
.metric-foot svg path {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
}
.metric-foot svg .area {
  fill: url(#x);
  opacity: 0.06;
  stroke: none;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.panel {
  background: linear-gradient(145deg, #10151c, #0c1016);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px;
}
.panel-title,
.panel-title > div {
  display: flex;
  align-items: center;
}
.panel-title {
  justify-content: space-between;
  margin-bottom: 15px;
}
.panel-title h3 {
  font-size: 13px;
  margin: 0 8px;
}
.tiny-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #201d35;
  color: #9a83ff;
  display: grid;
  place-items: center;
}
.open-tag {
  font-size: 8px;
  background: #78e59b12;
  color: var(--green);
  padding: 3px 7px;
  border-radius: 10px;
}
.panel-title button,
.panel-title fluent-button {
  background: none;
  border: 0;
  color: #737c88;
  font: 10px inherit;
  cursor: pointer;
}
.panel-title button:hover,
.panel-title fluent-button:hover {
  color: #fff;
}
.company-activity-panel {
  height: 430px;
  display: flex;
  flex-direction: column;
}
.company-activity-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.company-activity-scroll:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}
.company-activity-scroll::-webkit-scrollbar {
  width: 8px;
}
.company-activity-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--line-strong);
  background-clip: padding-box;
}
.tabs {
  border-bottom: 1px solid #222934;
  display: flex;
  gap: 22px;
}
.tabs button {
  background: none;
  border: 0;
  color: #666f7b;
  font: 10px inherit;
  padding: 0 2px 10px;
  cursor: pointer;
}
.tabs button.active {
  color: #fff;
  border-bottom: 2px solid #846cff;
}
.stock-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.65fr 0.65fr 0.45fr;
  align-items: center;
  gap: 8px;
  min-height: 55px;
  border-bottom: 1px solid #1c222c;
  font-size: 10px;
}
.stock-header {
  min-height: 34px;
  color: #515b68;
  font-size: 8px;
}
.stock-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}
.stock-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-style: normal;
  color: #fff;
}
.purple {
  background: #604bd0;
}
.blue {
  background: #3277bd;
}
.orange {
  background: #c5703e;
}
.cyan {
  background: #328e91;
}
.stock-row b {
  font-size: 10px;
}
.stock-row b small {
  display: block;
  font: 7px "DM Mono";
  color: #555e6b;
  margin-top: 2px;
}
.stock-row strong {
  font: 500 10px "DM Mono";
}
.stock-row em {
  font: 500 9px "DM Mono";
  font-style: normal;
}
.up {
  color: var(--green) !important;
}
.down {
  color: #f17d8d !important;
}
.stock-up {
  color: #f17d8d !important;
}
.stock-down {
  color: var(--green) !important;
}
.spark {
  font: 14px "DM Mono";
  letter-spacing: -7px;
  transform: rotate(-8deg);
}
.up-spark {
  color: var(--green);
}
.down-spark {
  color: #e87283;
  transform: rotate(8deg);
}
.trade-btn {
  border: 1px solid #2a3240;
  background: #151b24;
  color: #a3acb8;
  border-radius: 6px;
  font: 9px inherit;
  padding: 6px 9px;
  cursor: pointer;
}
.trade-btn:hover {
  background: #7259e8;
  color: #fff;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick-grid button {
  border: 1px solid #222a36;
  background: #11161e;
  border-radius: 9px;
  color: #e9ebee;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 12px;
  cursor: pointer;
  gap: 10px;
  transition: 0.2s;
}
.quick-grid button:hover {
  transform: translateY(-2px);
  border-color: #45405f;
}
.quick-grid button i {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.gold {
  color: var(--gold) !important;
  background: #e9c46a12 !important;
}
.violet {
  color: #9a83ff !important;
  background: #8e72ff15 !important;
}
.pink {
  color: var(--pink) !important;
  background: #e875b315 !important;
}
.green {
  color: var(--green) !important;
  background: #78e59b12 !important;
}
.quick-grid button b {
  display: block;
  font-size: 10px;
}
.quick-grid button small {
  font-size: 8px;
  color: #5e6773;
}
.quick-grid button em {
  margin-left: auto;
  color: #4f5864;
  font-style: normal;
}
.daily {
  border-top: 1px solid #232a35;
  margin-top: 15px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: conic-gradient(#8b72ff 0 74%, #222833 74%);
  display: grid;
  place-items: center;
  position: relative;
}
.ring:after {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #11161e;
  position: absolute;
}
.ring span {
  font: 500 9px "DM Mono";
  z-index: 1;
}
.daily small {
  color: #66707c;
  font-size: 9px;
}
.daily h4 {
  margin: 3px 0;
  font: 500 18px "DM Mono";
}
.daily h4 span {
  color: #5e6773;
  font-size: 9px;
}
.daily p {
  margin: 0;
  color: #555e6b;
  font-size: 8px;
}
.bottom-grid {
  grid-template-columns: 1.25fr 1fr;
}
.timeline > div {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid #1d232d;
}
.timeline i {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.timeline p {
  font-size: 10px;
  margin: 0;
  line-height: 1.5;
}
.timeline p strong {
  color: var(--gold);
}
.timeline small {
  display: block;
  color: #555f6b;
  font-size: 8px;
}
.relation-stat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.relation-stat > div {
  background: #12171f;
  border: 1px solid #202733;
  padding: 12px;
  border-radius: 8px;
}
.relation-stat span,
.relation-stat small {
  font-size: 8px;
  color: #626c79;
  display: block;
}
.relation-stat b {
  font: 500 20px "DM Mono";
  display: block;
  margin: 6px 0;
}
.relation-bar {
  height: 7px;
  display: flex;
  gap: 3px;
  margin: 18px 0 11px;
}
.relation-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.relation-bar i:nth-child(1) {
  background: #8c71ff;
}
.relation-bar i:nth-child(2) {
  background: #e474b3;
}
.relation-bar i:nth-child(3) {
  background: #53c88c;
}
.legend {
  display: flex;
  gap: 16px;
  color: #69727e;
  font-size: 8px;
}
.legend span i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 5px;
}
.l1 {
  background: #8c71ff;
}
.l2 {
  background: #e474b3;
}
.l3 {
  background: #53c88c;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #46505d;
  font: 8px "DM Mono";
  padding: 14px 3px 0;
}
footer b {
  color: #7662ca;
}
footer i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
dialog {
  border: 1px solid #303847;
  border-radius: 15px;
  background: #12171f;
  color: #fff;
  width: min(420px, calc(100% - 30px));
  padding: 0;
  box-shadow: 0 30px 100px #000;
}
dialog::backdrop {
  background: #020306cc;
  backdrop-filter: blur(5px);
}
dialog form {
  padding: 30px;
  position: relative;
}
.close {
  position: absolute;
  right: 16px;
  top: 13px;
  background: none;
  border: 0;
  color: #717b87;
  font-size: 22px;
  cursor: pointer;
}
.modal-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #211d3a;
  color: #9b84ff;
  border-radius: 11px;
  font-size: 20px;
  margin-bottom: 17px;
}
dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
dialog p:not(.eyebrow) {
  color: #717b87;
  font-size: 11px;
}
dialog label {
  display: block;
  color: #7a8491;
  font-size: 10px;
  margin-top: 22px;
}
dialog input {
  display: block;
  width: 100%;
  margin-top: 7px;
  background: #0b0f14;
  border: 1px solid #29313e;
  border-radius: 8px;
  color: white;
  padding: 11px;
  outline: none;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.modal-actions button {
  border: 1px solid #2d3542;
  background: #171c24;
  color: #9ba4af;
  border-radius: 8px;
  padding: 9px 15px;
  cursor: pointer;
}
.modal-actions .primary {
  background: #8066f0;
  color: white;
  border-color: #8066f0;
}
.toast {
  display: grid;
  pointer-events: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #151b23;
  border: 1px solid #29323f;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.3s;
  z-index: 50;
}
.toast.show { pointer-events: auto; }
.toast.show {
  transform: none;
  opacity: 1;
}
.toast > span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #78e59b18;
  color: var(--green);
  display: grid;
  place-items: center;
}
.toast.toast-error > span {
  background: #ff6b7a18;
  color: #ff8f9c;
}
.toast b {
  display: block;
  font-size: 10px;
}
.toast small {
  font-size: 8px;
  color: #68727e;
}
.hidden {
  display: none !important;
}
.client-actions{overflow:hidden}.action-title small{display:block;margin-top:4px;color:var(--muted);font-size:10px;font-weight:400}.action-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.quick-action-card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:16px;border:1px solid #252d3a;border-radius:12px;background:linear-gradient(145deg,#151a23,#11151c)}.action-card-head{display:flex;align-items:center;gap:10px;margin-bottom:2px}.action-card-head>span{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#252a42;color:#a99cff;font-size:16px;font-weight:800}.action-card-head b,.action-card-head small{display:block}.action-card-head b{font-size:13px}.action-card-head small{margin-top:3px;color:var(--muted);font-size:9px}.quick-action-card label{display:flex;flex:1;flex-direction:column;gap:6px;min-width:0;color:#8e97a5;font-size:10px}.quick-action-card input{width:100%;min-width:0;padding:10px 11px;border:1px solid #303847;border-radius:8px;outline:none;background:#0c1016;color:#fff;transition:.2s}.quick-action-card input:focus{border-color:#7563dc;box-shadow:0 0 0 3px #7563dc1f}.quick-action-card button{min-height:38px;flex:1;padding:9px 12px;border:1px solid #444d66;border-radius:8px;background:#292f46;color:#f5f6fb;font-weight:700;cursor:pointer;transition:.2s}.quick-action-card button:hover{border-color:#7467bb;background:#383f5c;transform:translateY(-1px)}.quick-action-card button:disabled,.quick-action-card button.completed{cursor:not-allowed;opacity:.7;background:#202935;border-color:#334150;color:#8d9ba7;transform:none}.action-fields,.action-buttons{display:flex;gap:8px}.action-fields label:first-child{flex:2}.action-divider{height:1px;background:#252c38;margin:1px 0}.accent-green .action-card-head>span{background:#173225;color:var(--green)}.accent-green button{border-color:#315943;background:#1c3d2b}.accent-violet .action-card-head>span{background:#2a2448;color:#ad9dff}.accent-pink .action-card-head>span{background:#3d2235;color:#ef8dc4}.identity{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;vertical-align:middle}.identity>b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e8ebf0}.npc-badge{flex:0 0 auto;padding:2px 5px;border:1px solid rgba(169,156,255,.32);border-radius:999px;background:rgba(117,99,220,.14);color:#b9adff;font-size:8px;font-weight:800;line-height:1;letter-spacing:.06em}
.page-view {
  display: none;
}
.page-view.active {
  display: block;
  content-visibility: auto;
  contain: layout style paint;
  contain-intrinsic-size: auto 900px;
}

.page-view[aria-busy="true"] {
  min-height: 360px;
  cursor: progress;
}

.page-view[aria-busy="true"]::before {
  content: "正在加载页面数据…";
  display: block;
  margin: 20px 0;
  padding: 18px;
  border-radius: 12px;
  color: var(--muted, #aeb4cd);
  background: rgba(255, 255, 255, 0.035);
}

@media (update: slow), (max-width: 720px) {
  .sidebar,
  .topbar,
  .login-overlay,
  dialog::backdrop {
    backdrop-filter: none !important;
  }

  .ambient,
  .glow {
    display: none !important;
  }
}
.section-heading {
  margin-bottom: 25px;
}
.section-heading h1 {
  font-size: 27px;
  margin: 0 0 8px;
}
.section-heading > p:last-child {
  color: #737c89;
  margin: 0;
  font-size: 12px;
}
.error-banner {
  border: 1px solid #6c3540;
  background: #2a1218;
  color: #ff9caa;
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  line-height: 1.6;
}
.pulse.closed {
  background: #6b7480;
  box-shadow: 0 0 0 5px #6b748018;
}
.stock-row {
  grid-template-columns: 1.6fr 0.8fr 0.7fr 0.7fr auto;
}
.stock-row > span:last-child {
  text-align: left;
}
.timeline > div > strong {
  margin-left: auto;
  font: 500 10px "DM Mono";
  white-space: nowrap;
}
.data-table {
  overflow: auto;
}
.table-line {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(
      120px,
      0.8fr
    );
  align-items: center;
  gap: 12px;
  min-width: 480px;
  min-height: 50px;
  border-bottom: 1px solid #1c222c;
  color: #a8b0bb;
  font-size: 10px;
}
.table-line:last-child {
  border-bottom: 0;
}
.table-head {
  min-height: 34px;
  color: #596370;
  font-size: 8px;
  text-transform: uppercase;
}
.table-line b,
.table-line strong {
  color: #f0f2f5;
  font-weight: 600;
}
.empty-state {
  min-height: 160px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #6c7682;
}
.empty-state b {
  color: #aab2bd;
  font-size: 12px;
  margin-bottom: 7px;
}
.empty-state small {
  font-size: 9px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.setting-card {
  background: #12171f;
  border: 1px solid #202733;
  padding: 16px;
  border-radius: 9px;
  min-width: 0;
}
.setting-card small {
  display: block;
  color: #68727f;
  font-size: 9px;
  margin-bottom: 8px;
}
.setting-card b {
  display: block;
  font: 500 12px "DM Mono";
  overflow-wrap: anywhere;
}
.sync-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.market-trade { margin-top: 12px; }
.market-listing-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.5fr); gap: 16px; }
.listing-create-fields { margin-bottom: 12px; }
.stock-listings-table .table-line { grid-template-columns: 1.1fr .8fr .8fr .8fr 1.25fr; min-width: 720px; }
.stock-listing-actions { display: flex; align-items: center; gap: 7px; }
.stock-listing-actions input { width: 72px; min-height: 34px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: #0a0f16; color: var(--text); }
.stock-listing-actions button { min-height: 34px; padding: 7px 10px; }
@media (max-width: 760px) {
  .market-listing-grid { grid-template-columns: 1fr; }
}
.market-trade .action-fields { max-width: 520px; }
#stockDialog {
  width: min(760px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}
#stockDialog .market-trade {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #29313e;
}
#stockDialog .market-trade .panel-title { margin-bottom: 14px; }
#stockDialog .market-trade .action-fields { max-width: none; }
.stock-detail { white-space: nowrap; }
.stock-chart { height: 220px; margin: 18px 0 8px; padding: 10px; border: 1px solid #252d3a; border-radius: 10px; background: linear-gradient(180deg, #171b2b, #0d121a); }
.stock-chart svg { width: 100%; height: 100%; overflow: visible; }
.stock-chart polyline { fill: none; stroke: #9a83ff; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-range { display: flex; justify-content: space-between; color: #69727e; font: 9px "DM Mono"; margin-top: -22px; position: relative; pointer-events: none; }

.market-index-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.4fr);
  gap: 28px;
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 18%, rgba(126, 105, 238, 0.16), transparent 32%),
    linear-gradient(145deg, #151a24, #10151d);
}
.market-index-copy { display: flex; min-width: 0; flex-direction: column; }
.market-index-copy .panel-title { align-items: flex-start; }
.market-index-copy .panel-title small { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; font-weight: 400; }
.market-limit-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(255, 185, 96, 0.25);
  border-radius: 999px;
  color: #f4bd73;
  background: rgba(244, 167, 64, 0.08);
  font-size: 9px;
  white-space: nowrap;
}
.market-index-quote { display: flex; align-items: baseline; gap: 13px; margin-top: 22px; }
.market-index-quote strong { font: 650 34px "DM Mono", monospace; letter-spacing: -1.5px; }
.market-index-quote span { font: 600 11px "DM Mono", monospace; }
.market-breadth { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; padding-top: 24px; color: var(--subtle); font-size: 10px; }
.market-index-chart { position: relative; min-height: 210px; padding: 4px 6px 24px 32px; }
.stock-events-panel .panel-title small { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; font-weight: 400; }
.stock-events-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin-top: 16px; }
.stock-event-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #29313e; border-radius: 10px; background: #0d1219; }
.stock-event-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: #f4bd73; background: rgba(244, 167, 64, 0.1); }
.stock-event-card b, .stock-event-card small { display: block; }
.stock-event-card b { overflow: hidden; color: #e9edf4; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stock-event-card small { margin-top: 5px; color: var(--subtle); font-size: 8px; }
.stock-event-card strong { font: 650 11px "DM Mono", monospace; }

.trend-svg { width: 100%; height: 100%; overflow: visible; color: #9a83ff; }
.trend-svg.trend-up { color: #f17d8d; }
.trend-svg.trend-down { color: var(--green); }
.trend-grid line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-area { fill: currentColor; opacity: 0.09; }
.trend-line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.stock-chart .trend-line { stroke: currentColor; }
.trend-current { fill: #111721; stroke: currentColor; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.trend-chart-scale {
  position: absolute;
  inset: 10px auto 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #6e7886;
  font: 8px "DM Mono", monospace;
  pointer-events: none;
}
.trend-chart-time { position: absolute; right: 6px; bottom: 2px; left: 32px; display: flex; justify-content: space-between; color: #5f6977; font-size: 8px; }
.stock-chart { position: relative; height: 270px; padding: 16px 12px 28px 54px; }
.stock-dialog-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.stock-dialog-stats > div { min-width: 0; padding: 10px; border: 1px solid #252d3a; border-radius: 9px; background: #0d1219; }
.stock-dialog-stats small, .stock-dialog-stats strong { display: block; }
.stock-dialog-stats small { margin-bottom: 6px; color: var(--subtle); font-size: 8px; }
.stock-dialog-stats strong { overflow: hidden; color: #e9edf4; font: 600 10px "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.chart-disclaimer { margin-top: 12px; color: #697381 !important; font-size: 9px !important; line-height: 1.55; }
.stock-row strong .stock-daily-change { display: block; margin-top: 4px; color: var(--subtle); font: 600 8px "DM Mono", monospace; }

@media (max-width: 900px) {
  .market-index-panel { grid-template-columns: 1fr; gap: 12px; }
  .market-breadth { margin-top: 0; padding-top: 16px; }
  .market-index-chart { min-height: 190px; }
}

@media (max-width: 600px) {
  .market-index-copy .panel-title { gap: 12px; }
  .market-index-quote { margin-top: 15px; }
  .market-index-quote strong { font-size: 28px; }
  .market-index-chart { min-height: 170px; padding-left: 28px; }
  .stock-dialog-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-dialog-stats > div:first-child { grid-column: span 2; }
  .stock-chart { height: 230px; padding-left: 48px; }
}
@media (max-width: 1100px) {
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 205px 1fr;
  }
  .sidebar {
    padding-left: 13px;
    padding-right: 13px;
  }
  .content {
    padding: 25px;
  }
  .search input {
    width: 150px;
  }
}
@media (max-width: 760px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .section-heading h1 {
    font-size: 23px;
  }
  .table-line {
    min-width: 560px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: 0.25s;
    width: 238px;
  }
  .sidebar.open {
    transform: none;
  }
  .mobile-menu {
    display: block;
  }
  .topbar {
    padding: 0 15px;
  }
  .crumb {
    display: none;
  }
  .search {
    display: none;
  }
  .content {
    padding: 22px 15px;
  }
  .hero-row {
    display: block;
  }
  .market-clock {
    margin-top: 18px;
    width: max-content;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .stock-row {
    grid-template-columns: 1.4fr 0.7fr 0.65fr auto;
  }
  .stock-row > *:nth-child(4) {
    display: none;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .relation-stat {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .relation-stat > div {
    padding: 9px;
  }
  .relation-stat b {
    font-size: 15px;
  }
  footer {
    display: block;
    line-height: 2;
  }
  .hero-row h1 {
    font-size: 23px;
  }
}
  .login-overlay{position:fixed;inset:0;background:rgba(9,12,25,.82);backdrop-filter:blur(12px);display:grid;place-items:center;z-index:20}.login-overlay.hidden{display:none}.login-card{width:min(490px,calc(100% - 32px));max-height:calc(100vh - 32px);overflow:auto;padding:32px;border:1px solid rgba(255,255,255,.14);border-radius:24px;background:#171a2b;color:#fff;box-shadow:0 24px 80px rgba(0,0,0,.35)}.login-card h2{margin:18px 0 6px}.login-card p{color:#aeb4cd;margin:0 0 20px}.login-card label,.login-card input,.login-card textarea{display:block;width:100%}.login-card label{font-size:12px;color:#aeb4cd;margin:12px 0}.login-card input,.login-card textarea{box-sizing:border-box;margin-top:7px;padding:11px 12px;border-radius:10px;border:1px solid #373c5a;background:#0f1220;color:#fff;outline:none}.login-card textarea{resize:vertical;min-height:108px;line-height:1.55}.login-card input:focus,.login-card textarea:focus{border-color:#8c7cff;box-shadow:0 0 0 3px #8c7cff20}.login-fields-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.login-divider{display:flex;align-items:center;gap:10px;color:#666e84;font-size:10px}.login-divider:before,.login-divider:after{content:"";height:1px;flex:1;background:#30354b}.login-parse-status{margin:-2px 0 10px!important;color:#ffb36b!important}.login-parse-status.success{color:var(--green)!important}.login-card .login-remember{display:flex;width:max-content;align-items:center;gap:9px;margin:14px 0 16px;cursor:pointer;color:#c6cadb}.login-card .login-remember input{width:16px;height:16px;flex:0 0 16px;margin:0;padding:0;accent-color:#8c7cff}.login-card .login-remember span{line-height:1.4}.login-card button,.primary{width:100%;padding:11px;border:0;border-radius:10px;background:#8c7cff;color:#fff;font-weight:700;cursor:pointer}.login-card small{display:block;color:#ff8f9c;min-height:18px;margin-top:10px}.logout-btn{margin:0 20px 14px;padding:7px 10px;border:1px solid #3c4160;border-radius:8px;background:transparent;color:#b9bed7;cursor:pointer}.edit-member{margin-left:10px;padding:4px 8px;border:1px solid #4f5275;border-radius:6px;background:transparent;color:#a9a2ff;cursor:pointer}dialog{border:0;border-radius:18px;background:#191c2e;color:#fff;padding:24px;min-width:300px}dialog::backdrop{background:rgba(0,0,0,.55)}#memberForm label,#memberForm input{display:block;width:100%}#memberForm label{margin:12px 0;color:#b8bdd7}#memberForm input{box-sizing:border-box;margin-top:6px;padding:9px;border-radius:8px;border:1px solid #3e4466;background:#101323;color:#fff}#memberForm div{display:flex;gap:10px;margin-top:18px}#memberForm button{flex:1;padding:9px;border:1px solid #444a6d;border-radius:8px;background:transparent;color:#fff;cursor:pointer}@media(max-width:520px){.login-fields-row{grid-template-columns:1fr}.login-card{padding:25px}}

/* Custom GUI Component Styles */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.action-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.action-card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(142, 114, 255, 0.15);
}

.action-card .card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}

.action-card .card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.action-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

/* Shop quantity controls use the same dark field treatment as the rest of the UI. */
.action-card .card-footer label {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.action-card .card-footer input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 8px;
  background: #0a0f16;
  color: var(--text);
  outline: none;
}

.action-card .card-footer input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(141, 124, 246, 0.1);
}

.action-card .card-footer .primary-btn {
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 42px;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.tag.gold { background: rgba(233, 196, 106, 0.15); color: var(--gold); }
.tag.blue { background: rgba(120, 229, 155, 0.15); color: var(--green); }
.tag.green { background: rgba(48, 207, 132, 0.15); color: #30cf84; }
.tag.pink { background: rgba(232, 117, 179, 0.15); color: var(--pink); }

.sign-banner-box {
  background: linear-gradient(135deg, rgba(142, 114, 255, 0.15), rgba(48, 207, 132, 0.1));
  border: 1px solid rgba(142, 114, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sign-banner-box h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}

.sign-banner-box p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.balance-display {
  display: flex;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.balance-display div small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.balance-display div b {
  font-size: 16px;
  color: var(--green);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.form-group input, .form-group select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--violet);
}

.info-box {
  background: rgba(142, 114, 255, 0.08);
  border: 1px dashed rgba(142, 114, 255, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #b5a8ff;
}

.form-tip {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.action-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-buttons-compact {
  display: flex;
  gap: 6px;
}

.primary-btn {
  background: var(--violet);
  color: white;
  border: 0;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.primary-btn:hover {
  background: #7a5cff;
  box-shadow: 0 4px 14px rgba(142, 114, 255, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.danger-btn {
  background: rgba(232, 117, 179, 0.15);
  color: var(--pink);
  border: 1px solid rgba(232, 117, 179, 0.3);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.danger-btn:hover {
  background: rgba(232, 117, 179, 0.3);
}

.alert-box {
  background: rgba(233, 196, 106, 0.1);
  border: 1px solid rgba(233, 196, 106, 0.3);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gold);
}

.cert-card-gold {
  border-color: rgba(233, 196, 106, 0.4);
  background: linear-gradient(145deg, #17171e, #13141b);
}

.cert-frame {
  background: linear-gradient(135deg, #1d182b, #12101d);
  border: 3px double var(--gold);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: #fff;
  position: relative;
}

.cert-title {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.cert-frame h2 {
  font-size: 24px;
  color: var(--gold);
  margin: 0 0 16px;
}

.cert-body p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.cert-seal {
  margin-top: 20px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--gold);
  border: 1px solid var(--gold);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
}

/* ========================================================================== 
   UI refresh 2026-07 — tokens, interaction states and responsive shell
   ========================================================================== */
:root {
  --bg: #070a10;
  --panel: #0f141d;
  --panel2: #141b26;
  --panel3: #192230;
  --line: #273142;
  --line-strong: #364257;
  --muted: #9aa5b5;
  --subtle: #737f91;
  --text: #f4f7fb;
  --green: #52d998;
  --violet: #8d7cf6;
  --violet-strong: #7966ed;
  --pink: #ff7ba5;
  --gold: #efca74;
  --danger: #ff7184;
  --warning: #f2bd5a;
  --focus: #b8adff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-float: 0 18px 55px rgba(0, 0, 0, 0.34);
}

html { scroll-padding-top: 84px; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 82% -10%, rgba(121, 102, 237, 0.11), transparent 34rem),
    radial-gradient(circle at 25% 110%, rgba(82, 217, 152, 0.06), transparent 32rem),
    var(--bg);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 76%, transparent);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: 0.58; transform: none !important; box-shadow: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ambient { opacity: 0.045; }
.app-shell { grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  padding: 22px 14px 16px;
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(8, 11, 17, 0.93);
  backdrop-filter: blur(18px);
}
.brand { padding: 2px 10px 20px; }
.brand-mark { border-radius: 11px; box-shadow: 0 9px 30px rgba(141, 124, 246, 0.26); }
.sidebar nav {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar-card,
.sidebar-footer { flex-shrink: 0; }
.nav-label { margin: 16px 12px 6px; color: #697487; letter-spacing: 0.12em; }
.nav-item {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  color: #a3adbc;
  border-radius: 10px;
}
.nav-item > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #7f8a9a;
}
.nav-item svg, .mobile-menu svg, .sync-btn svg, .mobile-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover { border-color: rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.04); }
.nav-item.active {
  border-color: rgba(141, 124, 246, 0.23);
  background: linear-gradient(90deg, rgba(141, 124, 246, 0.17), rgba(141, 124, 246, 0.055));
}
.nav-item.active::before { left: -15px; width: 3px; border-radius: 0 4px 4px 0; }
.nav-item.active > span { background: rgba(141, 124, 246, 0.14); color: #b7aaff; }
.nav-item .badge { min-width: 20px; text-align: center; }
.sidebar-card { margin: 14px 6px 12px; border-color: rgba(255, 255, 255, 0.075); }
.sidebar-footer { padding: 13px 8px 0; gap: 10px; }
.sidebar-footer > div:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-footer b, .sidebar-footer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { margin: 0; min-width: 46px; }
.sidebar-backdrop { display: none; }

main { min-width: 0; }
.topbar {
  height: 70px;
  padding: 0 30px;
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(7, 10, 16, 0.78);
  backdrop-filter: blur(16px);
}
.crumb b { color: #e8ecf3; }
.search { border-color: var(--line); background: rgba(255, 255, 255, 0.025); }
.search:focus-within { border-color: rgba(141, 124, 246, 0.7); box-shadow: 0 0 0 3px rgba(141, 124, 246, 0.1); }
.search input { color: var(--text); }
.sync-btn {
  min-height: 40px;
  border: 1px solid rgba(141, 124, 246, 0.28);
  background: rgba(141, 124, 246, 0.12);
  color: #c7beff;
}
.sync-btn:hover { background: rgba(141, 124, 246, 0.2); color: #fff; }
.sync-btn span { display: inline-grid; place-items: center; }
.mobile-menu { width: 42px; height: 42px; place-items: center; border-radius: 10px; }

.content { width: min(100%, 1500px); margin: 0 auto; padding: 34px clamp(22px, 3vw, 46px) 28px; }
.page-view.active { animation: page-in 180ms ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.hero-row { align-items: end; margin-bottom: 24px; }
.hero-row h1 { margin: 6px 0 6px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.035em; }
.hero-row h1 span { color: #b8adff; }
.hero-row > div > p:last-child, .section-heading > p:last-child { color: var(--muted); font-size: 13px; }
.eyebrow { color: #9f90ff; letter-spacing: 0.13em; }
.market-clock { border-color: var(--line); background: rgba(15, 20, 29, 0.76); }

.metric-grid { gap: 14px; margin-bottom: 18px; }
.metric-card {
  min-height: 142px;
  padding: 19px;
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(20, 27, 38, 0.94), rgba(13, 18, 26, 0.94));
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -35px;
  bottom: -45px;
  border-radius: 50%;
  background: rgba(141, 124, 246, 0.08);
}
.metric-card.featured { border-color: rgba(141, 124, 246, 0.38); }
.metric-head { color: #aeb7c5; }
.metric-head i { border: 1px solid rgba(141, 124, 246, 0.18); background: rgba(141, 124, 246, 0.11); }
.metric-card h2 { margin: 16px 0 9px; font-size: clamp(21px, 2vw, 29px); font-variant-numeric: tabular-nums; }
.metric-foot { color: var(--subtle); }

.daily-panel { margin-bottom: 16px; padding: 0; overflow: hidden; }
.daily-panel .panel-title { display: none; }
.sign-banner-box { min-height: 88px; padding: 20px 22px; border: 0; border-radius: inherit; }
.sign-banner-box .primary-btn { min-width: 120px; }
.quick-launch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-launch button,
.quick-launch fluent-button {
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 20, 29, 0.8);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}
.quick-launch button:hover,
.quick-launch fluent-button:hover { border-color: rgba(141, 124, 246, 0.48); background: var(--panel2); transform: translateY(-2px); }
.quick-launch button > span,
.quick-launch fluent-button > span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(141, 124, 246, 0.13); color: #b8adff; font-weight: 800; }
.quick-launch b { align-self: end; font-size: 13px; }
.quick-launch small { align-self: start; color: var(--subtle); font-size: 10px; }

.section-heading { margin-bottom: 24px; }
.section-heading h1 { margin: 6px 0 7px; font-size: clamp(24px, 2.5vw, 32px); letter-spacing: -0.025em; }
.dashboard-grid { gap: 16px; }
.section-gap { margin-bottom: 24px; }
.block-danger { width: 100%; margin-top: 8px; }
.form-group-inline { flex-direction: row; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.form-group-inline label { flex: 1; }
.form-group-inline > button { width: auto; flex: 0 0 auto; }
.control-row { display: flex; gap: 8px; }
.control-row > :first-child { flex: 1; min-width: 0; }
.modal-actions-spaced { margin-top: 16px; }
.modal-form-group { margin-top: 12px; }
.panel { min-width: 0; border-color: var(--line); border-radius: var(--radius-lg); background: rgba(15, 20, 29, 0.86); }
.panel-title { min-height: 34px; }
.panel-title h3 { letter-spacing: -0.01em; }
.tiny-icon { border: 1px solid rgba(141, 124, 246, 0.16); background: rgba(141, 124, 246, 0.1); }
.cards-grid { gap: 14px; }
.action-card { border-color: var(--line); background: linear-gradient(145deg, var(--panel2), var(--panel)); }
.action-card:hover { border-color: rgba(141, 124, 246, 0.48); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); }
.action-card .card-desc { color: var(--muted); }
.price { font-variant-numeric: tabular-nums; }
.shop-qty { width: 68px; }

.form-group input, .form-group select, .action-fields input, .action-fields select, dialog input, dialog select {
  min-height: 42px;
  border-color: var(--line-strong);
  background: #0a0f16;
}
.action-fields label { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; }
.action-fields input, .action-fields select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); outline: none; }
.form-group input:hover, .form-group select:hover, .action-fields input:hover, .action-fields select:hover { border-color: #47546a; }
.form-group input:focus, .form-group select:focus, .action-fields input:focus, .action-fields select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(141, 124, 246, 0.1);
}
.balance-display { flex-wrap: wrap; background: #0a0f16; }
.amount-shortcuts { display: flex; gap: 8px; margin-top: -4px; }
.amount-shortcuts button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: #aaa1f4;
  font-size: 10px;
  cursor: pointer;
}
.amount-shortcuts button:hover { border-color: rgba(141, 124, 246, 0.45); background: rgba(141, 124, 246, 0.08); }
.field-feedback { min-height: 18px; margin: -4px 0 0; color: var(--subtle); font-size: 10px; }
.calculation-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a0f16;
  color: var(--subtle);
  font-size: 11px;
}
.calculation-box b { margin-left: 5px; color: #dfe4ed; font-variant-numeric: tabular-nums; }
.market-trade .calculation-box { max-width: 520px; margin: 12px 0; }
.primary-btn, .secondary-btn, .danger-btn, .trade-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.primary-btn { background: var(--violet-strong); }
.primary-btn:hover { background: #8875f5; }
.danger-btn { color: #ff9aaa; border-color: rgba(255, 113, 132, 0.34); background: rgba(255, 113, 132, 0.11); }
.danger-btn:hover { color: #fff; background: rgba(255, 113, 132, 0.25); }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.data-table { border: 1px solid var(--line); border-radius: var(--radius-md); }
.table-line { min-height: 52px; padding: 10px 12px; }
.table-head { position: sticky; top: 0; z-index: 1; background: #111721; color: #8f9aab; }
.empty-state { min-height: 150px; display: grid; place-content: center; text-align: center; }
.alert-box { border-color: rgba(242, 189, 90, 0.28); background: rgba(242, 189, 90, 0.075); }
.alert-item { gap: 12px; flex-wrap: wrap; color: #f3cf86; }

dialog {
  width: min(520px, calc(100% - 28px));
  max-width: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #121823;
  box-shadow: var(--shadow-float);
}
dialog::backdrop { background: rgba(2, 4, 8, 0.74); backdrop-filter: blur(5px); }
.modal-icon.danger { background: rgba(255, 113, 132, 0.12); color: var(--danger); }
.confirm-summary { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #0a0f16; color: var(--muted); }
.modal-actions button { min-height: 42px; }
.confirm-summary { white-space: pre-line; max-height: 240px; overflow: auto; }
#adminDeleteUserSelect { min-height: 150px; }

.toast {
  width: min(390px, calc(100% - 28px));
  display: grid;
  min-height: 70px;
  right: 20px;
  bottom: 20px;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.toast.toast-warning > span { background: rgba(242, 189, 90, 0.12); color: var(--warning); }
.toast-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.toast-close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.mobile-nav { display: none; }
.login-overlay { z-index: 100; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .quick-launch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.menu-open { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar {
    width: min(292px, calc(100vw - 54px));
    padding-top: 18px;
    z-index: 40;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.35);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.57);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  body.menu-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .topbar { height: 62px; padding: 0 14px; }
  .mobile-menu { display: grid; }
  .sync-btn { min-width: 42px; padding: 0 11px; }
  .sync-label { display: none !important; }
  .content { padding: 24px 14px 18px; }
  .hero-row { margin-bottom: 20px; }
  .market-clock { width: 100%; justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 126px; padding: 15px; }
  .metric-card h2 { margin-top: 13px; font-size: clamp(18px, 5vw, 23px); overflow-wrap: anywhere; }
  .metric-head i { width: 29px; height: 29px; }
  .sign-banner-box { align-items: stretch; gap: 16px; flex-direction: column; }
  .sign-banner-box .primary-btn { width: 100%; min-height: 46px; }
  .quick-launch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-launch button,
  .quick-launch fluent-button { min-height: 74px; padding: 12px; }
  .panel { padding: 16px; border-radius: 14px; }
  .company-activity-panel { height: 400px; }
  .panel-title { align-items: flex-start; gap: 10px; }
  .cards-grid { grid-template-columns: 1fr; }
  .action-buttons { flex-direction: column; }
  .action-buttons > button { width: 100%; }
  .form-group-inline { flex-direction: column; align-items: stretch; }
  .form-group-inline label, .form-group-inline > button { width: 100%; }
  .action-fields { flex-direction: column; }
  .table-line { min-width: 520px; }
  .data-table .table-head { display: none; }
  .data-table .table-line:not(.table-head) {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 10px;
    padding: 4px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(20, 27, 38, 0.66);
  }
  .data-table .table-line:not(.table-head) > span {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    overflow-wrap: anywhere;
  }
  .data-table .table-line:not(.table-head) > span:last-child { border-bottom: 0; }
  .data-table .table-line:not(.table-head) > span::before {
    content: attr(data-label);
    color: var(--subtle);
    font-size: 10px;
    font-weight: 600;
  }
  .stock-row { min-width: 610px; grid-template-columns: 1.3fr 0.8fr 0.7fr 0.8fr auto; }
  .stock-row > *:nth-child(4) { display: initial; }
  .stock-table { overflow-x: auto; scrollbar-width: thin; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    height: 62px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 17px;
    background: rgba(15, 20, 29, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.38);
  }
  .mobile-nav a,
  .mobile-nav button,
  .mobile-nav fluent-button {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #8390a2;
    font-size: 9px;
    text-decoration: none;
  }
  .mobile-nav a.active { background: rgba(141, 124, 246, 0.13); color: #c2b8ff; }
  .mobile-nav svg { width: 20px; height: 20px; }
  .toast { left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); width: auto; }
  footer { margin-bottom: 12px; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-width: 0; }
  .metric-foot { font-size: 9px; }
  .quick-launch { grid-template-columns: 1fr 1fr; }
  .quick-launch button,
  .quick-launch fluent-button { grid-template-columns: 34px 1fr; }
.quick-launch button > span,
.quick-launch fluent-button > span { width: 34px; height: 34px; }
  .balance-display { gap: 14px; }
  .balance-display > div { flex: 1 1 120px; }
  dialog { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.profile-name-panel {
  margin-bottom: 20px;
}

.profile-name-form > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.profile-name-form .control-row {
  align-items: stretch;
}

.profile-name-form input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--radius-sm);
  background: #0a0f16;
  color: var(--text);
  outline: none;
}

.profile-name-form input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(141, 124, 246, 0.1);
}

.profile-name-form > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.inline-action {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.inline-action input {
  min-width: 7rem;
  flex: 1 1 7rem;
}

.inline-action button {
  white-space: nowrap;
}
