:root {
  --ink: #0e241e;
  --muted: #64756f;
  --deep: #123c31;
  --deep-2: #1d604b;
  --gold: #d3a45a;
  --gold-soft: #f2dba8;
  --paper: #f8f5ed;
  --panel: rgba(255,255,255,.88);
  --line: rgba(18,60,49,.12);
  --shadow: 0 24px 70px rgba(24, 42, 35, .13);
  --red: #c94f40;
  --green: #218b61;
  --blue: #2f6fa7;
  --orange: #d98f1f;
  --violet: #8667c8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 4%, rgba(211,164,90,.28), transparent 28rem),
    radial-gradient(circle at 95% 10%, rgba(29,96,75,.17), transparent 31rem),
    linear-gradient(135deg, #fbf4e4 0%, #edf3ee 48%, #fbf8f1 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

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

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

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 20px 18px 24px 8px;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 16px;
}

.public-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 32px 18px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  height: calc(100vh - 40px);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0 28px 28px 0;
  padding: 22px 16px;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(255,255,255,.13), transparent 36%),
    linear-gradient(180deg, #0f342b 0%, #174d3d 100%);
  box-shadow: var(--shadow);
}

.sidebar:after {
  content: "";
  position: absolute;
  left: 110px;
  bottom: -74px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(242,219,168,.24);
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  z-index: 1;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--deep);
  background: linear-gradient(135deg, #fff8e4, #d3a45a);
  font-weight: 900;
  font-size: 23px;
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.64);
  font-size: 12px;
}

.side-nav {
  position: relative;
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  gap: 8px;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}

.side-nav::-webkit-scrollbar {
  width: 5px;
}

.side-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.3);
}

.side-nav a {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 15px;
  color: rgba(255,255,255,.76);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.side-nav a.active,
.side-nav a:hover {
  color: #173b30;
  background: linear-gradient(135deg, #fff9e8, #e9bf74);
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
  font-weight: 900;
}

.side-nav small {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.82);
  font-size: 11px;
}

.side-nav a.active small,
.side-nav a:hover small {
  background: #173b30;
  color: #fff;
}

.role-card {
  position: relative;
  flex: 0 0 auto;
  z-index: 1;
  margin-top: 12px;
  padding: 17px;
  border-radius: 22px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
}

.role-card b {
  display: block;
  color: #fff1c9;
  margin-bottom: 8px;
  font-size: 13px;
}

.role-card p {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.7;
}

.workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 0 4px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.04em;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.top-search {
  width: clamp(210px, 24vw, 320px);
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(40,56,48,.06);
}

.avatar,
.logout-link {
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--deep);
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(40,56,48,.08);
}

.avatar {
  width: 48px;
}

.logout-link {
  padding: 0 16px;
}

.flash-wrap {
  display: grid;
  gap: 8px;
}

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  background: #ecf8f1;
  border: 1px solid #b9dfc8;
  color: var(--deep);
}

.flash.error {
  background: #fff0ec;
  border-color: #e6b7aa;
  color: var(--red);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(255,255,255,.08), transparent 42%),
    linear-gradient(135deg, #143d32 0%, #1d6049 100%);
  box-shadow: var(--shadow);
}

.marketing-hero {
  min-height: 280px;
  display: grid;
  grid-template-columns: 1.16fr .84fr;
}

