/* Merchant profit calculator */
.profit-live-brand {
  position: sticky;
  top: 78px;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 16px 28px;
  overflow: hidden;
  border: 1px solid rgba(126, 218, 255, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 20%, rgba(89, 208, 255, 0.22), transparent 28%),
    linear-gradient(120deg, #17184f 0%, #34218a 48%, #126f9d 100%);
  box-shadow: 0 18px 42px rgba(37, 40, 119, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  isolation: isolate;
}

.profit-live-brand::after {
  content: "";
  position: absolute;
  inset: auto -12% -90% 44%;
  z-index: -1;
  height: 160px;
  border-radius: 50%;
  background: rgba(86, 222, 255, 0.12);
  filter: blur(18px);
}

.profit-live-brand-logo {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(36, 133, 255, 0.96), rgba(76, 65, 205, 0.96));
  box-shadow: 0 10px 24px rgba(30, 207, 255, 0.22);
}

.profit-live-brand-logo img {
  display: block;
  width: 48px;
  height: 48px;
}

.profit-live-brand-copy {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 16px;
  min-width: 0;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(73, 214, 255, 0.3);
}

.profit-live-brand-copy strong {
  color: #ffffff !important;
  font-size: clamp(21px, 2vw, 30px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.profit-live-brand-copy span {
  color: #ffffff !important;
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.profit-live-brand-copy em {
  color: #9feaff !important;
  font-size: clamp(12px, 1vw, 16px);
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.profit-calculator-page {
  position: relative;
  display: grid;
  gap: 20px;
}

.profit-page-header {
  background: linear-gradient(135deg, #f5fbff 0%, #eefaf5 100%);
  border: 1px solid #d8ebf5;
  border-radius: 24px;
  padding: 28px;
}

.profit-page-header h3 {
  margin: 4px 0 8px;
  font-size: 28px;
  color: #16324f;
}

.profit-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profit-platform-card {
  border: 1px solid #dceaf2;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profit-platform-card.is-active {
  border-color: #72c4e7;
  box-shadow: 0 12px 28px rgba(87, 180, 220, 0.12);
}

.profit-platform-head,
.profit-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profit-platform-head h3,
.profit-result-head h3 {
  margin: 4px 0 0;
}

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

.profit-entry {
  min-height: 92px;
  padding: 14px 12px;
  border: 1px solid #dbe8ef;
  border-radius: 18px;
  background: #fbfdff;
  color: #244a67;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profit-entry strong {
  font-size: 16px;
}

.profit-entry span,
.profit-entry em {
  color: #70889a;
  font-size: 12px;
  font-style: normal;
}

.profit-entry.is-active {
  background: linear-gradient(180deg, #eaf8ff, #f5fbff);
  border-color: #72c4e7;
  color: #1f6f98;
}

.profit-entry.is-reserved {
  background: #f7f8fa;
  border-style: dashed;
  opacity: 0.75;
}

.profit-entry.is-reserved em {
  color: #a37724;
}

.profit-profile-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.72fr) minmax(220px, 0.72fr) auto;
  gap: 18px;
  align-items: end;
}

.profit-profile-bar h3 {
  margin: 4px 0 6px;
}

.profit-profile-bar .field {
  margin: 0;
}

.profit-profile-bar select,
.profit-profile-name-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #d5d7f6;
  border-radius: 16px;
  background: #ffffff;
  padding: 10px 14px;
  color: #20223b;
  font: inherit;
  outline: none;
}

.profit-profile-bar select:focus,
.profit-profile-name-field input:focus {
  border-color: #6658e8;
  box-shadow: 0 0 0 4px rgba(101, 88, 232, 0.12);
}

.profit-profile-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-delete-button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #efc2bd;
  border-radius: 10px;
  background: #fff7f6;
  color: #b64d43;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.table-delete-button:hover {
  border-color: #dc8f87;
  background: #fff0ee;
}

.profit-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.profit-config-card,
.profit-order-card,
.profit-result-card,
.profit-history {
  border-color: #dceaf2;
}

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

.profit-config-card .profit-field,
.profit-order-card .profit-field {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  min-width: 0;
}

.profit-config-card .profit-field.full,
.profit-order-card .profit-field.full {
  grid-column: 1 / -1;
}

.profit-config-card .profit-input-wrap,
.profit-order-card .profit-input-wrap,
.profit-config-card .profit-input-wrap input,
.profit-order-card .profit-input-wrap input {
  width: 100%;
  min-width: 0;
}

.profit-config-card .profit-input-wrap input,
.profit-order-card .profit-input-wrap input {
  min-height: 46px;
  font-size: 15px;
  border-color: #d5d7f6;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.profit-config-card .profit-input-wrap input:hover,
.profit-order-card .profit-input-wrap input:hover {
  border-color: #aeb7ee;
}

.profit-config-card .profit-input-wrap input:focus,
.profit-order-card .profit-input-wrap input:focus {
  border-color: #6658e8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(101, 88, 232, 0.12), 0 8px 20px rgba(72, 87, 185, 0.08);
  outline: none;
}

.profit-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.profit-input-wrap small {
  min-width: 38px;
  color: #71889a;
  font-size: 12px;
  text-align: right;
}

.profit-field input:disabled {
  background: #f3f5f7;
  color: #9ba9b2;
}

.profit-tier-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e2edf3;
}

.profit-tier-panel .section-heading {
  align-items: flex-start;
}

.profit-tier-list {
  display: grid;
  gap: 10px;
}

.profit-tier-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8fcff;
  border: 1px solid #e0edf4;
  border-radius: 16px;
}

.profit-tier-row label {
  display: grid;
  gap: 6px;
  color: #36566e;
  font-size: 12px;
  font-weight: 700;
}

.profit-tier-row input {
  width: 100%;
  border: 1px solid #d7e6ef;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.profit-tier-arrow {
  align-self: center;
  color: #7790a2;
  font-size: 12px;
}

.profit-one-price-note {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #f3d7a3;
  border-radius: 18px;
  background: #fffaf0;
  color: #76561e;
}

.profit-one-price-note p {
  margin: 6px 0 0;
  line-height: 1.7;
}

.profit-calculate-actions {
  margin-top: 22px;
}

.profit-result-card {
  position: relative;
  overflow: hidden;
}

.profit-result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #54c1e7, #75d4ae);
}

.profit-status {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 800;
}

.profit-status.success,
.profit-advice.success {
  background: #eaf9f1;
  color: #347653;
}

.profit-status.warning,
.profit-advice.warning {
  background: #fff7e7;
  color: #94691d;
}

.profit-status.danger,
.profit-advice.danger {
  background: #fff0f0;
  color: #b44f4f;
}

.profit-status.info,
.profit-advice.info {
  background: #edf8ff;
  color: #3d789c;
}

.profit-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profit-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid #e2edf3;
  border-radius: 16px;
  background: #fbfdff;
}

