:root {
  --navy: #181F2A;
  --navy-2: #3A1020;
  --gold: #D5A84E;
  --gold-dark: #B0182E;
  --ink: #111827;
  --muted: #687385;
  --line: #DDE3EA;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --green: #087443;
  --red: #C41230;
  --radius: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; }

.app {
  min-height: 100vh;
  padding-bottom: calc(84px + var(--safe-bottom));
  background:
    linear-gradient(180deg, #FFF1F3 0, rgba(255,241,243,0) 300px),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(242,244,247,0.86);
  border-bottom: 1px solid rgba(228,231,236,0.9);
  backdrop-filter: blur(18px);
}

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

.brand img {
  width: 62px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}

.brand span,
.hero span,
.panel-head span,
.page-title span,
.signal-card span,
.profile-card span {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.round-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(16,24,40,0.08);
}

.round-btn b {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.page { display: none; animation: enter .24s ease; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 24px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 0, rgba(213,168,78,0.28), transparent 34%),
    radial-gradient(circle at 8% 18%, rgba(196,18,48,0.34), transparent 28%),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  color: white;
  box-shadow: 0 18px 44px rgba(77,13,28,0.18);
}

.hero h1 {
  margin: 8px 0;
  font-size: 31px;
}

.hero p {
  max-width: 600px;
  margin: 0;
  color: rgba(255,255,255,0.7);
  line-height: 1.55;
}

.identity {
  align-self: end;
  min-width: 210px;
  padding: 12px;
  border: 1px solid rgba(213,168,78,0.28);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}

.identity img,
.profile-card img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.identity-copy {
  min-width: 0;
}

.identity small,
.profile-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.identity strong,
.identity span {
  display: block;
  margin-top: 8px;
}

.identity span {
  color: rgba(255,255,255,0.62);
  font-size: 13px;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.market-card,
.panel,
.portfolio-panel,
.detail,
.mail-detail,
.profile-card,
.profile-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 8px rgba(16,24,40,0.04);
}

.market-card {
  padding: 14px;
}

.market-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.market-card small {
  display: inline-block;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.market-card small.down { color: var(--red); }

.portfolio-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 18px;
  padding: 18px;
  margin-bottom: 16px;
}

.portfolio-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.portfolio-main strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  color: var(--navy);
}

.portfolio-main p {
  color: var(--muted);
}

.allocation {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.allocation-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
}

.allocation-bar {
  height: 8px;
  border-radius: 999px;
  background: #EAECF0;
  overflow: hidden;
}

.allocation-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

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

.panel-head h2,
.page-title h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.panel-head.compact h2 { margin: 0; font-size: 18px; }

.text-btn {
  color: var(--gold-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.priority-list,
.client-list,
.approval-list,
.mail-list,
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.priority-item,
.client-card,
.approval-card,
.mail-item,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #FCFCFD;
}

.priority-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
  color: transparent;
}

.priority-item.done { opacity: .55; }
.priority-item.done .check { color: white; background: var(--green); }

.priority-main strong,
.client-card strong,
.approval-card strong,
.mail-item strong {
  display: block;
  font-size: 15px;
}

.priority-main span,
.client-card p,
.approval-card p,
.mail-item p {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--gold-dark);
  background: #FFF7E0;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.Critical,
.badge.High {
  color: var(--red);
  background: #FEE4E2;
}

.two-col,
.mail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 12px;
}

.timeline-item time { color: var(--gold-dark); font-weight: 900; }
.timeline-item strong, .timeline-item span { display: block; }
.timeline-item span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.signal-card {
  padding: 18px;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, #5B2E10, #A35C16);
}

.signal-card span,
.signal-card p {
  color: rgba(255,255,255,.75);
}

.signal-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.signal-card button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--navy);
  background: var(--gold);
  font-weight: 900;
}

.page-title { margin: 4px 0 16px; }

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 46px;
  padding: 0 14px;
  margin-bottom: 14px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.client-card,
.approval-card,
.mail-item {
  padding: 14px;
  cursor: pointer;
}

.client-card.active,
.mail-item.active {
  border-color: rgba(212,175,97,.58);
  box-shadow: 0 0 0 2px rgba(212,175,97,.12);
}

.client-top,
.mail-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail,
.mail-detail {
  margin-top: 14px;
  padding: 16px;
}

.detail h2,
.mail-detail h2 { margin: 0 0 8px; font-size: 20px; }

.detail-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-cell,
.profile-cell {
  padding: 12px;
  background: #F9FAFB;
}

.detail-cell span,
.profile-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-cell strong,
.profile-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.progress {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: #EAECF0;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.filters button {
  min-height: 40px;
  border-radius: var(--radius);
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  font-weight: 900;
}