.hero:after {
  content: "";
  position: absolute;
  right: 310px;
  top: -52px;
  width: 205px;
  height: 430px;
  transform: rotate(18deg);
  background: rgba(255,255,255,.07);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero.compact {
  padding: 24px 28px;
  min-height: auto;
}

.eyebrow {
  color: #f4d6a1;
  font-weight: 900;
  letter-spacing: .08em;
}

.hero h2 {
  margin: 8px 0;
  font-size: 35px;
  line-height: 1.22;
  letter-spacing: -.05em;
}

.hero p {
  width: min(100%, 700px);
  margin: 14px 0 20px;
  color: rgba(255,255,255,.8);
  line-height: 1.75;
  font-size: 14px;
}

.hero-actions,
.hero-tags,
.tabs,
.status-tabs,
.inline-forms {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-tags a,
.hero .ghost {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.17);
  color: rgba(255,255,255,.88);
  font-size: 13px;
  font-weight: 800;
}

.hero-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radar-card {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
}

.radar-card b {
  display: block;
  margin-bottom: 8px;
  color: #ffe8b5;
}

.radar-card p {
  width: auto;
  margin: 0;
  font-size: 13px;
}

.quick-tile {
  min-height: 78px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff6dd, #e5bd72);
  color: #173b30;
  display: grid;
  align-content: center;
  gap: 6px;
}

.quick-tile strong {
  font-weight: 900;
}

.quick-tile span {
  color: rgba(23,59,48,.68);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid,
.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.stat,
.card,
.lead-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 18px;
  border-radius: 24px;
}

.stat:before {
  content: "";
  position: absolute;
  left: 18px;
  top: 17px;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--gold);
}

.stat span {
  display: block;
  margin-top: 17px;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 29px;
  letter-spacing: -.04em;
}

.stat small {
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}

.stat.green strong { color: var(--green); }
.stat.warn strong { color: var(--orange); }
.stat.danger strong { color: var(--red); }
.stat.gold strong { color: var(--gold); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.main-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.card {
  border-radius: 30px;
  padding: 22px;
}

.card h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.03em;
}

.card p {
  color: var(--muted);
  line-height: 1.55;
}

.section-head,
.lead-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.section-head {
  margin-bottom: 18px;
}

.section-head p {
  margin: 6px 0 0;
  font-size: 13px;
}

.pill {
  min-height: 30px;
  border-radius: 999px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  background: #f2e4c4;
  color: var(--deep);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.form-grid,
.settings-grid,
.filter-grid {
  display: grid;
  gap: 14px;
}

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

.lead-entry-form {
  gap: 11px;
}

label span {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(18,60,49,.12);
  background: rgba(255,255,255,.9);
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29,96,75,.52);
  box-shadow: 0 0 0 4px rgba(29,96,75,.1);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

button,
.primary,
.mini-link,
.ghost,
.topbar nav a,
.topbar nav span {
  cursor: pointer;
  font-weight: 900;
}

button,
.primary {
  border: 1px solid var(--deep);
  background: var(--deep);
  color: #fff;
  border-radius: 14px;
  padding: 11px 15px;
}

button:hover,
.mini-link:hover,
.primary:hover {
  transform: translateY(-1px);
}

.lead-list {
  display: grid;
  gap: 14px;
}

.lead-card {
  border-radius: 22px;
  padding: 18px;
}

.lead-card h4 {
  margin: 0 0 6px;
  font-size: 20px;
}

.lead-card p {
  margin: 8px 0;
}

.lead-consult {
  color: var(--ink) !important;
}

.pill-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.follow-summary {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #e5dccd;
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  background: #fffaf1;
}

.follow-summary strong {
  color: var(--green);
}

.follow-summary span,
.follow-summary small {
  color: var(--muted);
}

.follow-summary p {
  margin: 0;
}

.empty-follow {
  color: var(--muted);
  border-left-color: var(--line);
  background: #f7f8f5;
}

.fieldwork-progress {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #d7e3dc;
  border-left: 4px solid var(--green);
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbf8, #f0f6f2);
}

.fieldwork-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.fieldwork-progress-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fieldwork-progress-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.fieldwork-progress-head strong,
.fieldwork-case-no {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.fieldwork-progress-head strong {
  color: #fff;
  background: var(--green);
}

.fieldwork-case-no {
  color: #6b4a22;
  background: #f1e5d0;
  white-space: nowrap;
}

.fieldwork-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 15px 0;
}

.fieldwork-steps span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8b9690;
  font-size: 12px;
}

.fieldwork-steps span::after {
  content: "";
  position: absolute;
  left: 26px;
  right: -4px;
  top: 11px;
  height: 2px;
  background: #dce6e0;
  z-index: 0;
}

.fieldwork-steps span:last-child::after {
  display: none;
}

.fieldwork-steps i {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7e8c85;
  background: #e4ebe7;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  z-index: 1;
}