.profit-result-row span {
  color: #3c5c72;
  font-weight: 700;
}

.profit-result-row strong {
  color: #16324f;
  font-size: 16px;
}

.profit-result-row small {
  grid-column: 1 / -1;
  color: #8094a3;
}

.profit-result-row.highlight {
  background: #edf9ff;
  border-color: #b9e4f6;
}

.profit-result-row.profit {
  background: #edf9f2;
  border-color: #c2ead1;
}

.profit-result-row.loss {
  background: #fff2f2;
  border-color: #f3caca;
}

.profit-result-row.loss strong {
  color: #c34747;
}

.profit-advice {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 18px;
}

.profit-advice p {
  margin: 6px 0 0;
}

.profit-history .table-wrap {
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .profit-workspace,
  .profit-profile-bar {
    grid-template-columns: 1fr;
  }

  .profit-profile-bar .action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .profit-live-brand {
    top: 64px;
    min-height: 76px;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 18px;
  }

  .profit-live-brand-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 14px;
  }

  .profit-live-brand-logo img {
    width: 38px;
    height: 38px;
  }

  .profit-live-brand-copy {
    gap: 2px 8px;
  }

  .profit-live-brand-copy strong,
  .profit-live-brand-copy span {
    font-size: 16px;
  }

  .profit-live-brand-copy em {
    display: none;
  }
}