.filters button.active {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

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

.mail-hero .page-title { margin-bottom: 0; }

.primary-mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--navy);
  background: var(--gold);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(212,175,97,.2);
  white-space: nowrap;
}

.mail-command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  gap: 10px;
  margin-bottom: 10px;
}

.mail-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16,24,40,.07);
}

.mail-search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.mail-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.mail-stat-card {
  min-height: 46px;
  padding: 7px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16,24,40,.07);
}

.mail-stat-card strong,
.mail-stat-card span {
  display: block;
}

.mail-stat-card strong { font-size: 17px; }

.mail-stat-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mail-filter-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 10px;
}

.mail-filter-tabs button {
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
}

.mail-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.mail-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  background: white;
}

.mail-item.unread {
  background: #FFFBEB;
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}

.mail-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--navy);
  background: #F3E7CB;
  font-size: 13px;
  font-weight: 900;
}

.mail-avatar.hot {
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold), #F1D896);
}

.mail-summary { min-width: 0; }

.mail-sender-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mail-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.mail-top time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mail-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.mail-subject-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.mail-star-btn,
.mail-icon-action {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--muted);
  background: #F9FAFB;
}

.mail-star-btn.active,
.mail-icon-action .fa-solid.fa-star {
  color: var(--gold-dark);
}

.mail-snippet {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mail-detail {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16,24,40,.07);
}

.mail-detail p { color: var(--muted); line-height: 1.6; }

.mail-detail-toolbar,
.mail-message-head,
.mail-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mail-detail-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.mail-detail-toolbar > div,
.mail-action-row { gap: 8px; }

.mail-message-card {
  padding: 14px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #FCFCFD;
}

.mail-message-head { margin-bottom: 10px; }

.mail-message-head strong,
.mail-message-head span {
  display: block;
}

.mail-message-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.attachment {
  display: inline-flex;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  background: #F9FAFB;
  font-size: 13px;
  font-weight: 800;
}

.attachment.muted { opacity: .72; }

.mail-empty,
.mail-detail-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  text-align: center;
}

.mail-empty strong,
.mail-detail-empty strong { color: var(--ink); }

.compose-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(7,17,31,.46);
}

.compose-modal.show { display: flex; }

.compose-sheet {
  width: min(620px, 100%);
  padding: 16px;
  border-radius: 18px 18px var(--radius) var(--radius);
  background: white;
  box-shadow: 0 24px 70px rgba(16,24,40,.28);
}

.compose-head,
.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compose-head { margin-bottom: 12px; }
.compose-head strong { font-size: 18px; }

.compose-sheet label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.compose-sheet input,
.compose-sheet textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.compose-sheet textarea {
  min-height: 150px;
  margin-top: 12px;
  padding: 10px 0;
  resize: vertical;
}

.compose-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.profile-card h1 { margin: 4px 0; }
.profile-card p { margin: 0; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--gold-dark);
  background: #FFF7E0;
  font-size: 12px;
  font-weight: 900;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(560px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(228,231,236,.92);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 40px rgba(16,24,40,.16);
  backdrop-filter: blur(18px);
}

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.tabbar button.active {
  color: var(--navy);
  background: var(--gold);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(7,17,31,.92);
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .hero,
  .portfolio-panel,
  .two-col,
  .mail-layout { grid-template-columns: 1fr; }
  .mail-command-bar { grid-template-columns: 1fr; }
  .market-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  main { padding: 12px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 25px; }
  .detail-grid,
  .profile-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .mail-filter-tabs {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin-right: -12px;
    margin-left: -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mail-filter-tabs::-webkit-scrollbar { display: none; }
  .mail-filter-tabs button {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 0 14px;
  }
  .mail-item { padding: 12px; }
  .mail-item.unread { padding-left: 10px; }
  .mail-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* CITIC China-office refresh */
:root {
  --navy: #202733;
  --navy-2: #4A1420;
  --gold: #F3C86A;
  --gold-dark: #C41230;
  --ink: #172033;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --green: #0B8A52;
  --red: #C41230;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "SF Pro Text", Arial, sans-serif;
}

.app {
  background:
    linear-gradient(180deg, #FFF5F6 0, #F5F6F8 260px),
    var(--bg);
}

.topbar {
  padding: 12px 16px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(229,231,235,.82);
}

.brand img {
  width: 70px;
  height: 38px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(229,231,235,.9);
}

.brand span,
.hero span,
.panel-head span,
.page-title span,
.signal-card span,
.profile-card span {
  color: var(--red);
  letter-spacing: .06em;
}

.hero {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86)),
    radial-gradient(circle at 92% 0, rgba(196,18,48,.16), transparent 34%);
  border: 1px solid rgba(196,18,48,.12);
  box-shadow: 0 10px 28px rgba(32,39,51,.08);
}

.hero h1 {
  margin: 8px 0;
  font-size: 27px;
}

.hero p {
  color: #667085;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #F1D5D9;
  border-radius: 12px;
  background: #FFF8F9;
}

.identity img,
.profile-card img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.identity strong,
.identity span {
  margin-top: 0;
}

.identity span {
  color: #667085;
}

.todo-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: #FFF;
  border: 1px solid #F1D5D9;
  box-shadow: 0 6px 18px rgba(32,39,51,.05);
}