.fieldwork-steps b {
  position: relative;
  z-index: 1;
  background: #f4f9f5;
}

.fieldwork-steps .done,
.fieldwork-steps .current {
  color: var(--green);
}

.fieldwork-steps .done i,
.fieldwork-steps .current i {
  color: #fff;
  background: var(--green);
}

.fieldwork-steps .done::after {
  background: #8db5a4;
}

.fieldwork-steps .current i {
  box-shadow: 0 0 0 4px rgba(36, 115, 79, 0.13);
}

.fieldwork-progress-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fieldwork-progress-meta > span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e0e9e3;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.fieldwork-progress-meta small,
.fieldwork-latest small {
  color: var(--muted);
  font-size: 11px;
}

.fieldwork-progress-meta b {
  color: var(--ink);
  font-size: 13px;
}

.fieldwork-latest {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 11px 0 0 !important;
  color: #355647;
  font-size: 12px;
}

.fieldwork-latest span {
  color: var(--muted);
}

.fieldwork-missing {
  color: #9a6222;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 760px) {
  .fieldwork-progress-head { align-items: flex-start; }
  .fieldwork-steps { grid-template-columns: 1fr; gap: 9px; }
  .fieldwork-steps span::after { left: 11px; right: auto; top: 22px; bottom: -9px; width: 2px; height: auto; }
  .fieldwork-steps b { background: transparent; }
  .fieldwork-progress-meta { grid-template-columns: 1fr; }
}

.meta span {
  background: #f3eee5;
  color: #694a24;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.inline-forms {
  align-items: flex-start;
}

.inline-forms form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.inline-forms input,
.inline-forms select {
  width: auto;
  min-width: 120px;
  flex: 1 1 140px;
}

.deal-classification {
  display: flex;
  gap: 8px;
  flex: 2 1 360px;
  min-width: 300px;
}

.deal-classification select {
  min-width: 145px;
  flex: 1 1 0;
}

.deal-classification select:disabled {
  color: var(--muted);
  background: #f1f3f1;
}

.mini-link {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--deep);
}

.status-panel {
  margin-bottom: 18px;
}

.status-tabs {
  justify-content: flex-end;
}

.compact-tabs {
  margin-bottom: 14px;
}

.status-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(25, 53, 42, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.status-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(25, 53, 42, .14);
}

.status-tab.active {
  border-color: rgba(16, 34, 28, .45);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), 0 14px 28px rgba(25, 53, 42, .16);
}