@media (max-width: 820px) {
  .profit-platform-grid,
  .profit-result-grid,
  .profit-config-card .form-grid,
  .profit-order-card .form-grid {
    grid-template-columns: 1fr;
  }

  .profit-entry-grid {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    overflow-x: auto;
  }

  .profit-tier-row {
    grid-template-columns: 1fr;
  }

  .profit-tier-arrow {
    display: none;
  }
}

/* Operations module layout repair: keep detail cards content-sized and readable. */
.operation-drawer {
  width: min(1040px, calc(100vw - 32px));
  max-width: 1040px;
}

.operation-drawer #operation-detail-form.operation-detail-layout {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: min-content !important;
  align-items: start !important;
  align-content: start !important;
  gap: 20px !important;
}

.operation-drawer .operation-detail-section {
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: start;
  padding: 20px;
  border: 1px solid #d9eaf5;
  border-radius: 18px;
  background: #ffffff;
}

.operation-drawer .operation-detail-section.is-full {
  grid-column: 1 / -1;
}

.operation-drawer .operation-detail-section h4 {
  margin: 0 0 16px;
}

.operation-drawer .operation-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-items: start;
  align-content: start;
  gap: 16px;
}

.operation-drawer .operation-section-grid > *,
.operation-drawer .field {
  min-width: 0;
}

.operation-drawer .field {
  min-height: 0;
  height: auto;
  align-self: start;
}

.operation-drawer .field span {
  writing-mode: horizontal-tb;
  word-break: normal;
  overflow-wrap: normal;
}

.operation-drawer .read-only-field p {
  margin: 6px 0 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

.operation-drawer input,
.operation-drawer select,
.operation-drawer textarea {
  width: 100%;
  min-width: 0;
}

.operation-drawer input[type="date"],
.operation-drawer input[type="number"] {
  white-space: nowrap;
}

.operation-drawer textarea {
  min-height: 120px;
  resize: vertical;
}

.operation-drawer .field.full {
  grid-column: 1 / -1;
}

.operation-drawer .drawer-subpanel {
  min-height: 0;
  height: auto;
  align-self: start;
}

.shell:has(.tech-operations-page) {
  min-height: 100vh;
  align-items: stretch;
}

.shell:has(.tech-operations-page) .sidebar {
  min-height: 100vh;
  height: auto;
  align-self: stretch;
}

@media (max-width: 1099px) {
  .operation-drawer #operation-detail-form.operation-detail-layout,
  .operation-drawer .operation-section-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .operation-drawer .operation-detail-section {
    grid-column: 1 / -1;
  }
}

/* 销售线索核心字段保持紧凑，其他信息在详情抽屉中查看。 */
.tech-leads-page .leads-card-list .management-record {
  padding: 18px 20px;
}

.tech-leads-page .lead-core-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tech-leads-page .lead-core-grid .record-stat {
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
}

.tech-leads-page .lead-core-grid .record-stat strong {
  font-size: 14px;
}

@media (max-width: 1180px) {
  .tech-leads-page .lead-core-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tech-leads-page .lead-core-grid {
    grid-template-columns: 1fr;
  }
}

/* Script library and AI-assisted replies */
.script-page-header,
.script-card-head,
.reply-card-title,
.reference-row,
.ai-link-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.script-page-header h3,
.script-editor-card h3,
.ai-output-panel h3,
.referenced-templates h3,
.ai-history h3 {
  margin: 6px 0;
  color: #16324f;
}

.script-filter-grid,
.script-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.script-filter-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: end;
}

.filter-submit,
.form-actions,
.tag-row,
.script-counts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.choice-field {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d9eaf5;
  border-radius: 16px;
}

.choice-field legend {
  padding: 0 8px;
  color: #1f3f5b;
  font-weight: 700;
}

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

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

.choice-grid label,
.template-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #35556f;
}

.script-card-list,
.reply-card-list {
  display: grid;
  gap: 16px;
}

.script-template-card {
  border-left: 4px solid #65bfe2;
}

