/* 大心华 enterprise admin palette (market-standard)
 * Primary #1677FF | Deep/hover #0958D9 | Sidebar slate #001529
 * Page #F5F5F5 | Card #FFFFFF | Text #1F1F1F / #8C8C8C | Border #E8E8E8
 * Brand red reserved for logo only; semantic danger #FF4D4F; success greens kept
 */
:root {
  --bg: #f5f5f5;
  --panel: rgba(255, 255, 252, 0.96);
  --card: #ffffff;
  --text: #1f1f1f;
  --subtle: #8c8c8c;
  --line: #e8e8e8;
  --accent: #69b1ff;
  --accent-deep: #1677ff;
  --accent-soft: #e6f4ff;
  --green: #0958d9;
  --green-2: #1677ff;
  --danger: #ff4d4f;
  --warn: #c98a25;
  --safe: #24734f;
  --shadow: 0 16px 42px rgba(0, 21, 41, 0.10);
  --shadow-soft: 0 8px 22px rgba(0, 21, 41, 0.08);
}

.portal-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px 20px;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 119, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(22, 119, 255, 0.18), transparent 30%),
    linear-gradient(145deg, #001529 0%, #003a8c 52%, #000c17 100%);
}

.portal-shell {
  width: min(1180px, 100%);
}

.portal-head {
  text-align: center;
  color: #fff;
  margin-bottom: 30px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.88);
}

.portal-brand-mark {
  width: 48px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #001529;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  padding: 0;
}
.portal-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.portal-kicker {
  width: max-content;
  margin: 26px auto 12px;
  padding: 7px 14px;
  border: 1px solid rgba(145, 202, 255, 0.55);
  border-radius: 999px;
  color: #ebce97;
  font-size: 13px;
  letter-spacing: 3px;
}

.portal-head h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: 2px;
}

.portal-head p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.portal-card {
  min-height: 292px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  text-decoration: none;
  color: #001529;
  background: rgba(255, 255, 252, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(0, 21, 41, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.portal-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -72px;
  bottom: -76px;
  border-radius: 50%;
  background: rgba(22, 119, 255, 0.08);
}

.portal-card:hover {
  transform: translateY(-7px);
  border-color: #91caff;
  box-shadow: 0 30px 66px rgba(0, 21, 41, 0.34);
}

.portal-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #0958d9, #1677ff);
  font-size: 25px;
  font-weight: 800;
  box-shadow: 0 12px 25px rgba(9, 88, 217, 0.22);
}

.portal-card-fieldwork .portal-icon {
  background: linear-gradient(135deg, #1677ff, #69b1ff);
}

.portal-card-renewal .portal-icon {
  background: linear-gradient(135deg, #0958d9, #4096ff);
}

.portal-card-number {
  position: absolute;
  right: 26px;
  top: 29px;
  color: #d9dfdb;
  font: 800 28px/1 Georgia, serif;
}

.portal-card strong {
  margin-top: 25px;
  font-size: 24px;
}

.portal-card-copy {
  margin-top: 11px;
  min-height: 48px;
  color: #8c8c8c;
  line-height: 1.7;
}

.portal-enter {
  margin-top: auto;
  padding-top: 20px;
  color: #0958d9;
  font-weight: 700;
}

.portal-enter b {
  display: inline-block;
  margin-left: 8px;
  color: #1677ff;
  transition: transform 0.2s ease;
}

.portal-card:hover .portal-enter b {
  transform: translateX(5px);
}

.portal-info-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
}

.portal-info-card {
  padding: 26px 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 38px rgba(0, 21, 41, 0.16);
  backdrop-filter: blur(10px);
}

.portal-section-label {
  color: #91caff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
}

.portal-info-card h2 {
  margin: 10px 0 11px;
  color: #fff;
  font-size: 21px;
  line-height: 1.45;
}

.portal-company-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.85;
  font-size: 14px;
}

.portal-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.portal-values span {
  padding: 6px 10px;
  border-radius: 6px;
  color: #e7d1a8;
  background: rgba(22, 119, 255, 0.12);
  border: 1px solid rgba(221, 184, 117, 0.22);
  font-size: 12px;
}

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

.portal-guide-list div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-guide-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.portal-guide-list b {
  color: #fff;
  font-size: 14px;
}

.portal-guide-list span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  line-height: 1.65;
}

