﻿:root {
  --brand: #bd2f2a;
  --brand-dark: #8f2320;
  --ink: #202226;
  --muted: #727780;
  --line: #e6e8eb;
  --soft: #f6f7f8;
  --panel: #ffffff;
  --green: #1d8b5f;
  --amber: #b7791f;
  --blue: #2f6fb4;
  --shadow: 0 10px 28px rgba(28, 32, 38, 0.08);
}

[hidden] {
  display: none !important;
}

body.is-locked {
  overflow: hidden;
}

body.is-locked .app-shell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(189, 47, 42, 0.08), rgba(47, 111, 180, 0.08)),
    #f4f6f8;
}

.login-card {
  position: relative;
  width: min(430px, 94vw);
  border: 1px solid rgba(189, 47, 42, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 32, 38, 0.18);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: var(--brand);
  font-size: 18px;
  line-height: 1.1;
}

.login-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.login-copy {
  margin: 20px 0 18px;
}

.login-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.login-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.login-form label {
  display: grid;
  gap: 7px;
  color: #3f4651;
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  outline: none;
}

.login-form input:focus {
  border-color: rgba(189, 47, 42, 0.45);
  box-shadow: 0 0 0 3px rgba(189, 47, 42, 0.1);
}

.login-submit {
  min-height: 42px;
  margin-top: 4px;
}

.login-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.login-status[data-state="error"] {
  color: #b42318;
}

.login-status[data-state="ready"] {
  color: var(--green);
}

.login-hint {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fb;
  color: #5b6573;
  font-size: 12px;
  line-height: 1.4;
}

.account-modal {
  width: min(760px, 94vw);
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
}

.account-modal::backdrop {
  background: rgba(17, 24, 39, 0.58);
}

.account-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 32, 38, 0.2);
  padding: 22px;
}

.account-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-right: 42px;
}

.account-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.account-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfcfd;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: #3f4651;
  font-size: 12px;
  font-weight: 700;
}

.account-form input,
.account-form select {
  min-height: 40px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  outline: none;
}

.account-form button {
  align-self: end;
  min-height: 40px;
}

.account-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.account-status[data-state="ready"] {
  color: var(--green);
}

.account-status[data-state="error"] {
  color: #b42318;
}

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row strong {
  color: var(--ink);
  font-size: 14px;
}

.account-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.danger-text {
  color: #b42318;
}

.danger-text:disabled {
  color: #8b929d;
  cursor: not-allowed;
}

.quote-shell {
  display: grid;
  gap: 10px;
}

.quote-shell-toolbar {
  display: flex;
  justify-content: flex-start;
}

.quote-shell-toolbar .ghost-btn {
  background: #fff;
}

.quote-workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.quote-workspace.quote-doc-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.quote-doc-list {
  display: grid;
  gap: 8px;
  align-self: start;
}

.quote-doc-card {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 1fr 14px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 9px 10px;
  box-shadow: 0 5px 14px rgba(28, 32, 38, 0.04);
}

.quote-doc-card.active,
.quote-doc-card:hover {
  border-color: rgba(189, 47, 42, 0.35);
  background: #fff8f4;
}

.quote-doc-card strong,
.quote-doc-card small {
  display: block;
}

.quote-doc-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.quote-doc-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.quote-doc-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f9e8df;
  color: var(--brand);
}

.quote-doc-icon svg {
  width: 16px;
  height: 16px;
}

.document-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 24, 39, 0.62);
}

.document-preview-card {
  width: min(1180px, 96vw);
  height: min(900px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: #f4f5f7;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.document-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.document-preview-head strong {
  font-size: 16px;
}

.document-preview-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.document-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.document-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.document-pdf-export-root {
  position: fixed;
  left: 0;
  top: 0;
  width: 1120px;
  min-height: 100px;
  overflow: visible;
  background: #fff;
  color: #111;
  pointer-events: none;
  transform: none;
  z-index: 1;
}

.pi-builder {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.pi-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pi-preview-btn {
  background: linear-gradient(135deg, #ef5a0b, #ff7b37);
  box-shadow: 0 10px 22px rgba(239, 90, 11, 0.24);
}

.pi-status {
  margin: 12px 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f7f9fb;
  color: #536071;
  font-size: 13px;
}

.pi-status[data-state="ready"] {
  background: #ecfdf5;
  color: #08734f;
}

.pi-status[data-state="error"] {
  background: #fff1f2;
  color: #b42318;
}

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

.pi-section {
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

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

.pi-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 15px;
}

.pi-section-title span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f97316;
}

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

.pi-form-grid label,
.pi-item-card label,
.pi-summary label {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
}

.pi-form-grid label.wide,
.pi-item-card label.wide {
  grid-column: 1 / -1;
}

.pi-form-grid input,
.pi-form-grid textarea,
.pi-form-grid select,
.pi-item-card input,
.pi-item-card textarea,
.pi-item-card select,
.pi-summary input,
.pi-remarks {
  width: 100%;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  padding: 9px 10px;
  outline: none;
  color: #111827;
}

.pi-form-grid textarea,
.pi-item-card textarea,
.pi-remarks {
  min-height: 82px;
  resize: vertical;
}

.pi-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pi-color {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: #374151;
}

.pi-color::before {
  content: "";
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--pi-color);
}

.pi-color.active {
  border-color: var(--pi-color);
  color: var(--pi-color);
  font-weight: 700;
}

.pi-logo-upload,
.pi-upload-box {
  border: 1px dashed #f1a891;
  border-radius: 8px;
  background: #fff7f4;
  min-height: 112px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.pi-logo-upload img {
  max-height: 92px;
  max-width: 220px;
  object-fit: contain;
}

.pi-logo-upload span,
.pi-upload-box span {
  color: #7c4a3c;
  font-weight: 700;
}

.pi-logo-upload small,
.pi-upload-box small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 400;
}

.pi-item-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.pi-item-card {
  border: 1px solid #f0e4de;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.pi-item-card + .pi-item-card {
  margin-top: 12px;
}

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

.pi-item-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pi-item-head select {
  width: 220px;
  min-height: 36px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 6px 8px;
}

.soft-btn {
  min-height: 36px;
  border: 1px solid #ffd9c8;
  border-radius: 999px;
  background: #fff4ed;
  color: #c2410c;
  padding: 0 12px;
  font-weight: 700;
}

.api-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1464a5;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}