.script-template-card.is-disabled {
  opacity: 0.72;
  border-left-color: #aab8c4;
}

.script-card-head h3 {
  margin: 10px 0 6px;
}

.script-counts {
  flex: 0 0 auto;
}

.script-counts span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f0f8fc;
  color: #467c9f;
  font-size: 13px;
}

.script-template-card details {
  margin: 16px 0;
  border-top: 1px solid #e2eef5;
  border-bottom: 1px solid #e2eef5;
  padding: 14px 0;
}

.script-template-card summary,
.ai-history summary {
  cursor: pointer;
  color: #3f88b2;
  font-weight: 700;
}

.script-body > p,
.reply-card > p {
  color: #203f58;
  line-height: 1.8;
  white-space: normal;
}

.script-note {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f5fbfe;
  border-radius: 12px;
}

.script-note.risk,
.import-result.has-errors {
  background: #fff8ef;
  border-color: #f3d5a6;
}

.script-note p {
  margin: 6px 0 0;
}

.file-action {
  cursor: pointer;
}

.ai-reply-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.ai-input-panel,
.ai-output-panel {
  display: grid;
  gap: 16px;
}

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

.template-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 6px;
}

.template-picker label {
  align-items: flex-start;
  padding: 10px;
  border: 1px solid #e2eef5;
  border-radius: 12px;
}

.template-picker span {
  display: grid;
  gap: 4px;
}

.template-picker small {
  color: #6f879a;
}

.ai-placeholder {
  min-height: 380px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #6f879a;
}

.reply-card {
  padding: 16px;
  border: 1px solid #d9eaf5;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f9fdff);
}

.reply-card p {
  margin: 12px 0 16px;
}

.sales-reminders {
  padding: 16px;
  border-radius: 16px;
  background: #f2faf6;
  color: #35556f;
}

.sales-reminders ol {
  margin-bottom: 0;
  padding-left: 22px;
}

.ai-link-form {
  align-items: end;
  padding-top: 16px;
  border-top: 1px solid #e2eef5;
}

.ai-link-form .field {
  flex: 1;
}

.reference-row {
  padding: 12px 0;
  border-top: 1px solid #e2eef5;
  color: #35556f;
}

.ai-history details {
  padding: 12px 0;
  border-top: 1px solid #e2eef5;
}

.ai-history summary span {
  float: right;
  color: #7890a2;
  font-size: 12px;
  font-weight: 500;
}

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

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