.status-1 { background: #fff4df; color: #9a5b00; }
.status-2 { background: #e8f0ff; color: #2c579f; }
.status-3 { background: #fff0d7; color: #a05f00; }
.status-4 { background: #e6f7ed; color: #176c3d; }
.status-5 { background: #ffe7e3; color: #a7352b; }
.status-6 { background: #f1e9ff; color: #6533a3; }
.status-7 { background: #e3f6f0; color: #0f6b57; }
.status-all { background: #eef1ec; color: #26382f; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.payment-grid {
  margin: 0;
}

.filter-grid {
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(108px, 1fr)) minmax(86px, auto);
  margin: 16px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.single-detail-grid {
  grid-template-columns: 1fr;
}

.detail-lead-list {
  margin-bottom: 18px;
}

.kv {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.kv span,
.timeline span,
.hint,
.empty {
  color: var(--muted);
}

.note {
  background: #f6f1e8;
  padding: 14px;
  border-radius: 14px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  border-left: 4px solid var(--gold);
  background: #fff;
  padding: 14px;
  border-radius: 12px;
}

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

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid textarea {
  min-height: 180px;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 1fr 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.user-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.check.inline {
  margin: 0;
  white-space: nowrap;
}

.danger,
button.danger[type="submit"] {
  background: #fff2ef;
  color: var(--red);
  border-color: #e6b7aa;
}

.muted-action {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.login-card {
  max-width: 460px;
  margin: 8vh auto;
  padding: 34px;
  border-radius: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-card p {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.center {
  text-align: center;
}

.fieldwork-hero {
  align-items: center;
  gap: 28px;
}

.flow-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(21, 67, 53, 0.12);
}

.flow-strip span {
  padding: 8px 10px;
  border-radius: 12px;
  background: #eef3f0;
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}

.flow-strip span.current {
  background: var(--gold);
  color: #2d351f;
}

.flow-strip b {
  color: var(--muted);
}

.five-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fieldwork-layout {
  align-items: start;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 2fr);
}

.sticky-entry-card {
  position: sticky;
  top: 22px;
}

.fieldwork-main,
.fieldwork-case-list {
  display: grid;
  gap: 18px;
}

.ownership-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.case-lock-note {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 13px;
}

.fieldwork-filter-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.7fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid #dce6e0;
  border-radius: 16px;
  background: #f7faf8;
}

.fieldwork-filter-grid .deal-classification {
  min-width: 0;
}

.fieldwork-filter-grid .mini-link {
  text-align: center;
  white-space: nowrap;
}

.deal-type-pill {
  color: #fff;
  background: var(--green);
}

.deal-subtype-pill {
  color: #654514;
  background: #f0ddb7;
}

.fieldwork-case {
  padding: 20px;
  border: 1px solid #dde6e1;
  border-radius: 20px;
  background: linear-gradient(150deg, #fff 0%, #fbfcfb 100%);
}

.fieldwork-case-head,
.case-meta,
.case-update-form,
.renewal-handoff-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.fieldwork-case-head {
  justify-content: space-between;
  align-items: flex-start;
}

.fieldwork-case-head h4 {
  margin: 6px 0 4px;
  font-size: 21px;
}

.fieldwork-case-head p,
.fieldwork-case-head h4,
.case-meta {
  margin-top: 0;
}

.case-no {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.case-meta {
  margin: 14px 0;
}

.case-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f5f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.case-update-form,
.renewal-handoff-form {
  align-items: end;
  padding-top: 14px;
  border-top: 1px dashed #dce5df;
}

.case-update-form label,
.renewal-handoff-form label {
  flex: 1 1 170px;
}

.case-update-form label.wide {
  flex-basis: 100%;
}

.renewal-handoff-form {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #dcc991;
  border-radius: 16px;
  background: #fffaf0;
}

.renewal-handoff-form h5 {
  flex-basis: 100%;
  margin: 0;
  color: var(--green);
  font-size: 16px;
}

.integration-warning,
.case-error {
  padding: 11px 13px;
  border-radius: 12px;
  background: #fff2ef;
  color: var(--red);
  font-weight: 700;
}

.compact-table {
  display: grid;
  gap: 8px;
}

.compact-table a {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) auto;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f9f8;
  color: inherit;
  text-decoration: none;
}

.compact-table a:hover {
  background: #eef4f0;
}

@media (min-width: 1281px) and (max-height: 950px) {
  .sidebar {
    padding: 18px 14px;
  }

  .brand {
    margin-bottom: 16px;
  }

  .side-nav {
    gap: 4px;
  }

  .side-nav a {
    min-height: 40px;
  }

  .role-card {
    margin-top: 8px;
    padding: 12px 14px;
  }

  .role-card b {
    margin-bottom: 0;
  }

  .role-card p {
    display: none;
  }
}

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

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: auto;
    border-radius: 28px;
  }

  .role-card {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 18px;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .marketing-hero,
  .dashboard-grid,
  .layout,
  .detail-grid,
  .filter-grid,
  .user-row,
  .radar-task-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .marketing-stats,
  .stats-grid,
  .payment-grid,
  .five-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fieldwork-layout {
    grid-template-columns: 1fr;
  }

  .fieldwork-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-entry-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .public-shell {
    padding: 16px;
  }

  .topbar,
  .hero,
  .section-head {
    flex-direction: column;
  }

  .top-actions,
  .top-search {
    width: 100%;
  }

  .side-nav,
  .hero-right,
  .marketing-stats,
  .stats-grid,
  .payment-grid,
  .form-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .deal-classification,
  .fieldwork-filter-grid {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .deal-classification {
    flex-direction: column;
    flex-basis: 100%;
  }

  .compact-table a {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 28px;
  }
}