.text-danger {
  border: 0;
  background: transparent;
  color: #dc2626;
}

.pi-upload-box {
  margin-bottom: 10px;
}

.pi-upload-box img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #fff;
}

.pi-row-total {
  display: grid;
  gap: 5px;
  border: 1px solid #e5edf5;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.pi-row-total span {
  color: var(--muted);
  font-size: 12px;
}

.pi-summary {
  display: grid;
  gap: 10px;
}

.pi-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
}

.pi-final {
  margin-top: 4px;
  border-top: 1px dashed #ffd1b8;
  padding-top: 10px;
}

.pi-final strong {
  color: #ea580c;
  font-size: 23px;
}

.pi-bank-tip {
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  padding: 10px 12px;
  font-size: 13px;
}

.contract-builder .pi-section-title span {
  background: #dc2626;
}

.quotation-builder .pi-section-title span {
  background: #2563eb;
}

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

.quotation-grid .pi-section.wide {
  grid-column: 1 / -1;
}

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

.quotation-edit-table,
.quotation-result-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.quotation-edit-table th,
.quotation-edit-table td,
.quotation-result-table th,
.quotation-result-table td {
  border: 1px solid #e5e7eb;
  padding: 7px;
  text-align: center;
  vertical-align: middle;
}

.quotation-edit-table th,
.quotation-result-table th {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.quotation-edit-table input,
.quotation-edit-table textarea,
.quotation-edit-table select,
.quotation-result-table input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  outline: none;
}

.quotation-edit-table textarea {
  min-height: 54px;
  resize: vertical;
}

.quotation-edit-table th:nth-child(1),
.quotation-edit-table td:nth-child(1) {
  width: 130px;
}

.quotation-edit-table th:nth-child(2),
.quotation-edit-table td:nth-child(2) {
  width: 220px;
}

.quotation-edit-table th:nth-child(12),
.quotation-edit-table td:nth-child(12) {
  width: 86px;
}

.quotation-edit-table th:nth-child(13),
.quotation-edit-table td:nth-child(13) {
  width: 160px;
}

.quotation-mini-upload {
  min-height: 54px;
  border: 1px dashed #bdd7ff;
  border-radius: 7px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #2563eb;
  font-size: 12px;
  overflow: hidden;
}

.quotation-mini-upload img {
  width: 64px;
  height: 54px;
  object-fit: contain;
  background: #fff;
}

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

.quotation-summary > div {
  min-height: 54px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  align-items: center;
}

.quotation-summary span {
  color: #64748b;
  font-size: 12px;
}

.quotation-summary strong {
  color: #0f172a;
  font-size: 18px;
}

.quotation-summary small {
  color: #64748b;
}

.quotation-summary .selected {
  grid-column: 1 / -1;
  border-color: #fed7aa;
  background: #fff7ed;
}

.quotation-summary .selected strong {
  color: #ea580c;
  font-size: 24px;
}

.contract-party-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.contract-party-card {
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffafa, #fff);
  padding: 12px;
}

.contract-party-head,
.contract-party-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contract-party-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.contract-party-head strong {
  color: #111827;
}

.contract-party-head .soft-btn,
.contract-party-row .ghost-btn {
  min-height: 34px;
  white-space: nowrap;
}

.contract-party-head .soft-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contract-party-row select {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  outline: none;
}

.contract-item-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.contract-item-card + .contract-item-card {
  margin-top: 12px;
}

.contract-item-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.contract-item-grid label {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
}

.contract-item-grid input,
.contract-item-grid select {
  width: 100%;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  min-height: 40px;
  padding: 8px 10px;
  outline: none;
}

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

.contract-summary div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ffe1d6;
  border-radius: 8px;
  background: #fff8f4;
  padding: 9px 11px;
}

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