@media (max-width: 720px) {
  .script-page-header,
  .script-card-head,
  .ai-link-form {
    align-items: stretch;
    flex-direction: column;
  }

  .script-editor-grid,
  .two-column-fields,
  .choice-grid,
  .choice-grid.compact {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}

/* Login page: keep the public entry consistent with the blue-white workspace theme. */
.login-shell {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 40px 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #f4fbff 0%, #eaf7ff 100%);
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(85, 194, 232, 0.08);
}

.login-shell::before {
  width: 220px;
  height: 220px;
  top: -90px;
  right: 8%;
}

.login-shell::after {
  width: 150px;
  height: 150px;
  bottom: -70px;
  left: 10%;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  max-width: 460px;
  padding: 38px;
  border: 1px solid #d8ecf7;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 22px 56px rgba(44, 109, 143, 0.12);
}

.login-card .brand-kicker {
  color: #3eaad1;
}

.login-card h1 {
  color: #163a59;
}

.login-card .login-subtitle {
  color: #5d7890;
}

.login-card .field span {
  color: #35556f;
}

.login-card .field input {
  min-height: 48px;
  color: #163a59;
  border-color: #d3e7f3;
  background: #ffffff;
  box-shadow: none;
}

.login-card .field input::placeholder {
  color: #a6b8c8;
}

.login-card .field input:focus {
  border-color: #58c2e6;
  box-shadow: 0 0 0 3px rgba(88, 194, 230, 0.14);
}

.login-card .login-submit {
  min-height: 48px;
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #51c4e8, #6dcce9);
  box-shadow: 0 10px 24px rgba(81, 196, 232, 0.22);
}

.login-card .login-submit:hover {
  background: linear-gradient(135deg, #49bddd, #73d2ed);
  transform: translateY(-1px);
}

.login-card .login-note {
  color: #6f879a;
  border-top-color: #e5f1f7;
  text-align: center;
}

.login-card .login-error {
  color: #a45252;
  background: #fff1f1;
  border: 1px solid #f4d7d7;
}

@media (max-width: 640px) {
  .login-shell {
    min-height: calc(100vh - 80px);
    padding: 24px 14px;
  }

  .login-card {
    padding: 28px 22px;
  }
}

/* ===== Blue-white lively accent refinement: visual polish only ===== */
:root {
  --accent-blue: #55c2e8;
  --accent-blue-deep: #3eaad1;
  --accent-blue-soft: #eaf8ff;
  --accent-orange-soft: #ffefe1;
  --accent-yellow-soft: #fff6cf;
  --accent-green-soft: #e7f8f0;
  --accent-purple-soft: #f0efff;
  --accent-pink-soft: #ffe8ec;
  --accent-peach-soft: #ffe7d8;
  --accent-text-strong: #15324a;
  --accent-text-title: #264761;
  --accent-text-body: #486985;
  --accent-text-muted: #7d95ad;
  --accent-border-soft: rgba(108, 169, 206, 0.16);
  --accent-shadow-soft: 0 18px 40px rgba(122, 167, 194, 0.12);
}

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(85, 194, 232, 0.08), transparent 18%),
    radial-gradient(circle at 86% 8%, rgba(185, 184, 255, 0.06), transparent 17%),
    radial-gradient(circle at 74% 78%, rgba(126, 217, 181, 0.05), transparent 16%),
    linear-gradient(180deg, #f6fbff 0%, #eef8ff 38%, #f9fcff 100%);
  color: var(--accent-text-body);
}

.app-shell {
  position: relative;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(85, 194, 232, 0.03), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(255, 184, 108, 0.03), transparent 22%),
    radial-gradient(circle at 78% 72%, rgba(185, 184, 255, 0.03), transparent 24%);
  z-index: -1;
}

.sidebar {
  background: linear-gradient(180deg, rgba(58, 146, 198, 0.96), rgba(83, 172, 218, 0.94));
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 18px 0 34px rgba(85, 160, 205, 0.12);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.16), transparent 22%),
    radial-gradient(circle at 80% 86%, rgba(255, 255, 255, 0.1), transparent 18%);
}

.sidebar::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  height: 56px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  opacity: 0.4;
  pointer-events: none;
}

.sidebar .brand,
.sidebar .brand-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar .brand::before,
.sidebar .brand-panel::before {
  content: none;
}

.sidebar .brand-title {
  color: #ffffff;
  letter-spacing: 0;
  text-shadow: 0 2px 8px rgba(44, 115, 153, 0.14);
}

.sidebar .brand-copy,
.sidebar .nav-section-title {
  color: rgba(244, 251, 255, 0.82);
}

.sidebar .brand-copy {
  max-width: 260px;
  line-height: 1.75;
}

.sidebar .nav-section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  vertical-align: middle;
}

