/* YunXuanTong enterprise UI system — derived from the supplied B-end references */
:root {
  --ui-bg: #f3f7fd;
  --ui-bg-soft: #f7f9fc;
  --ui-surface: rgba(255, 255, 255, .96);
  --ui-surface-soft: #f8faff;
  --ui-line: #e3eaf4;
  --ui-line-strong: #d6e0ee;
  --ui-text: #17243d;
  --ui-text-2: #46556f;
  --ui-muted: #8491a7;
  --ui-blue: #2e6eea;
  --ui-blue-2: #5b86f7;
  --ui-blue-soft: #eaf2ff;
  --ui-cyan: #2aa6c8;
  --ui-teal: #3aa58c;
  --ui-violet: #7b76c9;
  --ui-amber: #c99345;
  --ui-red: #d76a72;
  --ui-shadow: 0 10px 30px rgba(45, 79, 130, .07);
  --ui-shadow-hover: 0 16px 40px rgba(45, 79, 130, .12);
  --ui-radius: 16px;
  --ui-radius-sm: 11px;
}

* { box-sizing: border-box; }
html { background: var(--ui-bg); }
body {
  color: var(--ui-text);
  background:
    radial-gradient(circle at 78% 4%, rgba(83, 137, 247, .11), transparent 27rem),
    linear-gradient(180deg, #f8faff 0, var(--ui-bg) 34rem, #f5f8fc 100%);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: .005em;
}
button, input, select, textarea { font: inherit; }
button { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }
button:hover:not(:disabled) { transform: translateY(-1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(46, 110, 234, .18) !important;
  outline-offset: 1px;
}

/* Application frame */
.app-shell { grid-template-columns: 216px minmax(0, 1fr) !important; min-height: 100vh; }
.sidebar {
  width: 216px !important;
  background: rgba(255, 255, 255, .96) !important;
  border-right: 1px solid var(--ui-line) !important;
  box-shadow: 10px 0 30px rgba(50, 79, 120, .025);
  padding: 0 14px 16px !important;
  backdrop-filter: blur(18px);
}
.brand {
  height: 58px;
  gap: 10px !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  letter-spacing: -.03em;
  color: #15233c;
}
.brand-mark {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center;
  color: transparent !important;
  position: relative;
  background: linear-gradient(145deg, #2868df, #55a0ff) !important;
  box-shadow: 0 7px 16px rgba(46, 110, 234, .25);
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.brand-mark::after { width: 6px; height: 6px; border-width: 1.5px; }
.brand-sub {
  margin: -4px 6px 17px !important;
  color: var(--ui-muted) !important;
  font-size: 10px !important;
  letter-spacing: .06em;
}
.sidebar nav { display: grid; gap: 5px; }
.nav-item {
  min-height: 43px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  color: #526078 !important;
  font-weight: 500 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.nav-item > span {
  width: 25px;
  color: #7d8ba1;
  font-size: 15px;
  text-align: center;
}
.nav-item:hover:not(.active) { background: #f2f6fc !important; color: #263650 !important; }
.nav-item.active {
  color: #fff !important;
  background: linear-gradient(135deg, #2767de, #4f86f5) !important;
  box-shadow: 0 8px 20px rgba(46, 110, 234, .22) !important;
  border-color: transparent !important;
}
.nav-item.active > span { color: #fff; }
.sidebar-bottom { bottom: 14px !important; left: 14px !important; right: 14px !important; }
.support {
  border: 1px solid #e8eef7;
  background: linear-gradient(145deg, #f8fbff, #f0f5fc) !important;
  border-radius: 10px !important;
  color: #6c7a90 !important;
}

.main { min-width: 0; background: transparent !important; }
.topbar {
  height: 58px !important;
  padding: 0 28px !important;
  background: rgba(255, 255, 255, .82) !important;
  border-bottom: 1px solid var(--ui-line) !important;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 60;
}
.topbar .crumb { font-weight: 600; color: #30405a; }
.status-dot { background: #42b697 !important; box-shadow: 0 0 0 4px rgba(66, 182, 151, .1); }
.top-actions { gap: 9px !important; }
.city, .bell { border-radius: 9px !important; color: #59687f !important; }
.avatar {
  width: 30px !important;
  height: 30px !important;
  background: linear-gradient(145deg, #eaf2ff, #dce9fc) !important;
  color: #315f9e !important;
  font-size: 12px !important;
}
.user b { color: #2b3952; }
.user small { color: #8a96a8; }

/* Shared page language */
.view { animation: uiFade .24s ease both; }
@keyframes uiFade { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.section-page, .agent-page, .agent-dashboard-page {
  padding: 30px 36px 54px !important;
  max-width: 1500px;
  margin: 0 auto;
}
.page-heading, .hero-title {
  position: relative;
  z-index: 1;
  margin-bottom: 22px !important;
}
.page-heading {
  min-height: 126px;
  padding: 23px 26px !important;
  border: 1px solid #e4ebf6;
  border-radius: 18px;
  background:
    radial-gradient(circle at 93% 20%, rgba(84, 142, 249, .15), transparent 13rem),
    linear-gradient(120deg, rgba(255,255,255,.98), rgba(241,247,255,.96));
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(55, 86, 131, .055);
}
.page-heading::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -50px;
  top: -92px;
  background: linear-gradient(145deg, rgba(77, 132, 244, .11), rgba(114, 194, 231, .04));
  pointer-events: none;
}
.page-heading h1, .hero-title h1, .dash-title h1 { color: #17243d !important; letter-spacing: -.035em; }
.page-heading h1 { font-size: 27px !important; margin: 4px 0 8px !important; }
.page-heading p, .hero-title p, .dash-title p { color: #738197 !important; line-height: 1.7; }
.eyebrow {
  color: var(--ui-blue) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .11em !important;
  text-transform: uppercase;
}
.card, .research-panel, .research-list article, .empty-state, .agent-analysis-nav, .agent-dashboard-content {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important;
  box-shadow: var(--ui-shadow) !important;
}
.card:hover { border-color: #d7e2f1; }
.section-title h2, .card-heading h2 { color: #23324b !important; letter-spacing: -.02em; }
.section-title button, .text-button { color: var(--ui-blue) !important; }
.pill, .source-chip, .live-badge, .settings-badge, .save-state {
  border-radius: 999px !important;
  border: 1px solid #dce8f9 !important;
  background: #eff5fd !important;
  color: #557092 !important;
  font-weight: 600 !important;
}
.pill.blue, .settings-badge { background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; }
.primary {
  color: #fff !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #2869e3, #4c87f6) !important;
  box-shadow: 0 8px 20px rgba(46, 110, 234, .20) !important;
}
.primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(46, 110, 234, .27) !important; }
.outline {
  border: 1px solid #d9e3f0 !important;
  color: #416793 !important;
  background: #fff !important;
  border-radius: 9px !important;
}
.outline:hover:not(:disabled) { border-color: #a9c5ee !important; background: #f6f9ff !important; }
input, select, textarea {
  min-height: 36px;
  border: 1px solid #dce4ef !important;
  border-radius: 9px !important;
  background: #fbfcfe !important;
  color: #33425a !important;
}
input:hover, select:hover, textarea:hover { border-color: #b9cbea !important; }
input:focus, select:focus, textarea:focus { background: #fff !important; border-color: #7da5ea !important; }

/* Dashboard */
#dashboard {
  padding: 18px 28px 42px !important;
  max-width: 1500px;
  margin: 0 auto;
  min-height: calc(100vh - 58px);
  position: relative;
}
#dashboard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 470px;
  background:
    radial-gradient(circle at 68% 12%, rgba(72, 133, 243, .12), transparent 21rem),
    linear-gradient(180deg, rgba(239,245,255,.65), transparent);
  pointer-events: none;
}
.hero-title { min-height: 56px; align-items: center !important; }
.hero-title h1 { font-size: 23px !important; }
.hero-title .date { color: #98a3b3 !important; }
.top-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(355px, .96fr) minmax(430px, 1.34fr) minmax(260px, .76fr) !important;
  gap: 14px !important;
  align-items: stretch;
}
.requirement-card, .city-map, .recommendations { min-height: 342px; }
.requirement-card { padding: 18px !important; }
.requirement-card::before {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ui-blue), #6fa9fa);
  margin-bottom: 12px;
}
.card-heading p { color: #8a96a7 !important; }
.form-grid { column-gap: 12px !important; row-gap: 9px !important; }
.form-grid label, .other-requirement { color: #6e7b90 !important; font-size: 11px !important; }
.segmented { background: #eef3fa !important; border-radius: 9px !important; padding: 2px; }
.segmented button { border-radius: 7px !important; color: #778399 !important; }
.segmented button.chosen { background: #fff !important; color: var(--ui-blue) !important; box-shadow: 0 2px 8px rgba(46, 82, 126, .11) !important; }
.tag { border: 1px solid transparent !important; background: #f0f4fa !important; color: #7f8a9d !important; border-radius: 7px !important; }
.tag.on { background: #e8f1ff !important; border-color: #d2e2fb !important; color: #3c72bd !important; }
.fourth-space {
  border: 1px solid #e4e0cf !important;
  background: linear-gradient(115deg, #fbfaf4, #fffdf8) !important;
  border-radius: 11px !important;
}
.fourth-space b { color: #7a6539 !important; }
.research-button { min-height: 42px !important; letter-spacing: .02em; }
.city-map { padding: 14px !important; overflow: hidden; }
.map-head { height: 30px; color: #31435f; }
.fake-map { border-radius: 11px !important; overflow: hidden; border: 1px solid #e5edf6; }
.fake-map.heat { background-color: #eef4ef !important; filter: saturate(.82) contrast(.97); }
.recommendations { padding: 16px !important; }
.recommendation {
  border: 1px solid #e7edf6 !important;
  background: #fbfcfe !important;
  border-radius: 10px !important;
  padding: 12px !important;
  margin-bottom: 9px !important;
}
.recommendation:hover { border-color: #cfdcf0 !important; box-shadow: 0 8px 18px rgba(45, 79, 130, .07); }
.score-line { height: 4px !important; background: #e9eef5 !important; }
.score-line i { background: linear-gradient(90deg, #3c9cb0, #6f8fba) !important; }

/* Research workflow */
#research .page-heading { margin-bottom: 16px !important; }
#researchMount { min-height: 0 !important; }
#research .research-panel {
  padding: 20px !important;
  min-height: 520px;
  background:
    linear-gradient(180deg, #fff 0, #fff 72%, #f9fbff 100%) !important;
}
.panel-title { padding-bottom: 16px !important; border-bottom: 1px solid #edf1f6; }
.step-badge {
  background: linear-gradient(145deg, #2e6eea, #5493fa) !important;
  box-shadow: 0 6px 14px rgba(46, 110, 234, .18);
}
.pipeline { padding: 22px 12px 24px !important; }
.pipeline-step b { border: 5px solid #f0f5fc !important; background: #e5edf7 !important; color: #71829a !important; }
.pipeline-step.done b { background: var(--ui-blue) !important; color: #fff !important; box-shadow: 0 0 0 5px #e8f1ff; }
.pipeline .line { background: #e5ebf4 !important; }
.agent-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.agent-card {
  min-width: 0;
  min-height: 264px;
  padding: 15px !important;
  border: 1px solid #e4eaf3 !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: hidden;
}
.agent-card .agent-head > div, .agent-card .tools, .agent-card .points { min-width: 0; max-width: 100%; }
.agent-card .tools > b {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card .points p { max-width: 100%; }
.agent-card:hover { border-color: #c9d7eb !important; transform: translateY(-2px); box-shadow: var(--ui-shadow) !important; }
.agent-icon { box-shadow: 0 5px 12px rgba(46, 80, 120, .12); }
.agent-card small, .agent-card p { color: #7c899d !important; }
.progress { height: 4px !important; background: #eef2f7 !important; }
.progress i { background: linear-gradient(90deg, #48a995, #75baa9) !important; }
.agent-detail { border-radius: 8px !important; background: #f2f6fc !important; color: #49719e !important; }
.task-bar { border-radius: 10px !important; background: #f5f8fc !important; color: #7b889b !important; }

/* Map workspace */
#map .page-heading { margin-bottom: 16px !important; }
#mapMount .map-explorer { padding: 14px !important; }
#mapMount .section-title { min-height: 44px; }
.map-tabs { padding: 3px; border-radius: 10px; background: #eef3f9; }
.map-tabs button { min-height: 34px; border-radius: 8px !important; color: #6e7d92 !important; }
.map-tabs button.active { color: #fff !important; background: linear-gradient(135deg, #2d6de8, #568af3) !important; box-shadow: 0 5px 13px rgba(46, 110, 234, .18); }
.explore-map { min-height: 600px !important; border-radius: 13px !important; }
.layer-box, .score-pop {
  border: 1px solid rgba(220, 229, 240, .9) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 30px rgba(41, 68, 105, .13) !important;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.92) !important;
}
.layer-box label { min-height: 30px; color: #58677e !important; }

/* Data and decision */
#data { max-width: 1500px; }
.decision-journey {
  border: 1px solid var(--ui-line) !important;
  border-radius: 16px !important;
  box-shadow: var(--ui-shadow) !important;
  background: rgba(255,255,255,.96) !important;
  padding: 17px 22px !important;
}
.decision-journey > div b { border-radius: 9px !important; background: #edf2f8 !important; color: #6e7c92 !important; }
.decision-journey > div.done b, .decision-journey > div.current b { background: var(--ui-blue) !important; color: #fff !important; }
.decision-journey > i { background: #e7edf5 !important; }
.decision-hero {
  border: 1px solid #dce7f7 !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 92% 30%, rgba(100, 164, 255, .18), transparent 15rem),
    linear-gradient(120deg, #fafdff, #eef5ff) !important;
  box-shadow: var(--ui-shadow) !important;
  overflow: hidden;
}
.decision-label { color: #5079b5 !important; background: #e7f0fd !important; border-radius: 999px !important; }
.decision-score { background: linear-gradient(145deg, #2d6de8, #4c88f6) !important; border-radius: 14px !important; box-shadow: 0 15px 30px rgba(46,110,234,.22); }
.hero-facts span { background: rgba(255,255,255,.8) !important; border: 1px solid #e2eaf5; border-radius: 9px !important; }
.decision-section-title { margin-top: 27px !important; }
.agent-ranking-group {
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  box-shadow: var(--ui-shadow) !important;
  background: #fff !important;
  overflow: hidden;
}
.agent-ranking-head { background: linear-gradient(90deg, #fafcff, #f6f9fd) !important; border-bottom: 1px solid #e8edf4 !important; }
.agent-ranking-items article { border-color: #e9eef5 !important; }
.agent-ranking-items article:hover { background: #fbfdff; }
.agent-ranking-items strong, .ranking-score { color: #356fae !important; }
.priority-guidance article, .radar-card {
  border: 1px solid var(--ui-line) !important;
  border-radius: 14px !important;
  box-shadow: var(--ui-shadow) !important;
  background: #fff !important;
}
.priority-guidance article:hover, .radar-card:hover { border-color: #cddbef !important; box-shadow: var(--ui-shadow-hover) !important; }
.priority-guidance span { background: #eef4fc !important; color: #557293 !important; }
.priority-guidance button { color: var(--ui-blue) !important; }
.radar-shape, .radar-fill { opacity: .76; filter: saturate(.72); }
.final-decision {
  border: 1px solid #d8e4f5 !important;
  border-radius: 16px !important;
  background: linear-gradient(110deg, #f9fbff, #edf5ff) !important;
  box-shadow: var(--ui-shadow) !important;
}
.favorite-toggle {
  width: 100%;
  min-height: 34px;
  margin: 0 0 8px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #fff;
  color: #6d7e94;
}
.favorite-toggle:hover, .favorite-toggle.active { background: #f5f0e7; border-color: #e7d9bd; color: #8c6b33; }

/* Agent analysis */
.agent-dashboard-page { max-width: 1600px; }
.back-link { color: #60718a !important; border-radius: 8px; padding: 7px 9px !important; }
.back-link:hover { background: #eaf1fb !important; color: var(--ui-blue) !important; }
.agent-dashboard {
  grid-template-columns: 220px minmax(0,1fr) !important;
  gap: 16px !important;
  align-items: start;
}
.agent-analysis-nav {
  position: sticky;
  top: 76px;
  padding: 15px !important;
  background: linear-gradient(180deg, #fff, #f9fbff) !important;
}
.agent-analysis-nav h2 { font-size: 17px !important; color: #25344d; }
.agent-analysis-nav button {
  min-height: 60px !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  color: #47566e !important;
}
.agent-analysis-nav button:hover { background: #f2f6fc !important; }
.agent-analysis-nav button.active {
  background: #eaf1fb !important;
  border-color: #d8e3f3 !important;
  color: #2f598b !important;
  box-shadow: inset 3px 0 0 #547fb1;
}
.agent-analysis-nav i { filter: saturate(.55); }
.agent-dashboard-content {
  padding: 19px !important;
  min-height: calc(100vh - 124px);
  background: rgba(255,255,255,.93) !important;
}
.dash-title {
  padding: 5px 3px 17px !important;
  margin-bottom: 14px !important;
  border-bottom: 1px solid #e9eef5;
}
.dash-title h1 { font-size: 25px !important; margin: 4px 0 5px !important; }
.agent-kpis { gap: 10px !important; }
.agent-kpis article {
  border: 1px solid #e5ebf3 !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, #fff, #f8faff) !important;
  padding: 14px !important;
}
.agent-kpis article b { color: #2e405d !important; font-size: 23px !important; }
.agent-kpis article span { color: #8995a7 !important; }
.deep-section-grid { gap: 12px !important; }
.deep-card, .chart-card, .trend-card, .evidence-wide {
  border: 1px solid #e4eaf2 !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 16px !important;
}
.deep-card h3, .chart-card h3 { color: #31415a !important; }
.deep-card h3::before, .chart-card h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  border-radius: 3px;
  background: #5d83b5;
  margin-right: 8px;
  vertical-align: -1px;
}
.poi-treemap { border-radius: 10px !important; overflow: hidden; filter: saturate(.62); }
.gender-band, .age-band { filter: saturate(.65); }
.deep-bar i { background: #edf1f6 !important; }
.deep-bar i b { filter: saturate(.7); }
.mini-table { border-radius: 8px; overflow: hidden; }
.mini-table thead { background: #f5f8fc !important; }
.mini-table td, .mini-table th { border-color: #e9edf3 !important; }
.big-score { color: #356f9e !important; }
.live-badge { white-space: nowrap; }

@media (min-width: 1181px) {
  .deep-section-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .deep-card { padding: 13px !important; }
  .agent-kpis article { min-height: 76px; }
}

/* Reports */
.report-page-heading { align-items: center !important; }
.heading-actions { position: relative; z-index: 2; }
.report-kpis { gap: 12px !important; }
.report-kpis article {
  min-height: 100px;
  border: 1px solid var(--ui-line) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #fff, #f8faff) !important;
  box-shadow: var(--ui-shadow) !important;
  padding: 17px !important;
  position: relative;
  overflow: hidden;
}
.report-kpis article::after {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  right: -22px;
  top: -20px;
  background: rgba(71, 126, 232, .07);
}
.report-kpis article b { color: #253b59 !important; font-size: 26px !important; }
.report-workspace { gap: 14px !important; }
.report-catalog, .report-inspector { border-radius: 15px !important; }
.report-toolbar { border-bottom: 1px solid #e8edf4 !important; background: #fbfcfe; }
.search-box { background: #fff !important; border-color: #dde5ef !important; border-radius: 9px !important; }
.report-list-head { color: #8491a3 !important; background: #f6f8fb !important; }
.report-row { border-bottom: 1px solid #edf1f5 !important; }
.report-row:hover { background: #f8fbff !important; }
.report-row.selected { background: #edf5ff !important; box-shadow: inset 3px 0 0 #5187d5; }
.report-file { background: #edf3f8 !important; color: #547695 !important; border-radius: 9px !important; }
.status-chip.completed { background: #edf8f4 !important; color: #378a73 !important; }
.status-chip.draft { background: #f6f1e8 !important; color: #95764b !important; }
.report-actions button { border-radius: 7px !important; border-color: #dfe6ef !important; }
.report-inspector { background: linear-gradient(180deg, #fff, #f9fbfe) !important; }
.inspector-score { background: #f1f5fa !important; border-radius: 12px !important; }
.dimension-list i { background: #e8edf3 !important; }
.dimension-list i b { background: #6d8fa9 !important; }

/* Settings */
.settings-layout { grid-template-columns: 220px minmax(0, 1fr) !important; gap: 14px !important; }
.settings-nav { padding: 10px !important; position: sticky; top: 76px; }
.settings-nav button { min-height: 58px !important; border-radius: 10px !important; color: #59677b !important; }
.settings-nav button.active { background: #edf3f9 !important; color: #315f8d !important; box-shadow: inset 3px 0 0 #6283a5; }
.settings-nav button > span { background: #e5ebf2 !important; color: #687b90 !important; border-radius: 7px !important; }
.settings-nav button.active > span { background: #6d879d !important; color: #fff !important; }
.settings-form { min-height: 520px; }
.settings-panel { padding: 22px !important; }
.settings-panel-head { border-bottom-color: #e8edf4 !important; }
.settings-grid label { color: #536278 !important; }
.settings-note { border-left: 3px solid #809bb1 !important; background: #f4f7fa !important; border-radius: 9px !important; }
.service-cards article { border: 1px solid #e3e9f1 !important; border-radius: 11px !important; background: #fbfcfe !important; }
.service-icon { filter: saturate(.55); }
.settings-footer { background: #fbfcfe !important; border-top-color: #e8edf4 !important; }

/* Favorites empty state */
.favorite-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.favorite-overview article {
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fbff);
  box-shadow: var(--ui-shadow);
}
.favorite-overview span, .favorite-overview small { display: block; color: #7d899c; }
.favorite-overview b { display: block; margin: 5px 0; color: #2d4564; font-size: 26px; }
#favorites .empty-state {
  min-height: 390px !important;
  border-style: solid !important;
  display: grid !important;
  align-content: center;
  justify-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(91,134,247,.12), transparent 10rem),
    linear-gradient(145deg, #fff, #f8fbff) !important;
}
#favorites .empty-state::before {
  content: "";
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(145deg, #edf4ff, #dceafe);
  box-shadow: 0 15px 35px rgba(63, 105, 170, .13);
  position: absolute;
  top: 90px;
}
#favorites .empty-state > :first-child { position: relative; z-index: 2; color: #5b7fae !important; }
#favorites .empty-state b { color: #33445f !important; margin-top: 10px; }
#favorites .empty-state span { color: #8793a5 !important; }
#favorites .empty-state button { margin-top: 18px; position: relative; z-index: 2; }
#favorites .empty-state.has-items { display: block !important; min-height: 320px !important; padding: 16px; background: #fff !important; font-size: 13px !important; }
#favorites .empty-state.has-items::before { display: none; }
.favorite-list { display: grid; gap: 9px; width: 100%; }
.favorite-list article {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #e6ecf4;
  border-radius: 11px;
  background: #fbfcfe;
}
.favorite-list article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #eaf2ff; color: var(--ui-blue) !important; font-weight: 700; }
.favorite-list article b, .favorite-list article small { display: block; }
.favorite-list article b { font-size: 14px !important; color: #33445f !important; }
.favorite-list article small { margin-top: 4px; color: #8995a6; font-size: 12px !important; }
.favorite-list article button { font-size: 12px !important; width: auto !important; }
.favorite-list .favorite-remove { border: 0; background: transparent; color: #a46d70; }

/* Modals and feedback */
.modal { backdrop-filter: blur(8px); background: rgba(22,35,56,.36) !important; }
.modal-card { border: 1px solid rgba(255,255,255,.7); border-radius: 18px !important; box-shadow: 0 30px 70px rgba(20,40,70,.22) !important; }
.toast { border-radius: 10px !important; box-shadow: 0 14px 32px rgba(33,58,91,.2) !important; }

/* Responsive behavior */
@media (max-width: 1350px) {
  .top-grid { grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.3fr) !important; }
  .recommendations { grid-column: 1 / -1; min-height: auto; }
  .recommendations #recommendationList { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
  .recommendation { margin-bottom: 0 !important; }
  .report-workspace { grid-template-columns: 1fr !important; }
  .report-inspector { min-height: 330px; }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 184px minmax(0,1fr) !important; }
  .sidebar { width: 184px !important; }
  .report-inspector { min-height: 340px; }
}

@media (max-width: 1150px) {
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 64px minmax(0,1fr) !important; }
  .sidebar { width: 64px !important; padding: 0 8px 12px !important; }
  .brand { justify-content: center; }
  .brand > span:last-child, .brand-sub, .nav-item:not(.active) { font-size: 0 !important; }
  .nav-item { justify-content: center !important; padding: 0 !important; }
  .nav-item > span { font-size: 16px !important; }
  .support, .user, .live { display: none !important; }
  .sidebar-bottom { left: 8px !important; right: 8px !important; }
  .topbar { padding: 0 12px !important; }
  #dashboard, .section-page, .agent-page, .agent-dashboard-page { padding: 16px 12px 32px !important; }
  .page-heading { min-height: auto; padding: 18px !important; }
  .page-heading h1 { font-size: 23px !important; }
  .top-grid { grid-template-columns: 1fr !important; }
  .recommendations #recommendationList { grid-template-columns: 1fr; }
  .requirement-card, .city-map, .recommendations { min-height: auto; }
  .agent-dashboard, .settings-layout { grid-template-columns: 1fr !important; }
  .agent-analysis-nav, .settings-nav { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .agent-analysis-nav > .eyebrow, .agent-analysis-nav > h2 { grid-column: 1 / -1; }
  .agent-kpis { grid-template-columns: repeat(2,1fr) !important; }
  .decision-journey { overflow-x: auto; justify-content: flex-start !important; }
  .decision-journey > div { min-width: 112px; }
  .priority-guidance, .radar-candidates, .report-kpis { grid-template-columns: 1fr 1fr !important; }
  .favorite-overview { grid-template-columns: 1fr !important; }
  .explore-map { min-height: 520px !important; }
  .agent-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .top-actions .city { display: none; }
  .form-grid, .agent-kpis, .priority-guidance, .radar-candidates, .report-kpis { grid-template-columns: 1fr !important; }
  .agent-analysis-nav, .settings-nav { grid-template-columns: 1fr; }
  .page-heading { border-radius: 14px; }
}

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