.portal-flow {
  margin: 26px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.portal-flow span {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.portal-flow b {
  color: #d5ae69;
}

.portal-foot {
  margin-top: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.43);
  font-size: 13px;
}

@media (max-width: 820px) {
  .portal-body { padding: 28px 16px; align-items: start; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-info-grid { grid-template-columns: 1fr; }
  .portal-card { min-height: 230px; }
  .portal-head h1 { font-size: 36px; }
  .portal-flow b { transform: rotate(90deg); }
  .portal-guide-list div { grid-template-columns: 1fr; gap: 4px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(9, 88, 217, 0.08), transparent 260px),
    linear-gradient(135deg, #f5f5f5, #f0f2f5 56%, #f0f2f5);
  min-height: 100vh;
}

.topbar,
.page {
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 0 14px;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--green);
}

.subline {
  color: var(--subtle);
  margin-top: 4px;
}

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

.nav a,
.ghost-btn,
.chip-btn,
.danger-link {
  text-decoration: none;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(20, 45, 36, 0.04);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav a:hover,
.ghost-btn:hover,
.chip-btn:hover,
.danger-link:hover {
  border-color: rgba(22, 119, 255, 0.65);
  color: var(--green);
  transform: translateY(-1px);
}

.danger-link,
.chip-btn.danger {
  color: var(--danger);
}

.user-pill {
  background: var(--accent-soft);
  border: 1px solid rgba(22, 119, 255, 0.42);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #5d4524;
}

.page {
  padding-bottom: 32px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.flash.success { border-color: #b9d9c8; background: #eef8f2; }
.flash.error { border-color: #e4bdb4; background: #fff1ef; }

.hero-panel,
.card {
  background: var(--panel);
  border: 1px solid rgba(222, 230, 224, 0.9);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.hero-panel {
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(9, 88, 217, 0.96), rgba(9, 88, 217, 0.96)),
    linear-gradient(90deg, rgba(22, 119, 255, 0.18), transparent);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 64%, rgba(255, 255, 255, 0.08) 64% 66%, transparent 66%),
    linear-gradient(110deg, transparent 0 78%, rgba(22, 119, 255, 0.18) 78% 79%, transparent 79%);
}

.hero-panel h1 {
  margin: 10px 0 8px;
  font-size: 32px;
  letter-spacing: 0;
}

.hero-panel p,
.section-head p,
.field span,
.muted,
.empty-box,
.script-pop,
.owner-row span {
  color: var(--subtle);
}

.hero-panel p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 720px;
}

.compact-hero {
  min-height: 170px;
}

.hero-panel .badge {
  background: rgba(241, 229, 208, 0.16);
  color: #f5dfb7;
  border: 1px solid rgba(241, 229, 208, 0.26);
}

.hero-actions .ghost-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(241, 229, 208, 0.28);
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: #6a4b21;
}

.badge.expired { background: #fee4de; color: var(--danger); }
.badge.urgent { background: #fff0d7; color: #8f6209; }
.badge.warning { background: #fdf0dc; color: var(--warn); }
.badge.safe { background: #e4f4ea; color: var(--safe); }

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

.side-panel,
.section-card {
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

.side-panel {
  position: sticky;
  top: 14px;
}

.main-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-weight: 700;
  font-size: 14px;
}

.field select[multiple] {
  min-height: 112px;
}

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

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(9, 88, 217, 0.72);
  box-shadow: 0 0 0 3px rgba(9, 88, 217, 0.10);
}

textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contract-row {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr);
}

.primary-btn,
button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: white;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(9, 88, 217, 0.18);
}

.wide {
  width: 100%;
  justify-content: center;
}

.action-row,
.hero-actions,
.import-inline,
.action-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.more-link-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.toolbar input[type="text"] {
  grid-column: span 2;
}

.toolbar button {
  justify-content: center;
}

.import-inline input[type="file"] {
  min-width: 0;
  flex: 1 1 260px;
}

.stats-grid,
.double-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.revenue-panel,
.new-customer-panel,
.customer-status-panel {
  margin-bottom: 18px;
}

.revenue-grid,
.new-customer-grid,
.customer-status-grid,
.city-grid {
  display: grid;
  gap: 16px;
}

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

.new-customer-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.customer-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.city-ledger-summary {
  margin: 14px 0;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 16px 16px;
  min-height: 96px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 16px;
}

.stat-card span {
  color: var(--subtle);
  display: block;
  font-size: 13px;
}

.stat-card strong {
  font-size: 30px;
  line-height: 1.05;
  display: block;
  margin-top: 6px;
  white-space: nowrap;
}

.money-stat strong {
  font-size: 28px;
  letter-spacing: 0;
}

.money-stat small {
  color: var(--subtle);
  display: block;
  margin-top: 8px;
}

.stat-card.danger strong { color: var(--danger); }
.stat-card.warn strong { color: var(--warn); }
.stat-card.safe strong { color: var(--safe); }
.stat-card.expired strong { color: var(--danger); font-size: 22px; }
.stat-card.urgent strong,
.stat-card.warning strong { color: var(--warn); font-size: 22px; }
.stat-card.muted-stat strong { color: var(--subtle); }

.detail-stats .stat-card strong {
  font-size: 22px;
}

.followup-list,
.owner-list {
  display: grid;
  gap: 12px;
}

.followup-card,
.owner-row,
.editing-banner,
.month-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.user-admin-row {
  align-items: center;
}

.user-summary {
  display: grid;
  gap: 4px;
}

.edit-user-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f5f5;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.edit-user-panel[hidden] {
  display: none;
}

.checkbox-field {
  align-content: start;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.payment-summary {
  margin-bottom: 14px;
}

.owner-meta {
  color: var(--subtle);
  font-size: 14px;
}

.month-count {
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green), var(--accent));
  color: white;
  font-size: 32px;
  font-weight: 800;
}

.script-box,
.login-tip {
  background: #fafafa;
  border: 1px solid rgba(22, 119, 255, 0.32);
  padding: 14px;
  border-radius: 8px;
  line-height: 1.7;
}

.duplicate-alert {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(184, 69, 54, 0.24);
  background: #fff5f2;
  display: grid;
  gap: 6px;
  color: #6b342b;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.section-card {
  background: rgba(255, 255, 252, 0.97);
}

.compact-form {
  margin-bottom: 16px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item p {
  margin: 6px 0;
  line-height: 1.7;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--accent));
  box-shadow: 0 0 0 4px rgba(9, 88, 217, 0.12);
}

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

th,
td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  background: #f7f3f2;
  color: var(--green);
  font-weight: 800;
}

.chip-details {
  position: relative;
}

.chip-details summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chip-details summary::-webkit-details-marker {
  display: none;
}

.script-pop {
  position: absolute;
  right: 0;
  top: 42px;
  width: 340px;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.7;
}

.empty-box,
.empty-td {
  padding: 20px 10px;
}

.login-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(560px, 100%);
  background: rgba(255, 255, 252, 0.98);
  border: 1px solid rgba(222, 230, 224, 0.9);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 28px;
}