.nav-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link .nav-icon {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #5b8def;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-link .nav-icon svg,
.nav-link .nav-icon i,
.nav-link .nav-icon img {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.nav-link.is-active,
.nav-link.active,
.nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(210, 230, 242, 0.96);
  box-shadow: 0 10px 20px rgba(44, 112, 152, 0.08);
}

.nav-link.is-active .nav-icon,
.nav-link.active .nav-icon,
.nav-link[aria-current="page"] .nav-icon {
  background: #f2f8fc;
  border-color: #d8e9f4;
  color: #2f6e9e;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-link:hover .nav-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.22);
  filter: brightness(0.98) saturate(1.04);
}

.nav-link .nav-label,
.nav-link span:last-child,
.nav-link strong {
  color: rgba(255, 255, 255, 0.92);
}

.nav-link.is-active .nav-label,
.nav-link.active .nav-label,
.nav-link.is-active span:last-child,
.nav-link.active span:last-child,
.nav-link.is-active strong,
.nav-link.active strong,
.nav-link[aria-current="page"] .nav-label,
.nav-link[aria-current="page"] span:last-child,
.nav-link[aria-current="page"] strong {
  color: #2f5f86;
}

.nav-link[href="#/workbench"] .nav-icon {
  color: #5b8def;
}

.nav-link[href="#/leads"] .nav-icon {
  color: #f4a261;
}

.nav-link[href="#/operations"] .nav-icon {
  color: #5dbb9a;
}

.nav-link[href="#/aftersales"] .nav-icon {
  color: #8b80f9;
}

.nav-link[href="#/alerts"] .nav-icon {
  color: #e57373;
}

.nav-link[href="#/stats"] .nav-icon {
  color: #6c8ebf;
}

.nav-link[href="#/stats/daily-deal"] .nav-icon {
  color: #f2b94b;
}

.nav-link[href="#/stats/daily-conversion"] .nav-icon {
  color: #4db6ac;
}

.nav-link[href="#/stats/weekly-conversion"] .nav-icon {
  color: #7e8ce0;
}

.nav-link[href="#/stats/monthly-conversion"] .nav-icon {
  color: #f299c1;
}

.nav-link[href="#/stats/monthly-renewal"] .nav-icon {
  color: #9ccc65;
}

.nav-link[href="#/settings"] .nav-icon {
  color: #7a8ca5;
}

.nav-link[href="#/logs"] .nav-icon {
  color: #8d99ae;
}

.nav-link.active[href="#/workbench"] .nav-icon,
.nav-link[aria-current="page"][href="#/workbench"] .nav-icon {
  color: #5b8def;
}

.nav-link.active[href="#/leads"] .nav-icon,
.nav-link[aria-current="page"][href="#/leads"] .nav-icon {
  color: #f4a261;
}

.nav-link.active[href="#/operations"] .nav-icon,
.nav-link[aria-current="page"][href="#/operations"] .nav-icon {
  color: #5dbb9a;
}

.nav-link.active[href="#/aftersales"] .nav-icon,
.nav-link[aria-current="page"][href="#/aftersales"] .nav-icon {
  color: #8b80f9;
}

.nav-link.active[href="#/alerts"] .nav-icon,
.nav-link[aria-current="page"][href="#/alerts"] .nav-icon {
  color: #e57373;
}

.nav-link.active[href="#/stats"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats"] .nav-icon {
  color: #6c8ebf;
}

.nav-link.active[href="#/stats/daily-deal"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats/daily-deal"] .nav-icon {
  color: #f2b94b;
}

.nav-link.active[href="#/stats/daily-conversion"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats/daily-conversion"] .nav-icon {
  color: #4db6ac;
}

.nav-link.active[href="#/stats/weekly-conversion"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats/weekly-conversion"] .nav-icon {
  color: #7e8ce0;
}

.nav-link.active[href="#/stats/monthly-conversion"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats/monthly-conversion"] .nav-icon {
  color: #f299c1;
}

.nav-link.active[href="#/stats/monthly-renewal"] .nav-icon,
.nav-link[aria-current="page"][href="#/stats/monthly-renewal"] .nav-icon {
  color: #9ccc65;
}

.nav-link.active[href="#/settings"] .nav-icon,
.nav-link[aria-current="page"][href="#/settings"] .nav-icon {
  color: #7a8ca5;
}

.nav-link.active[href="#/logs"] .nav-icon,
.nav-link[aria-current="page"][href="#/logs"] .nav-icon {
  color: #8d99ae;
}

.page-header,
.page-shell > .card:first-child,
.card,
.metric-card,
.metric-card-link,
.quick-link-card,
.tech-panel,
.dashboard-section,
.compact-list-panel,
.filter-panel,
.collapsible-form-panel,
.management-toolbar-panel,
.management-record,
.modal-panel,
.drawer-panel,
.detail-drawer,
.table-shell,
.stats-chart-panel {
  box-shadow: 0 10px 24px rgba(126, 163, 188, 0.09);
}

.card,
.metric-card,
.metric-card-link,
.quick-link-card,
.tech-panel,
.dashboard-section,
.compact-list-panel,
.filter-panel,
.collapsible-form-panel,
.management-toolbar-panel,
.management-record {
  border-color: var(--accent-border-soft);
}

.page-title,
.page-shell h1,
.hero-copy h3,
.dashboard-section h3,
.compact-list-panel h3,
.filter-panel h3,
.management-toolbar-panel h3 {
  color: #16324f;
}

.page-shell p,
.page-shell li,
.page-shell span,
.muted,
.record-meta,
.field span,
.stack .muted {
  color: #35556f;
}

.eyebrow,
.kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f879a;
}