.contract-summary span {
  color: #6b7280;
}

.contract-summary strong {
  color: #dc2626;
}

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

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

@media (max-width: 760px) {
  .document-preview-modal {
    padding: 10px;
  }

  .document-preview-card {
    width: 100%;
    height: 94vh;
  }

  .document-preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .document-preview-actions {
    justify-content: stretch;
  }

  .document-preview-actions button {
    flex: 1;
  }

  .pi-grid,
  .pi-form-grid,
  .pi-item-grid,
  .quotation-grid,
  .quotation-summary,
  .contract-party-tools,
  .contract-item-grid,
  .contract-summary,
  .quote-doc-list {
    grid-template-columns: 1fr;
  }

  .pi-item-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pi-item-head select {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f3f4f6;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 8px 18px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  height: auto;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: 0 2px 10px rgba(28, 32, 38, 0.04);
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 6px 8px 0;
  border-bottom: 0;
  min-width: 178px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  border-radius: 6px;
  font-size: 13px;
}

.brand-name {
  color: var(--brand);
  font-size: 17px;
  font-weight: 800;
}

.brand-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.nav {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-top: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-item {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b515b;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  text-align: left;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 12px;
}

.nav-item svg,
.panel-title svg,
.search svg,
.icon-btn svg,
.user-chip svg,
.empty-state svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.nav-item.active,
.nav-item:hover {
  background: transparent;
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}

.nav-item.locked {
  color: #a4aab3;
  opacity: 0.62;
}

.nav-item.locked:hover {
  color: #7e8794;
  border-bottom-color: transparent;
}

.nav-item.locked::after {
  content: "锁";
  margin-left: 2px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #7e8794;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
}

.main {
  min-width: 0;
  padding: 16px 24px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

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

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

.search {
  width: min(340px, 32vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.icon-btn,
.user-chip {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #444a54;
}

.icon-btn {
  width: 38px;
  display: grid;
  place-items: center;
  position: relative;
}

.dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
}

.user-chip small {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff1f1;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}

.account-manage-btn,
.logout-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
}

.account-manage-btn svg,
.logout-btn svg {
  width: 15px;
  height: 15px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel + .panel,
.two-col + .panel,
.panel + .two-col,
.bottom-grid {
  margin-top: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: #404650;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.row-between {
  justify-content: space-between;
}

.row-between span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.row-between small,
.panel-title small {
  color: var(--muted);
  font-weight: 500;
}

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

.quick-card {
  height: 78px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.22);
}

.quick-card:hover {
  background: var(--brand-dark);
}

.quick-card svg {
  width: 21px;
  height: 21px;
}

.quick-card strong {
  font-size: 14px;
}

.quick-card span {
  opacity: 0.86;
  font-size: 11px;
}

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

.notice-grid {
  align-items: stretch;
}

.two-col > .panel + .panel {
  margin-top: 0;
}

.notice-grid > .panel {
  min-height: 206px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.notice-grid .panel-title {
  min-height: 24px;
  margin-bottom: 12px;
}

.notice-grid .announcement-list,
.notice-grid .memo-list {
  flex: 1;
  align-content: start;
}

.notice-grid .announcement-item,
.notice-grid .memo-entry {
  min-height: 68px;
}

.notice-grid .inline-form {
  margin-top: 12px;
}

.empty-line {
  display: grid;
  place-items: center;
  height: 68px;
  color: #9aa0a8;
  background: var(--soft);
  border-radius: 8px;
  font-size: 13px;
}

.announcement-list,
.memo-list {
  display: grid;
  gap: 8px;
  min-height: 68px;
}

.announcement-item,
.memo-entry {
  border: 1px solid #f0d9d6;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fffafa;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.memo-entry {
  border-color: #dde5ee;
  border-left-color: var(--blue);
  background: #f9fbfd;
}

.announcement-item strong,
.memo-entry strong {
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.announcement-meta,
.memo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.delete-item-btn {
  min-width: 54px;
  min-height: 30px;
  border: 1px solid #f0d9d6;
  border-radius: 8px;
  color: var(--brand-dark);
  background: #fff;
}

.delete-item-btn:hover {
  background: #fff0ef;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: stretch;
}

.inline-form input,
.form-grid input,
.form-grid textarea,
.toolbar input,
.toolbar select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  outline: 0;
  background: #fff;
}

.inline-form input {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
}

.modal-actions button:last-child,
button.primary {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
}

.submit-inline-btn {
  flex: 0 0 82px;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(189, 47, 42, 0.18);
}

.submit-inline-btn svg {
  width: 15px;
  height: 15px;
}

.submit-inline-btn:hover {
  background: var(--brand-dark);
}

.submit-inline-btn:active {
  background: var(--brand-dark);
}

button.primary:hover {
  background: var(--brand-dark);
}

.memo-item {
  height: 68px;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.memo-item span,
.followup-row p,
.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.followup-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid #f0dfb8;
  border-radius: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.tag.green {
  color: var(--green);
  background: #e9f8f1;
}

.tag.amber {
  color: var(--amber);
  background: #fff4d6;
}

.ghost-btn,
.text-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #3e4651;
  padding: 0 12px;
}

.text-btn {
  border-color: transparent;
  color: var(--brand-dark);
}

.metric-grid {
  display: grid;
  gap: 10px;
}

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

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

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

.metric {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.metric.warn {
  background: #fff4f1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.1;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 74px;
  color: var(--muted);
}

.empty-state svg {
  color: var(--amber);
}

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

.fx-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 10px;
}

.fx-live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e9f8f1;
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.fx-live-badge.offline {
  background: #fff0ef;
  color: var(--brand-dark);
}

.fx-controls select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.fx-controls .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fx-card,
.fx-loading {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.fx-card {
  position: relative;
}

.fx-card b,
.fx-card strong,
.fx-card span,
.fx-card small {
  display: block;
}

.fx-card b {
  font-size: 12px;
}

.fx-card strong {
  margin-top: 5px;
  font-size: 17px;
}

.fx-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.fx-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 1px solid #f0d9d6;
  border-radius: 7px;
  color: var(--brand-dark);
  background: #fff;
  display: grid;
  place-items: center;
}

.fx-remove svg {
  width: 13px;
  height: 13px;
}

.fx-change {
  color: var(--muted);
  font-size: 12px;
}

.fx-change.up {
  color: var(--green);
}

.fx-change.down {
  color: var(--brand-dark);
}

.fx-source {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.fx-loading {
  grid-column: 1 / -1;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.up {
  color: var(--green);
  font-size: 12px;
}

.world-clock-panel {
  margin-top: 14px;
}

.clock-groups {
  display: grid;
  gap: 10px;
}

.clock-region {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  overflow: hidden;
}

.clock-region summary {
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #38404a;
  font-weight: 700;
  list-style: none;
  background: #fff;
}

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

.clock-region summary small {
  color: var(--muted);
  font-weight: 600;
}

.clock-region summary::after {
  content: "鈻?;
  color: var(--muted);
  font-size: 12px;
}

.clock-region:not([open]) summary::after {
  content: "鈻?;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  padding: 10px;
}

.clock-card {
  min-height: 98px;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.clock-card span,
.clock-card small,
.clock-card em {
  display: block;
}

.clock-card span {
  color: #4b515b;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock-card strong {
  display: block;
  margin-top: 7px;
  font-size: 25px;
  line-height: 1;
}

.clock-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.clock-card em {
  margin-top: 7px;
  border-radius: 5px;
  background: #eef3f8;
  color: #69717d;
  font-size: 10px;
  line-height: 1.35;
  font-style: normal;
  padding: 4px 6px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.kpi-card {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.kpi-card strong,
.kpi-card em,
.kpi-card span {
  display: block;
}

.kpi-card strong {
  font-size: 24px;
  line-height: 1;
}

.kpi-card em {
  margin-top: 3px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.kpi-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-card.muted strong {
  color: #a0a6ae;
}

.kpi-card.green strong {
  color: var(--green);
}

.kpi-card.money strong {
  font-size: 18px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.chart-card {
  min-height: 228px;
}

.pie-wrap {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.pie-chart {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(#c53832 0 33%, #2f6fb4 33% 66%, #168063 66% 100%);
  position: relative;
}

.pie-chart::after {
  content: "";
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: #fff;
}

.pie-wrap ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #4b515b;
  font-size: 12px;
}

.pie-wrap li + li {
  margin-top: 8px;
}

.legend {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 6px;
}

.legend.red {
  background: #c53832;
}

.legend.blue {
  background: #2f6fb4;
}

.legend.green {
  background: #168063;
}

.funnel-chart {
  height: 150px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
}

.funnel-chart div {
  width: var(--w);
  min-width: 96px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #d9605a;
  font-size: 12px;
  font-weight: 700;
}

.funnel-chart div:first-child {
  opacity: 0.35;
}

.funnel-chart div:last-child {
  opacity: 0.7;
}

.spark-chart {
  width: 100%;
  height: 150px;
  margin-top: 4px;
}

.spark-chart polyline {
  fill: none;
  stroke: #bd2f2a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-chart circle {
  fill: #bd2f2a;
}

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

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

.module-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 280px;
}

.toolbar select {
  width: 148px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.data-table th {
  color: #555d68;
  background: #fafafa;
  font-weight: 700;
}

.data-table td {
  color: #333942;
}

.product-management {
  display: grid;
  gap: 14px;
}

.product-market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.product-market-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 10px;
  min-height: 158px;
  padding: 14px;
}

.product-market-head {
  display: grid;
  gap: 5px;
}

.product-market-head span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.product-market-head strong {
  color: #172033;
  font-size: 16px;
}

.product-market-card p {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
}

.product-market-meta {
  display: grid;
  gap: 7px;
}

.product-market-meta span {
  align-items: flex-start;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  line-height: 1.45;
}

.product-market-meta svg {
  color: var(--brand);
  flex: 0 0 auto;
  height: 14px;
  margin-top: 2px;
  width: 14px;
}

.product-form-panel,
.product-library {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.product-form-panel[hidden] {
  display: none;
}

.product-notice,
.product-form-status {
  align-items: center;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  display: flex;
  font-size: 13px;
  gap: 7px;
  padding: 10px 12px;
}

.product-notice svg {
  height: 16px;
  width: 16px;
}

.product-form-status {
  background: #f7fbff;
  border-color: #dbe7f5;
  color: #45617d;
}

.product-form-status[data-state="error"] {
  background: #fff7f6;
  border-color: #f4c3c0;
  color: var(--brand-dark);
}

.product-form-status[data-state="ready"] {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.product-form-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.product-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-save-btn {
  background: #eef7ff;
  border-color: #b9d9f8;
  color: #0a66c2;
}

.product-save-btn:hover {
  background: #dceeff;
  border-color: #8bc2f2;
}

.product-form-head h3,
.product-library h3 {
  font-size: 16px;
  margin: 0;
}

.product-form-head p,
.product-library p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.product-field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-field-grid label {
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  color: #475569;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  padding: 10px;
}

.product-field-grid label.wide {
  grid-column: span 2;
}

.product-category-field {
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  color: #475569;
  display: grid;
  gap: 9px;
  grid-column: span 2;
  padding: 10px;
}

.product-category-field > strong {
  font-size: 12px;
}

.product-category-manager {
  display: grid;
  gap: 9px;
}

.product-category-create {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) auto;
}

.product-category-create input {
  background: #f9fbfd;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
}

.product-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.product-category-chip {
  align-items: center;
  background: #edf4ff;
  border: 1px solid #c9dcfa;
  border-radius: 999px;
  color: #245ba7;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  min-height: 30px;
  padding: 0 5px 0 10px;
}

.product-category-chip button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #6680a8;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.product-category-chip button:hover {
  background: #d7e7ff;
  color: #b91c1c;
}

.product-category-chip svg {
  height: 13px;
  width: 13px;
}

.product-field-grid input,
.product-field-grid select,
.product-field-grid textarea {
  background: #f9fbfd;
  border-color: #cfdae6;
  border-radius: 8px;
  min-height: 38px;
}

.product-field-grid textarea {
  min-height: 82px;
  resize: vertical;
}

.module-head.compact {
  margin-bottom: 0;
}

.product-table-wrap {
  overflow-x: auto;
}

.product-table {
  min-width: 1580px;
}

.product-table th,
.product-table td {
  font-size: 12px;
}

.product-row-delete {
  align-items: center;
  background: #fff7f7;
  border: 1px solid #fecaca;
  border-radius: 7px;
  color: #b91c1c;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.product-row-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.product-row-delete svg {
  height: 15px;
  width: 15px;
}

@media (max-width: 980px) {
  .product-market-grid,
  .product-field-grid {
    grid-template-columns: 1fr;
  }

  .product-field-grid label.wide {
    grid-column: 1;
  }

  .product-category-field {
    grid-column: 1;
  }

  .product-category-create {
    grid-template-columns: 1fr;
  }

  .product-form-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.hot {
  color: #a63328;
  background: #ffebe8;
}

.status.warm {
  color: #926400;
  background: #fff2c2;
}

.status.cool {
  color: #276f93;
  background: #e9f5fb;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.kanban-col {
  min-height: 260px;
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.kanban-col h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4d5560;
}

.deal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
}

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

.deal-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.social-module {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.social-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 4px 0 12px;
}

.social-head h2 {
  margin: 0;
  font-size: 20px;
}

.social-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.social-sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.social-sync span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
}

.social-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.social-tabs button {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5b626d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}

.social-tabs button.active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}

.social-tab-panel {
  display: none;
}

.social-tab-panel.active {
  display: block;
}

.social-card {
  margin-bottom: 12px;
}

.social-intent-plan {
  min-height: 220px;
  background: #f9fbfd;
  line-height: 1.6;
}

.keyword-search-shell {
  display: grid;
  gap: 14px;
}

.keyword-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.keyword-search-box {
  min-height: 50px;
  border: 1.5px solid #e2d8ff;
  border-radius: 14px;
  background: #fff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-shadow: 0 1px 0 rgba(127, 76, 255, 0.04);
}

.keyword-search-box svg {
  width: 18px;
  height: 18px;
  color: #9aa3b2;
}

.keyword-search-box .social-input {
  border: 0;
  min-height: 46px;
  padding: 0;
  border-radius: 0;
}

.keyword-analyze-btn {
  min-height: 50px;
  min-width: 142px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8f5bff 0%, #6f48ef 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(111, 72, 239, 0.18);
}

.keyword-analyze-btn:hover {
  background: linear-gradient(135deg, #7e47ff 0%, #5d38d6 100%);
}

.keyword-analyze-btn:disabled {
  cursor: wait;
}

.keyword-analyze-btn.is-loading {
  background: linear-gradient(135deg, #8f5bff 0%, #6f48ef 100%);
  opacity: 0.96;
}

.keyword-analyze-btn .btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.78s linear infinite;
}

.keyword-chip-bank {
  display: grid;
  gap: 12px;
}

.keyword-chip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #39414d;
}

.keyword-chip-head strong {
  font-size: 14px;
  color: #223047;
}

.keyword-chip-head span {
  color: var(--muted);
}

.keyword-chip-head.hot strong {
  color: #4f5d74;
}

.keyword-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-chip-list.hot {
  gap: 12px;
}

.keyword-chip {
  min-height: 34px;
  border: 1px solid #d8e0ef;
  border-radius: 999px;
  background: #f7faff;
  color: #35507a;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}

.keyword-chip span {
  color: #4b8cff;
  font-size: 11px;
  line-height: 1;
}

.keyword-chip.active {
  border-color: #8bb8ff;
  background: #edf4ff;
  color: #1f4e9a;
  box-shadow: inset 0 0 0 1px rgba(69, 128, 255, 0.08);
}

.keyword-chip.hot {
  border-style: dashed;
  background: #fff;
  color: #5a6473;
}

.keyword-chip.hot.active {
  background: #f2f7ff;
  border-style: solid;
}

.social-segment-matrix {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.segment-matrix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.segment-matrix-head h3 {
  margin: 0 0 6px;
  color: #172033;
  font-size: 18px;
}

.segment-matrix-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.segment-matrix-head label {
  min-width: 260px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 7px 10px 9px;
  color: #172033;
  font-size: 12px;
  font-weight: 800;
}

.segment-matrix-head select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172033;
  font-weight: 800;
  margin-top: 2px;
}

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

.segment-card {
  border: 1px solid #dce6f5;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.segment-card:hover,
.segment-card.active {
  border-color: #8bc2ff;
  box-shadow: 0 10px 24px rgba(58, 127, 214, 0.12);
  transform: translateY(-1px);
}

.segment-card.active {
  background: #fbfdff;
}

.segment-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.segment-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.segment-number {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #e5f6ff;
  color: #1594d8;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.segment-card h4 {
  margin: 0 0 5px;
  color: #172033;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-card p {
  margin: 0;
  color: #6d7787;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.segment-view-btn {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #edf4ff;
  color: #2467de;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.segment-delete-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #f0c8c5;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--brand);
  display: inline-grid;
  place-items: center;
}

.segment-delete-btn:hover {
  background: #ffecea;
  border-color: #e4aaa5;
}

.segment-delete-btn svg {
  width: 15px;
  height: 15px;
}

.segment-reason {
  border: 1px solid #d8e8fb;
  border-left: 4px solid #9dc9ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px;
  color: #455163;
  font-size: 13px;
  line-height: 1.65;
}

.segment-reason strong {
  color: #2467de;
}

.segment-query {
  display: none;
}

.social-step {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
  color: #39414d;
  font-weight: 800;
}

.social-step small {
  color: var(--muted);
  font-weight: 500;
}

.social-textarea,
.social-output {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #38404a;
  background: #fff;
  resize: vertical;
  outline: 0;
}

.social-textarea {
  min-height: 96px;
}

.social-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.social-chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #59616d;
  padding: 0 12px;
}

.social-chip.active {
  color: var(--brand-dark);
  background: #fff0ef;
  border-color: #f0d0cc;
}

.social-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.social-form-grid label {
  display: grid;
  gap: 6px;
  color: #4b515b;
  font-size: 13px;
  font-weight: 700;
}

.social-form-grid select,
.social-form-grid input,
.social-input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  outline: 0;
}

.social-api-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr);
  gap: 10px;
}

.social-api-grid label {
  display: grid;
  gap: 6px;
  color: #4b515b;
  font-size: 13px;
  font-weight: 700;
}

.social-api-grid label.wide {
  grid-column: 1 / -1;
}

.social-api-grid input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  outline: 0;
}

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

.social-api-actions span {
  color: var(--muted);
  font-size: 12px;
}

.social-api-actions span[data-state="ready"] {
  color: #0f8c67;
}

.social-api-actions span[data-state="loading"] {
  color: #2a6fbb;
}

.social-api-actions span[data-state="error"] {
  color: var(--brand);
}

.social-form-grid.compact {
  margin-top: 10px;
}

.social-target-grid {
  margin-top: 0;
}

.social-target-grid label {
  font-size: 12px;
}

.social-target-grid select,
.social-target-grid input {
  min-height: 42px;
}

.social-upload {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: 12px;
}

.social-upload-box {
  min-height: 142px;
  border: 1px dashed #d8dce2;
  border-radius: 8px;
  background: #fbfcfd;
  color: #4b515b;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
  padding: 14px;
}

.social-upload-box:hover {
  border-color: var(--brand);
  background: #fff7f6;
}

.social-upload-box svg {
  width: 26px;
  height: 26px;
  color: var(--brand);
}

.social-upload-box strong {
  font-size: 15px;
}

.social-upload-box span {
  max-width: 320px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.social-upload-preview {
  min-height: 142px;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  display: grid;
  place-items: center;
  position: relative;
  padding: 10px;
}

.social-upload-preview img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
}

.social-upload-preview.has-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.social-thumb {
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.social-thumb:hover {
  border-color: #efb3b0;
}

.social-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(189, 47, 42, 0.12);
}

.social-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-upload-empty {
  color: #9aa0a8;
  font-size: 13px;
}

.social-upload-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  border-radius: 999px;
  background: rgba(18, 20, 24, 0.72);
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-image-selected {
  position: absolute;
  top: 7px;
  left: 7px;
  display: none;
  align-items: center;
  gap: 3px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
}

.social-thumb.active .social-image-selected {
  display: inline-flex;
}

.social-image-selected svg {
  width: 12px;
  height: 12px;
}

.social-image-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(25, 28, 34, 0.76);
  color: #fff;
  display: grid;
  place-items: center;
}

.social-image-delete:hover {
  background: var(--brand);
}

.social-image-delete svg {
  width: 14px;
  height: 14px;
}

.platform-image-preview {
  margin-top: 12px;
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.platform-image-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #eef2f6;
}

.platform-image-preview span {
  display: block;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.social-generate-btn {
  min-height: 46px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(189, 47, 42, 0.2);
}

.social-generate-btn:hover {
  background: var(--brand-dark);
}

.social-generate-btn:disabled {
  cursor: wait;
  opacity: 0.76;
}

.social-generate-btn .lucide-loader-2 {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.social-drafts {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.social-draft-head strong,
.social-draft-head div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-draft-head .primary {
  min-height: 32px;
}

.social-draft-head .ghost-btn.is-loading {
  cursor: wait;
  min-width: 92px;
}

.social-draft-head .ghost-btn .lucide-loader-2 {
  width: 15px;
  height: 15px;
  animation: spin 0.8s linear infinite;
}

.social-output {
  min-height: 150px;
  line-height: 1.65;
}

.social-ads-output {
  min-height: 240px;
}

.social-draft-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-align: right;
}

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

.social-schedule-panel {
  display: grid;
  gap: 14px;
}

.social-facebook-config,
.social-linkedin-config,
.social-buffer-config {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.social-buffer-config {
  border-left: 3px solid #2f7d32;
  background: linear-gradient(180deg, #f8fbf9 0%, #ffffff 100%);
}

.facebook-publish-grid {
  grid-template-columns: minmax(240px, 0.9fr) minmax(220px, 0.8fr) minmax(320px, 1.3fr);
}

.buffer-publish-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.buffer-channel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.buffer-channel-summary span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  padding: 7px 10px;
}

.buffer-channel-summary span.ready {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.buffer-channel-summary svg {
  height: 14px;
  width: 14px;
}

.social-tool-btn {
  align-items: center;
  background: #f8fafc;
  border-color: #d8e0ea;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: #253043;
  display: inline-flex;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  min-height: 38px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.social-tool-btn:hover {
  background: #eef4ff;
  border-color: #b9cff5;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.11);
  color: #174ea6;
  transform: translateY(-1px);
}

.social-tool-btn svg {
  height: 17px;
  width: 17px;
}

.social-buffer-config .social-api-actions .ghost-btn {
  background: #f1f7f3;
  border-color: #b7dfc2;
  color: #166534;
}

.social-buffer-config .social-api-actions .ghost-btn:hover {
  background: #e4f7ea;
  border-color: #76c98c;
  color: #14532d;
}

.social-linkedin-config {
  border-left: 3px solid #0a66c2;
}

.linkedin-publish-grid {
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 0.55fr) minmax(260px, 1fr);
}

.social-schedule-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.social-stat {
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: inherit;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  min-height: 82px;
  position: relative;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.social-stat:hover {
  background: #f4f8ff;
  border-color: #b9cff5;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.social-stat.active {
  background: linear-gradient(180deg, #ecfdf3 0%, #ffffff 100%);
  border-color: #68c983;
  box-shadow: 0 10px 22px rgba(22, 101, 52, 0.11);
}

.social-stat-icon {
  align-items: center;
  background: #edf4ff;
  border-radius: 8px;
  color: #2563eb;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
}

.social-stat.active .social-stat-icon {
  background: #dcfce7;
  color: #15803d;
}

.social-stat-icon svg {
  height: 15px;
  width: 15px;
}

.social-stat strong {
  font-size: 26px;
  line-height: 1;
  color: #223046;
}

.social-stat span {
  color: var(--muted);
  font-size: 12px;
}

.social-schedule-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.social-schedule-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.social-schedule-filters label.wide {
  grid-column: span 1;
}

.social-schedule-filters select,
.social-schedule-filters input {
  min-height: 40px;
  border-radius: 8px;
}

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

.social-empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfd;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.social-schedule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.social-schedule-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.social-schedule-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.social-schedule-platform svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.social-schedule-platform strong {
  font-size: 14px;
}

.social-schedule-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.social-publish-btn {
  background: linear-gradient(180deg, #eaf3ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.social-publish-btn:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.social-delete-btn {
  background: linear-gradient(180deg, #fff7f7 0%, #fee2e2 100%);
  border-color: #fecaca;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.08);
  color: #b91c1c;
}

.social-delete-btn:hover {
  background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.14);
  color: #991b1b;
}

.social-schedule-actions button:disabled .lucide-loader-2 {
  animation: spin 0.9s linear infinite;
}

.social-schedule-output {
  min-height: 140px;
}

.social-schedule-image {
  display: grid;
  grid-template-columns: minmax(0, 240px) 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.social-schedule-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 627;
  object-fit: cover;
  border-radius: 6px;
}

.social-schedule-image span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.social-schedule-image svg {
  width: 16px;
  height: 16px;
}

.social-schedule-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.social-schedule-meta label {
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  padding: 9px;
}

.social-schedule-meta input {
  background: #f9fbfd;
  border-color: #cfdae6;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  color: #172033;
  min-height: 38px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.social-schedule-meta input:focus {
  background: #fff;
  border-color: #8ab4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.social-schedule-meta input[readonly] {
  background: #f3f7fb;
  color: #475569;
}

.social-schedule-foot {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 9px 10px;
}

.social-schedule-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.social-schedule-error {
  border: 1px solid #f4c3c0;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--brand-dark);
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.leads-module {
  display: grid;
  gap: 14px;
}

.social-comment-panel,
.lead-comment-panel {
  border-left: 3px solid #0a66c2;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.lead-comment-summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.lead-comment-summary div {
  align-items: baseline;
  display: inline-flex;
  gap: 8px;
}

.lead-comment-summary strong {
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.lead-comment-summary span,
.lead-comment-summary p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.lead-comment-status {
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f7fbff;
  color: #45617d;
  font-size: 13px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.lead-comment-status[data-state="ready"] {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.lead-comment-status[data-state="error"] {
  background: #fff7f6;
  border-color: #f4c3c0;
  color: var(--brand-dark);
}

.lead-comment-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1fr);
  margin-bottom: 12px;
  padding: 12px;
}

.lead-comment-form label {
  color: #475569;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.lead-comment-form label.wide {
  grid-column: 1 / -1;
}

.lead-comment-form input,
.lead-comment-form select,
.lead-comment-form textarea {
  background: #fff;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  color: #172033;
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}

.lead-comment-form textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

.lead-comment-form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

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

.lead-comment-card {
  background: #fff;
  border: 1px solid #dce6f5;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.lead-comment-card.lead-view {
  border-left: 3px solid #bd2f2a;
}

.lead-comment-top {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lead-comment-identity {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-comment-identity strong {
  color: #172033;
  font-size: 15px;
}

.lead-comment-platform {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
}

.lead-comment-platform svg {
  height: 14px;
  width: 14px;
}

.lead-comment-platform.linkedin {
  background: #eaf3ff;
  color: #0a66c2;
}

.lead-comment-platform.facebook {
  background: #eef4ff;
  color: #2563eb;
}

.lead-comment-platform.x {
  background: #f1f5f9;
  color: #111827;
}

.lead-comment-card p {
  color: #263244;
  line-height: 1.65;
  margin: 0;
}

.lead-comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-comment-meta span,
.lead-comment-source {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
}

.lead-comment-meta svg,
.lead-comment-source svg {
  height: 13px;
  width: 13px;
}

.lead-comment-delete {
  align-items: center;
  border-color: #fecaca;
  color: #b91c1c;
  display: inline-flex;
  gap: 5px;
  min-height: 32px;
}

.lead-comment-delete:hover {
  background: #fff1f1;
  border-color: #fca5a5;
}

@media (max-width: 720px) {
  .social-schedule-image {
    grid-template-columns: 1fr;
  }

  .lead-comment-summary,
  .lead-comment-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-comment-form {
    grid-template-columns: 1fr;
  }
}

.deal-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(18, 20, 24, 0.36);
}

.modal-card {
  width: min(680px, calc(100vw - 28px));
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  padding: 18px;
}


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

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

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: #4b515b;
  font-size: 13px;
  font-weight: 700;
}

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

.form-grid textarea {
  min-height: 86px;
  resize: vertical;
}

.modal-actions {
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .sidebar {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .brand {
    min-width: 150px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-sub,
  .user-chip span {
    display: none;
  }

  .nav {
    width: 100%;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 9px;
  }

  .two-col,
  .quick-grid,
  .metric-grid.four,
  .dashboard-kpis,
  .analytics-grid,
  .kanban,
  .segment-grid {
    grid-template-columns: 1fr;
  }

  .segment-matrix-head {
    flex-direction: column;
  }

  .segment-matrix-head label {
    width: 100%;
    min-width: 0;
  }

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

@media (max-width: 720px) {
  .sidebar {
    position: sticky;
    padding: 8px 12px 0;
  }

  .brand {
    border-bottom: 0;
    padding-bottom: 6px;
  }

  .brand > div:last-child {
    display: block;
  }

  .nav {
    overflow-x: auto;
    margin-top: 0;
  }

  .nav-item {
    min-width: auto;
    justify-content: flex-start;
    padding: 0 8px;
    font-size: 12px;
  }

  .main {
    padding: 14px;
  }

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

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

  .metric-grid.two,
  .metric-grid.three,
  .fx-grid,
  .clock-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 720px;
  }

  .table-wrap {
    overflow-x: auto;
  }
}