.login-head h1 {
  margin: 10px 0 8px;
}

.profile-summary {
  margin-bottom: 18px;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-cell {
  border: 1px solid var(--line);
  background: rgba(247, 250, 246, 0.82);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.summary-cell span,
.summary-cell small {
  color: var(--subtle);
}

.summary-cell strong {
  color: var(--ink);
  font-size: 17px;
}

.bulk-form {
  display: grid;
  gap: 14px;
}

.bulk-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  background: rgba(245, 239, 229, 0.55);
  border-radius: 8px;
  padding: 14px;
}

.bulk-panel p {
  margin: 4px 0 0;
}

.check-col {
  width: 54px;
  text-align: center;
}

.log-filter {
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
}

@media (max-width: 1100px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

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

  .revenue-grid,
  .new-customer-grid,
  .customer-status-grid,
  .city-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .profile-summary-grid,
  .bulk-panel,
  .log-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .page {
    width: min(100% - 16px, 100%);
  }

  .hero-panel,
  .followup-card,
  .owner-row,
  .editing-banner,
  .month-box {
    flex-direction: column;
  }

  .field-row,
  .double-grid,
  .stats-grid,
  .revenue-grid,
  .new-customer-grid,
  .customer-status-grid,
  .city-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .profile-summary-grid,
  .bulk-panel,
  .log-filter {
    grid-template-columns: 1fr;
  }

}

/* Unified business console refresh: aligned with the marketing system. */
:root {
  --bg: #f5f5f5;
  --panel: rgba(255, 255, 255, 0.9);
  --card: #ffffff;
  --text: #1f1f1f;
  --subtle: #8c8c8c;
  --line: rgba(9, 88, 217, 0.12);
  --accent: #69b1ff;
  --accent-deep: #1677ff;
  --accent-soft: #e6f4ff;
  --green: #0958d9;
  --green-2: #1677ff;
  --danger: #ff4d4f;
  --warn: #d98f1f;
  --safe: #218b61;
  --shadow: 0 24px 70px rgba(0, 21, 41, 0.13);
  --shadow-soft: 0 12px 32px rgba(0, 21, 41, 0.09);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 9% 4%, rgba(22, 119, 255, 0.10), transparent 28rem),
    radial-gradient(circle at 95% 10%, rgba(22, 119, 255, 0.08), transparent 31rem),
    linear-gradient(135deg, #f5f5f5 0%, #f0f2f5 48%, #fafafa 100%);
}

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

.app-body .topbar,
.app-body .page {
  width: 100%;
  max-width: none;
  margin: 0;
}

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

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  height: calc(100vh - 40px);
  min-height: 760px;
  overflow: hidden;
  border-radius: 0 28px 28px 0;
  padding: 22px 16px;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.13), transparent 36%),
    linear-gradient(180deg, #001529 0%, #002140 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(145, 202, 255, 0.24);
}

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

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