.eyebrow::before,
.section-kicker::before,
.kicker::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: #d8eef9;
  box-shadow: none;
}

.tech-workbench-page .workbench-hero,
.tech-workbench-page .tech-hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.tech-workbench-page .workbench-hero::before,
.tech-workbench-page .tech-hero-panel::before {
  background:
    linear-gradient(135deg, rgba(85, 194, 232, 0.05), rgba(85, 194, 232, 0.01));
  width: 72px;
  height: 72px;
  right: 26px;
  top: 22px;
  border-radius: 28px;
  transform: rotate(16deg);
  opacity: 0.22;
}

.tech-workbench-page .workbench-hero::after,
.tech-workbench-page .tech-hero-panel::after {
  background:
    radial-gradient(circle at 30% 30%, rgba(85, 194, 232, 0.04), rgba(85, 194, 232, 0.008));
  width: 24px;
  height: 24px;
  right: 108px;
  bottom: 20px;
  border-radius: 18px;
  opacity: 0.16;
}

.tech-workbench-page .hero-copy::before {
  content: none;
}

.tech-workbench-page .hero-copy {
  position: relative;
  max-width: 720px;
  padding-top: 18px;
}

.tech-workbench-page .hero-copy h3 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.14;
  letter-spacing: 0;
  color: #16324f;
}

.tech-workbench-page .hero-copy .muted {
  max-width: 620px;
  color: #6f879a;
}

.metric-card {
  background: #ffffff;
  position: relative;
  box-shadow: 0 8px 18px rgba(126, 163, 188, 0.08);
  border-color: #d9eaf5;
}

.metric-card::before {
  content: none;
}

.metric-card .metric-icon {
  background: var(--accent-blue-soft);
  color: #3f88b2;
}

.metric-grid > *:nth-child(2) .metric-card .metric-icon {
  background: var(--accent-orange-soft);
  color: #c08742;
}

.metric-grid > *:nth-child(3) .metric-card .metric-icon {
  background: var(--accent-green-soft);
  color: #4d9b76;
}

.metric-grid > *:nth-child(4) .metric-card .metric-icon {
  background: var(--accent-purple-soft);
  color: #776ac6;
}

.metric-grid > *:nth-child(5) .metric-card .metric-icon {
  background: var(--accent-pink-soft);
  color: #c77885;
}

.metric-grid > *:nth-child(6) .metric-card .metric-icon {
  background: var(--accent-yellow-soft);
  color: #b3922f;
}

.metric-card strong {
  margin-top: 8px;
  color: #16324f;
  text-shadow: none;
  font-weight: 800;
}

.metric-copy span,
.metric-card span:last-child {
  color: #4e6a80;
  font-weight: 600;
}

.quick-link-card,
.tech-link-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.quick-link-card::before,
.tech-link-card::before {
  content: none;
}

.quick-link-card .quick-link-icon {
  background: var(--accent-blue-soft);
}

.quick-link-grid > *:nth-child(2n) .quick-link-card .quick-link-icon {
  background: var(--accent-orange-soft);
}

.quick-link-grid > *:nth-child(3n) .quick-link-card .quick-link-icon {
  background: var(--accent-green-soft);
}

.quick-link-grid > *:nth-child(4n) .quick-link-card .quick-link-icon {
  background: var(--accent-purple-soft);
}

.quick-link-grid > *:nth-child(5n) .quick-link-card .quick-link-icon {
  background: var(--accent-pink-soft);
}