.todo-strip i {
  color: var(--red);
}

.todo-strip strong,
.todo-strip span {
  display: block;
}

.todo-strip strong {
  font-size: 14px;
}

.todo-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.todo-strip button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(32,39,51,.05);
}

.workbench-grid button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 70px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.workbench-grid i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--red);
  background: #FFF1F3;
}

.workbench-grid b {
  position: absolute;
  top: 4px;
  right: 14px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 11px;
  line-height: 18px;
}

.market-strip {
  margin: 12px 0;
}

.market-card,
.panel,
.portfolio-panel,
.detail,
.mail-detail,
.profile-card,
.profile-cell,
.client-card,
.approval-card,
.mail-item,
.timeline-item {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(32,39,51,.045);
}

.market-card {
  padding: 12px;
}

.market-card strong {
  font-size: 20px;
}

.portfolio-panel {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
}

.portfolio-main strong {
  font-size: 32px;
}

.allocation-row {
  grid-template-columns: 84px 1fr 42px;
}

.allocation-bar span,
.progress span {
  background: linear-gradient(90deg, #D6A64A, var(--red));
}

.panel {
  border-radius: 14px;
}

.panel-head h2,
.page-title h1 {
  font-size: 21px;
}

.priority-item {
  grid-template-columns: auto 1fr auto;
}

.text-btn {
  color: var(--red);
}

.badge {
  color: var(--red);
  background: #FFF1F3;
}

.badge.Critical,
.badge.High {
  color: #fff;
  background: var(--red);
}

.signal-card {
  color: #fff;
  background: linear-gradient(135deg, #93192A, #C41230);
}

.signal-card button,
.primary-mail-btn,
.filters button.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.signal-card button {
  background: #fff;
  color: var(--red);
}

.primary-mail-btn {
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(196,18,48,.16);
}

.mail-filter-tabs button {
  min-width: 76px;
}

.mail-filter-tabs button.active {
  color: #fff;
}

.mail-item.active,
.client-card.active {
  border-color: rgba(196,18,48,.45);
  box-shadow: 0 0 0 2px rgba(196,18,48,.08);
}

.chips span {
  color: var(--red);
  background: #FFF1F3;
}

.tabbar {
  bottom: 10px;
  border-radius: 16px;
}

.tabbar button.active {
  color: var(--red);
  background: transparent;
  border-radius: 12px;
}

.module-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  background: rgba(15,23,42,.36);
  backdrop-filter: blur(8px);
}

.module-drawer.show {
  display: flex;
}

.module-panel {
  width: 100%;
  max-height: min(72vh, 620px);
  padding: 18px 16px calc(18px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -18px 44px rgba(15,23,42,.18);
  overflow-y: auto;
}

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

.module-head span,
.module-head strong {
  display: block;
}

.module-head span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.module-head strong {
  margin-top: 4px;
  font-size: 22px;
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.module-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #FAFAFB;
}

.module-item > span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 12px;
  color: var(--red);
  background: #FFF1F3;
  font-size: 12px;
  font-weight: 900;
}

.module-item strong {
  display: block;
  font-size: 15px;
}

.module-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.module-action {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 14px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.priority-item,
.approval-card,
.workbench-grid button {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 520px) {
  .brand img {
    width: 64px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .workbench-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 6px;
  }

  .workbench-grid button {
    min-height: 64px;
    font-size: 11px;
  }

  .workbench-grid b {
    right: 8px;
  }

  .market-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* App-like layout refinements */
.topbar {
  display: none;
}

.app {
  padding-bottom: calc(74px + var(--safe-bottom));
}

main {
  padding-top: 12px;
}

.tabbar {
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  padding: 7px 10px calc(7px + var(--safe-bottom));
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 -8px 22px rgba(15,23,42,.08);
}

.tabbar button {
  min-height: 48px;
  border-radius: 12px;
}

.tabbar button.active {
  color: var(--red);
  background: transparent;
  border-radius: 12px;
}

.tabbar button.active i,
.tabbar button.active span {
  color: var(--red);
}

@media (min-width: 620px) {
  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(560px, 100%);
    border-right: 1px solid rgba(228,231,236,.92);
    border-left: 1px solid rgba(228,231,236,.92);
    border-radius: 18px 18px 0 0;
  }
}