.brand-mark-img {
  padding: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}
.brand-mark-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


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

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

.side-nav {
  position: relative;
  display: grid;
  gap: 8px;
  z-index: 1;
}

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

.side-nav a.active,
.side-nav a:hover {
  color: #001529;
  background: linear-gradient(135deg, #e6f4ff, #91caff);
  box-shadow: 0 12px 26px rgba(0, 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, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

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

.role-card {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  z-index: 1;
  padding: 17px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.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, 0.72);
  font-size: 12px;
  line-height: 1.7;
}

.self-account-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,241,201,.45);
  cursor: pointer;
}
.self-account-link:hover {
  color: #fff;
  border-bottom-color: #fff1c9;
}
.self-account-hint {
  display: block;
  margin: -2px 0 8px;
  color: rgba(255,241,201,.7);
  font-size: 11px;
}

.app-body .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: -0.04em;
}

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

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

.top-search,
.avatar,
.user-pill,
.danger-link {
  min-height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(0, 21, 41, 0.08);
}

.top-search {
  min-width: 300px;
  justify-content: flex-start;
  padding: 0 18px;
  color: #8c8c8c;
}

.avatar {
  width: 46px;
  color: var(--green);
  font-weight: 900;
}

.user-pill {
  padding: 0 14px;
  color: #6a4b21;
  background: rgba(145, 202, 255, 0.66);
  border-color: rgba(211, 164, 90, 0.38);
}

.danger-link {
  padding: 0 16px;
  color: var(--text);
}

.danger-link:hover,
.top-search:hover {
  color: var(--green);
  transform: translateY(-1px);
}

.app-body .page {
  padding-bottom: 32px;
}