.quick-link-grid > *:nth-child(6n) .quick-link-card .quick-link-icon {
  background: var(--accent-yellow-soft);
}

.quick-link-card:hover,
.tech-link-card:hover {
  box-shadow: 0 12px 26px rgba(114, 168, 196, 0.12);
}

.dashboard-section,
.compact-list-panel,
.filter-panel,
.collapsible-form-panel,
.management-toolbar-panel {
  position: relative;
}

.dashboard-section::after,
.compact-list-panel::after,
.filter-panel::after,
.collapsible-form-panel::after,
.management-toolbar-panel::after {
  content: none;
}

.filter-panel,
.collapsible-form-panel,
.management-toolbar-panel {
  background: #ffffff;
}

.field span,
.record-stat-label,
.record-meta span,
.table th,
.toolbar-actions .tag {
  color: #1f3f5b;
}

.field input,
.field select,
.field textarea {
  border-radius: 16px;
}

.primary-button {
  min-height: 46px;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(77, 183, 229, 0.14);
}

.ghost-button,
.secondary-button {
  border-radius: 16px;
}

.tag,
.pill,
.score-chip,
.subtle-tag {
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
}

.tag {
  border-color: rgba(136, 180, 206, 0.2);
  color: #35556f;
}

.tag.success,
.pill.success {
  color: #478765;
  border-color: rgba(103, 197, 135, 0.18);
}

.tag.warning,
.pill.warning {
  color: #aa7c20;
  border-color: rgba(245, 197, 107, 0.22);
}

.tag.danger,
.pill.danger {
  color: #bd6e6e;
  border-color: rgba(240, 138, 138, 0.2);
}

.tag.info,
.pill.info {
  color: #467c9f;
  border-color: rgba(105, 188, 227, 0.22);
}

.score-chip.high {
  color: #ab7a27;
}

.score-chip.medium {
  color: #6d66bd;
}

.score-chip.low {
  color: #4b9472;
}

.progress-bar,
.inline-progress-bar {
  border-radius: 999px;
}

.progress-value,
.inline-progress-bar span {
  background: linear-gradient(90deg, #55c2e8, #7ed9b5);
}

.operations-card-list .inline-progress-bar span {
  background: linear-gradient(90deg, #55c2e8, #8fd4ff);
}

.leads-card-list .management-record,
.operations-card-list .management-record {
  padding-top: 28px;
}

.operations-card-list .record-status-stack .tag:nth-child(2) {
  background: linear-gradient(180deg, #fef6ea, #fff0dd);
  color: #9f7428;
}

.operations-card-list .record-status-stack .tag:nth-child(3) {
  background: linear-gradient(180deg, #eef7ff, #e7f3ff);
  color: #4a7fa5;
}

.leads-card-list .record-status-stack .tag:nth-child(2) {
  background: linear-gradient(180deg, #f2fbf7, #e7f8ee);
  color: #4c8e6d;
}

.leads-card-list .record-status-stack .tag:nth-child(3) {
  background: linear-gradient(180deg, #f7f3ff, #f1edff);
  color: #6f65c4;
}

.detail-drawer,
.drawer-panel,
.modal-panel {
  background: #ffffff;
  border-color: var(--accent-border-soft);
}

.detail-drawer-header,
.drawer-header,
.modal-header,
.detail-drawer-footer {
  background: rgba(248, 252, 255, 0.86);
}

.empty-panel {
  background: #f8fcff;
}

.stats-page .metric-card,
.tech-stats-page .metric-card {
  background: #ffffff;
}

.table tr:hover td {
  background: rgba(234, 248, 255, 0.38);
}

.settings-page .card,
.logs-page .card {
  background: #ffffff;
}

@media (max-width: 1100px) {
  .tech-workbench-page .workbench-hero::before,
  .tech-workbench-page .tech-hero-panel::before {
    width: 112px;
    height: 112px;
    right: 20px;
    top: 22px;
  }

  .tech-workbench-page .workbench-hero::after,
  .tech-workbench-page .tech-hero-panel::after {
    right: 82px;
    bottom: 18px;
    width: 60px;
    height: 60px;
  }
}