.hero-panel,
.card,
.stat-card,
.followup-card,
.owner-row,
.editing-banner,
.month-box,
.table-wrap,
.script-box,
.login-tip,
.summary-cell,
.edit-user-panel,
.duplicate-alert {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  min-height: 190px;
  padding: 28px;
  margin-bottom: 18px;
  border-radius: 24px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(135deg, #0958d9 0%, #1677ff 100%);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 34px;
  align-items: center;
}

.hero-copy,
.hero-actions,
.hero-right {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-panel h1 {
  font-size: 34px;
  letter-spacing: -0.04em;
}

.hero-panel h1,
.hero-panel p {
  overflow-wrap: anywhere;
}

.hero-tags,
.hero-right {
  display: grid;
  gap: 12px;
}

.hero-tags {
  grid-template-columns: repeat(3, max-content);
  margin-top: 22px;
}

.hero-tags a,
.hero-actions .ghost-btn {
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

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

.radar-card {
  grid-column: 1 / -1;
  padding: 18px 20px;
  border-radius: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.radar-card b {
  color: #91caff;
  font-size: 17px;
}

.radar-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.8);
}

.quick-tile {
  min-height: 78px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e6f4ff, #91caff);
  color: #001529;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.quick-tile strong,
.quick-tile span {
  display: block;
}

.quick-tile strong {
  font-size: 16px;
}

.quick-tile span {
  margin-top: 7px;
  color: rgba(23, 59, 48, 0.74);
  font-size: 12px;
}

.section-card,
.side-panel {
  padding: 22px;
}

.section-head h2,
.section-head h3 {
  margin-top: 0;
  letter-spacing: -0.03em;
}

.stats-grid,
.revenue-grid,
.new-customer-grid,
.customer-status-grid,
.city-grid {
  gap: 16px;
}

.stat-card {
  min-height: 112px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.86)),
    radial-gradient(circle at 100% 0%, rgba(22, 119, 255, 0.12), transparent 45%);
}

.stat-card::before {
  width: 36px;
  height: 3px;
  margin-bottom: 16px;
  background: var(--accent);
}

.stat-card strong {
  font-size: 32px;
  letter-spacing: -0.04em;
}

.money-stat strong {
  font-size: 27px;
}

input,
select,
textarea,
.nav a,
.ghost-btn,
.chip-btn,
.danger-link,
.chip-details summary {
  border-radius: 14px;
}

input,
select,
textarea {
  min-height: 48px;
  border-color: rgba(9, 88, 217, 0.14);
}

.primary-btn,
button {
  border-radius: 14px;
}

.badge,
.chip-btn,
.ghost-btn {
  border-radius: 999px;
}

.layout-grid {
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
}

.side-panel {
  top: 20px;
}

.profile-edit-card {
  overflow: visible;
}

.profile-edit-form {
  display: grid;
  gap: 14px;
}

.profile-section {
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  background: #fbf8f7;
}

.profile-section summary {
  cursor: pointer;
  padding: 15px 18px;
  color: var(--deep);
  font-weight: 900;
  list-style-position: inside;
}

.profile-section[open] summary {
  border-bottom: 1px solid #ebe3e1;
}

.profile-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

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

.secure-profile-section {
  border-color: #ecd59e;
  background: #fffaf0;
}

.secure-profile-section summary {
  color: #805c0d;
}

.profile-save-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    border-radius: 26px;
  }

  .sidebar .brand {
    margin-bottom: 16px;
  }

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

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

  .app-body .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-search {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
    gap: 12px;
  }

  .sidebar {
    padding: 16px;
  }

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

  .side-nav a {
    min-height: 42px;
    padding: 0 10px;
  }

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

  .app-body .topbar {
    padding: 0;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    width: 100%;
  }

  .avatar,
  .user-pill {
    display: none;
  }

  .danger-link {
    flex: 1 1 auto;
  }

  .hero-panel {
    padding: 22px;
    min-height: 0;
  }

  .hero-panel h1 {
    font-size: 30px;
  }

  .hero-tags,
  .hero-right {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .revenue-grid,
  .new-customer-grid,
  .customer-status-grid,
  .city-grid {
    grid-template-columns: 1fr;
  }

  .profile-field-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .profile-field-grid .profile-wide {
    grid-column: auto;
  }
}


/* HQ city switcher */
a.city-switch-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.city-switch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(40, 28, 26, 0.12);
}
a.city-switch-card strong {
  color: #1677ff;
}
.city-view-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff6e5, #eef8f2);
  border: 1px solid #e0c48a;
}
.city-view-banner strong {
  display: block;
  margin-bottom: 4px;
}
.city-view-banner span {
  color: #5a6570;
  font-size: 13px;
}
.city-exit-btn {
  white-space: nowrap;
}
.city-switcher-panel .section-head p {
  max-width: 52rem;
}

/* ICP filing footer — discreet */
.site-icp-foot {
  margin: 18px auto 12px;
  padding: 0 16px 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #8a939c;
}
.site-icp-foot a,
.site-icp-link {
  color: inherit;
  text-decoration: none;
}
.site-icp-foot a:hover,
.site-icp-link:hover {
  color: #5a6570;
  text-decoration: underline;
}
.portal-foot .site-icp-link {
  display: inline-block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 12px;
}
.portal-foot .site-icp-link:hover {
  color: rgba(255, 255, 255, 0.7);
}
