:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #747474;
  --line: #e7e7e2;
  --dark: #242424;
  --orange: #f37021;
  --green: #17a88f;
  --red: #d93025;
  --shadow: 0 18px 45px rgba(0,0,0,.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244,244,242,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

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

.brand b {
  display: block;
  font-size: 14px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

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

.user-pill {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.ghost-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.tabs {
  position: sticky;
  top: 59px;
  z-index: 9;
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(244,244,242,.94);
  border-bottom: 1px solid var(--line);
}

.tabs a {
  flex: 0 0 auto;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.content {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 14px 12px 42px;
}

.hero {
  background: linear-gradient(135deg, #252525, #151515);
  color: #fff;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1;
}

.hero p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.72);
  line-height: 1.45;
}

.primary,
.secondary,
.btn,
button {
  appearance: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #111;
  border-radius: 16px;
  padding: 14px 17px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(243,112,33,.25);
}

.primary.small {
  white-space: nowrap;
  padding: 12px 14px;
  border-radius: 999px;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
}

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

.quick-grid a {
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
}

.quick-grid b {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.quick-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 10px;
}

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

.section-head span {
  color: var(--muted);
  font-weight: 900;
}

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

.lead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.05);
}

.lead-card.is-hot {
  border-color: rgba(243,112,33,.45);
  box-shadow: 0 18px 44px rgba(243,112,33,.12);
}

.lead-card.is-overdue {
  border-color: rgba(217,48,37,.45);
}

.lead-card-main {
  display: block;
  padding: 17px;
  text-decoration: none;
}

.lead-topline {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-badge,
.danger-badge,
.today-badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.status-badge {
  background: #f0f0ec;
  color: #333;
}

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

.today-badge {
  background: #e8fbf7;
  color: var(--green);
}

.lead-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
}

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

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

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.next-action {
  margin-top: 12px;
  padding: 11px 12px;
  background: #f8f8f5;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
}

.comment-preview {
  color: #444;
}

.card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.btn {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  font-weight: 900;
}

.btn.call {
  background: var(--orange);
  color: #111;
}

.empty {
  background: #fff;
  border: 1px dashed #d6d6d0;
  color: var(--muted);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

.login-card,
.form-card,
.lead-detail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 420px;
  margin: 40px auto;
}

.login-card h1,
.form-card h1,
.lead-detail h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.05;
}

.form {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.form label {
  font-size: 13px;
  font-weight: 900;
  color: #333;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  font: inherit;
  background: #fbfbf8;
  outline: none;
}

textarea {
  resize: vertical;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 14px 0;
}

.search button {
  background: var(--dark);
  color: #fff;
  border-radius: 15px;
  padding: 0 16px;
  font-weight: 900;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.call-big {
  white-space: nowrap;
}

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

.info-grid div {
  padding: 13px;
  background: #f8f8f5;
  border-radius: 16px;
}

.info-grid b {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.info-grid span {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.note {
  margin-top: 12px;
  padding: 15px;
  background: #fff8ec;
  border-radius: 16px;
  line-height: 1.45;
}

.note p {
  margin: 8px 0 0;
}

.actions-panel {
  margin-top: 18px;
}

.actions-panel h2,
.form-card h2,
.history h2 {
  margin: 0 0 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.action-btn {
  width: 100%;
  min-height: 52px;
  background: #252525;
  color: #fff;
  border-radius: 16px;
  padding: 12px;
  font-weight: 900;
  line-height: 1.15;
}

.form-card {
  margin-top: 16px;
}

.history {
  margin-top: 18px;
}

.history-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}

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

.history-item p {
  margin: 10px 0 0;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .content {
    padding: 12px 10px 32px;
  }

  .hero {
    border-radius: 20px;
    padding: 18px;
  }

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

  .info-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-head {
    display: block;
  }

  .call-big {
    margin-top: 14px;
    width: 100%;
  }

  .topbar {
    padding-right: 8px;
  }

  .brand small {
    display: none;
  }

  .user-pill {
    display: none;
  }
}

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

  .card-buttons {
    grid-template-columns: 1fr;
  }
}

.btn.disabled {
  background: #f1f1ed;
  color: #8a8a8a;
  cursor: default;
}

.lead-card.is-hot .btn.call {
  font-size: 18px;
  min-height: 58px;
}

@media (max-width: 720px) {
  .btn {
    min-height: 56px;
    font-size: 17px;
  }

  .btn.call {
    font-size: 18px;
  }
}

/* === Svetlana mobile calls mode === */
.calls-hero {
  background: linear-gradient(135deg, #242424, #111);
  color: #fff;
  border-radius: 26px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow);
}

.calls-hero h1 {
  margin: 0;
  font-size: clamp(32px, 9vw, 54px);
  line-height: .95;
}

.calls-hero p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.72);
  line-height: 1.4;
}

.calls-counter {
  min-width: 64px;
  height: 64px;
  border-radius: 22px;
  background: var(--orange);
  color: #111;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
}

.calls-section {
  margin-top: 20px;
}

.calls-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.call-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,.06);
}

.call-card.is-overdue {
  border-color: rgba(217,48,37,.35);
  box-shadow: 0 16px 38px rgba(217,48,37,.12);
}

.call-status-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.call-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
}

.call-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.call-main-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

.call-phone,
.call-site {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
}

.call-phone {
  background: var(--orange);
  color: #111;
}

.call-phone.disabled {
  background: #eee;
  color: #777;
}

.call-site {
  background: #242424;
  color: #fff;
}

.call-info {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.call-info div {
  background: #f7f7f5;
  border-radius: 16px;
  padding: 12px;
}

.call-info b,
.call-info span {
  display: block;
}

.call-info b {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.call-comment {
  background: #fff7f1;
  border: 1px solid #f4d7c3;
  border-radius: 18px;
  padding: 13px;
  line-height: 1.45;
  margin: 12px 0;
}

.call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.call-action-form {
  margin: 0;
}

.call-action {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  background: #f1f1ee;
  color: #111;
  font-weight: 900;
  font-size: 15px;
}

.call-action.good {
  background: #dff7ef;
}

.call-action.accent {
  background: var(--orange);
}

.call-action.danger {
  background: #ffe4e1;
  color: #9b1c12;
}

.call-note-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.call-note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
}

.call-note-form button {
  min-height: 48px;
  border-radius: 16px;
  background: #242424;
  color: #fff;
  font-weight: 900;
}

.call-open {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 760px) {
  .call-main-buttons {
    grid-template-columns: 2fr 1fr;
  }

  .call-actions {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* === CRM email editor === */
.email-editor textarea {
  min-height: 520px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.email-links-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: #f7f7f5;
  border: 1px solid var(--line);
}

.email-links-preview b {
  margin-bottom: 4px;
}

.email-links-preview a {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: #242424;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.action-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 16px;
  background: #242424;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  text-align: center;
  padding: 10px 12px;
}

@media (min-width: 760px) {
  .price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.manual-email-warning {
  padding: 16px;
  border-radius: 18px;
  background: #fff7f1;
  border: 1px solid #f4d7c3;
  line-height: 1.45;
}

.manual-email-warning b {
  display: block;
  margin-bottom: 6px;
}

.manual-email-warning p {
  margin: 6px 0 0;
}

/* === Svetlana call planning === */
.call-plan-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #f7f7f5;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.call-plan-form label {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.call-plan-form input,
.call-plan-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
}

.call-plan-form button {
  min-height: 48px;
  border-radius: 16px;
  background: var(--orange);
  color: #111;
  font-weight: 900;
}

/* === Svetlana call planning === */
.call-plan-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #f7f7f5;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.call-plan-form label {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.call-plan-form input,
.call-plan-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
}

.call-plan-form button {
  min-height: 48px;
  border-radius: 16px;
  background: var(--orange);
  color: #111;
  font-weight: 900;
}

.call-result-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 760px) {
  .call-result-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* === Call result form === */
.call-result-card textarea,
.call-result-card input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
}

.call-result-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.action-link.good {
  background: #dff7ef;
  color: #111;
}

.call-action.good {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 760px) {
  .call-result-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================
   PTK CRM — premium internal redesign layer
   Safe override layer. Added after base styles.
   ========================================================= */

:root {
  --crm-bg: #ecebe7;
  --crm-bg-deep: #1f2022;
  --crm-bg-deeper: #151618;
  --crm-card: #ffffff;
  --crm-card-soft: #f8f7f3;
  --crm-text: #1d1d1f;
  --crm-muted: #77736b;
  --crm-line: rgba(35, 35, 35, .10);
  --crm-line-strong: rgba(35, 35, 35, .16);
  --crm-orange: #f37021;
  --crm-orange-dark: #d95d13;
  --crm-green: #14957f;
  --crm-red: #c9352b;
  --crm-red-soft: #fff0ee;
  --crm-shadow-soft: 0 18px 50px rgba(18, 18, 18, .08);
  --crm-shadow-card: 0 14px 34px rgba(18, 18, 18, .075);
  --crm-shadow-hero: 0 24px 70px rgba(0, 0, 0, .18);
  --crm-radius-lg: 28px;
  --crm-radius-md: 20px;
  --crm-radius-sm: 14px;
}

html {
  background: var(--crm-bg);
}

body {
  background:
    radial-gradient(circle at 14% -10%, rgba(243, 112, 33, .16), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(20, 149, 127, .12), transparent 30%),
    linear-gradient(180deg, #f2f1ec 0%, #ecebe7 42%, #e7e5df 100%);
  color: var(--crm-text);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  letter-spacing: -.01em;
}

a {
  text-underline-offset: 3px;
}

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

/* Верхняя панель */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  padding: 12px max(14px, calc((100vw - 1180px) / 2));
  background:
    linear-gradient(135deg, rgba(37, 38, 40, .98), rgba(18, 19, 20, .98));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
}

.brand {
  color: #fff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--crm-orange), #ff9a4d);
  color: #1c130d;
  box-shadow: 0 12px 28px rgba(243, 112, 33, .32);
  letter-spacing: -.04em;
}

.brand b {
  color: #fff;
  font-size: 15px;
  letter-spacing: -.02em;
}

.brand small {
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
}

.top-actions {
  gap: 10px;
}

.user-pill {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.ghost-link {
  color: rgba(255, 255, 255, .58);
}

.ghost-link:hover {
  color: #fff;
}

/* Навигация */

.tabs {
  top: 68px;
  z-index: 25;
  padding: 12px max(14px, calc((100vw - 1180px) / 2));
  background: rgba(236, 235, 231, .86);
  border-bottom: 1px solid rgba(35, 35, 35, .08);
  backdrop-filter: blur(18px);
}

.tabs a {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(35, 35, 35, .10);
  color: #282828;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .035);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.tabs a:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: rgba(243, 112, 33, .35);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .065);
}

/* Общая ширина */

.content {
  width: min(1180px, 100%);
  padding: 22px 14px 56px;
}

/* Главная шапка */

.hero,
.calls-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(243, 112, 33, .36), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(23, 168, 143, .18), transparent 30%),
    linear-gradient(135deg, #2b2c2f 0%, #17181a 62%, #101113 100%);
  color: #fff;
  border-radius: 32px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: var(--crm-shadow-hero);
}

.hero::after,
.calls-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(243, 112, 33, .22), transparent 62%);
  pointer-events: none;
}

.hero h1,
.calls-hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -.055em;
}

.hero p,
.calls-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, .70);
  font-size: 15px;
}

.calls-counter {
  min-width: 62px;
  height: 62px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 24px;
  font-weight: 950;
}

/* Кнопки */

.primary,
.secondary,
.btn,
button,
.action-btn,
.action-link,
.call-action,
.call-open {
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease, opacity .14s ease;
}

.primary {
  background: linear-gradient(135deg, var(--crm-orange), #ff9a4d);
  color: #17110c;
  border-radius: 18px;
  font-weight: 950;
  box-shadow: 0 16px 36px rgba(243, 112, 33, .28);
}

.primary:hover,
.btn.call:hover,
.call-phone:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(243, 112, 33, .34);
}

.secondary,
.btn.secondary {
  background: #fff;
  color: #242424;
  border: 1px solid rgba(35, 35, 35, .12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .035);
}

.secondary:hover,
.btn.secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 35, 35, .20);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

.btn.disabled,
.call-phone.disabled {
  opacity: .48;
  cursor: default;
  pointer-events: none;
}

/* Быстрые счетчики */

.quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.quick-grid a {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(35, 35, 35, .09);
  box-shadow: var(--crm-shadow-card);
}

.quick-grid a::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(243, 112, 33, .08);
}

.quick-grid a:hover {
  transform: translateY(-1px);
  border-color: rgba(243, 112, 33, .28);
}

.quick-grid b {
  font-size: 32px;
  letter-spacing: -.05em;
}

.quick-grid span {
  color: var(--crm-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .045em;
}

/* Секции */

.section {
  margin-top: 26px;
}

.section-head {
  margin: 0 2px 12px;
  padding: 0 2px;
}

.section-head h2 {
  font-size: 22px;
  letter-spacing: -.035em;
}

.section-head span {
  color: var(--crm-muted);
}

/* Карточки клиентов */

.cards {
  gap: 14px;
}

.lead-card {
  position: relative;
  border-radius: 26px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(35, 35, 35, .10);
  box-shadow: var(--crm-shadow-card);
  overflow: hidden;
}

.lead-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(35, 35, 35, .16);
}

.lead-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 46px rgba(18, 18, 18, .10);
}

.lead-card-main {
  padding: 20px 20px 18px 24px;
}

.lead-card h3 {
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -.045em;
  line-height: 1.04;
}

.lead-card p {
  color: #46423c;
}

.lead-meta {
  color: var(--crm-muted);
  font-size: 13px;
}

.next-action {
  background:
    linear-gradient(180deg, rgba(248, 247, 243, .98), rgba(243, 242, 237, .98));
  border: 1px solid rgba(35, 35, 35, .08);
  border-radius: 17px;
  padding: 13px 14px;
}

.comment-preview {
  color: #403d38;
}

/* Горящие и просроченные */

.lead-card.is-hot {
  border-color: rgba(243, 112, 33, .42);
  box-shadow: 0 18px 48px rgba(243, 112, 33, .14);
}

.lead-card.is-hot::before {
  background: linear-gradient(180deg, #ff9a4d, var(--crm-orange));
}

.lead-card.is-overdue {
  border-color: rgba(201, 53, 43, .48);
  background:
    linear-gradient(90deg, rgba(255, 240, 238, .82), rgba(255, 255, 255, .96) 28%);
  box-shadow: 0 20px 52px rgba(201, 53, 43, .12);
}

.lead-card.is-overdue::before {
  width: 7px;
  background: linear-gradient(180deg, #e64c3f, #a82720);
}

/* Бейджи */

.status-badge,
.danger-badge,
.today-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .045em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-badge {
  background: #efeee9;
  color: #393630;
  border-color: rgba(35, 35, 35, .08);
}

.danger-badge {
  background: var(--crm-red-soft);
  color: var(--crm-red);
  border-color: rgba(201, 53, 43, .18);
}

.today-badge {
  background: #e8fbf7;
  color: var(--crm-green);
  border-color: rgba(20, 149, 127, .18);
}

/* Нижние кнопки карточки */

.card-buttons {
  background: rgba(35, 35, 35, .08);
  border-top: 1px solid rgba(35, 35, 35, .08);
}

.btn {
  min-height: 48px;
  align-items: center;
  color: #242424;
}

.btn.call {
  background: linear-gradient(135deg, var(--crm-orange), #ff9a4d);
  color: #17110c;
}

.btn:hover {
  filter: brightness(.99);
}

/* Пустые состояния */

.empty {
  background: rgba(255, 255, 255, .72);
  border: 1px dashed rgba(35, 35, 35, .20);
  color: var(--crm-muted);
  border-radius: 22px;
  padding: 22px;
}

/* Формы и детальная карточка */

.login-card,
.form-card,
.lead-detail,
.actions-panel,
.history {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(35, 35, 35, .10);
  border-radius: 28px;
  box-shadow: var(--crm-shadow-soft);
}

.form-card,
.lead-detail {
  padding: clamp(20px, 3vw, 28px);
}

.lead-detail {
  display: grid;
  gap: 18px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(35, 35, 35, .08);
}

.detail-head h1,
.form-card h1,
.login-card h1,
.lead-detail h1 {
  letter-spacing: -.055em;
}

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

.info-grid > div {
  min-height: 74px;
  padding: 14px;
  border-radius: 18px;
  background: var(--crm-card-soft);
  border: 1px solid rgba(35, 35, 35, .075);
}

.info-grid b {
  display: block;
  margin-bottom: 7px;
  color: #2e2b27;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.info-grid span {
  display: block;
  color: #37332e;
  line-height: 1.35;
  word-break: break-word;
}

.note {
  padding: 18px;
  border-radius: 22px;
  background: #fff7f1;
  border: 1px solid rgba(243, 112, 33, .16);
}

.note b {
  display: block;
  margin-bottom: 8px;
}

.note p {
  margin: 0;
  line-height: 1.55;
}

.actions-panel {
  padding: 20px;
}

.actions-panel h2,
.form-card h2,
.history h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -.035em;
}

.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-grid form {
  margin: 0;
}

.action-btn,
.action-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  border-radius: 999px;
  background: #242424;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
}

.action-link.good {
  background: linear-gradient(135deg, var(--crm-green), #22c2a8);
  color: #081713;
}

.action-btn:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.action-grid form:last-child .action-btn,
.call-action.danger {
  background: #fff;
  color: var(--crm-red);
  border: 1px solid rgba(201, 53, 43, .26);
  box-shadow: none;
}

/* Поля */

.form {
  gap: 12px;
}

.form label {
  color: #2f2c28;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .045em;
}

input,
textarea,
select {
  background: #fbfaf7;
  border: 1px solid rgba(35, 35, 35, .12);
  border-radius: 17px;
  color: #252525;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(243, 112, 33, .52);
  box-shadow: 0 0 0 4px rgba(243, 112, 33, .12);
}

textarea {
  line-height: 1.5;
}

/* Поиск */

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 12px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(35, 35, 35, .09);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .045);
}

.search input {
  background: #fff;
}

.search button {
  padding: 0 18px;
  border-radius: 16px;
  background: #242424;
  color: #fff;
  font-weight: 900;
}

/* История */

.history {
  padding: 20px;
}

.history-item {
  padding: 15px 0;
  border-top: 1px solid rgba(35, 35, 35, .08);
}

.history-item:first-of-type {
  border-top: 0;
}

.history-item small {
  color: var(--crm-muted);
}

.history-item p {
  margin: 8px 0 0;
  color: #403d38;
  line-height: 1.5;
}

/* Личный кабинет */

.client-cabinet-panel-marker {
  background:
    radial-gradient(circle at 100% 0%, rgba(243, 112, 33, .10), transparent 32%),
    rgba(255, 255, 255, .94);
  border-color: rgba(243, 112, 33, .22);
}

.client-cabinet-panel-marker h2::before {
  content: "↗ ";
  color: var(--crm-orange);
}

/* Страница звонков */

.calls-section {
  margin-top: 24px;
}

.calls-section h2 {
  margin: 0 0 12px;
  font-size: 23px;
  letter-spacing: -.04em;
}

.call-card {
  position: relative;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(35, 35, 35, .10);
  box-shadow: var(--crm-shadow-card);
}

.call-card.is-overdue {
  border-color: rgba(201, 53, 43, .44);
  background:
    linear-gradient(90deg, rgba(255, 240, 238, .88), rgba(255,255,255,.96) 35%);
}

.call-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.call-status-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.call-card h2 {
  margin: 0;
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: -.055em;
  line-height: 1.04;
}

.call-card-head p {
  margin: 8px 0 0;
  color: var(--crm-muted);
}

.call-main-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.call-phone,
.call-site {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 18px;
  text-decoration: none;
  font-weight: 950;
}

.call-phone {
  background: linear-gradient(135deg, var(--crm-orange), #ff9a4d);
  color: #17110c;
}

.call-site {
  background: #242424;
  color: #fff;
}

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

.call-info > div {
  padding: 13px;
  border-radius: 17px;
  background: var(--crm-card-soft);
  border: 1px solid rgba(35, 35, 35, .075);
}

.call-info b {
  display: block;
  margin-bottom: 5px;
  color: #2f2c28;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.call-info span {
  color: #393630;
  word-break: break-word;
}

.call-comment {
  margin-top: 14px;
  padding: 15px;
  border-radius: 18px;
  background: #fff7f1;
  border: 1px solid rgba(243, 112, 33, .14);
  line-height: 1.5;
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.call-action {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  background: #242424;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  font-size: 13px;
}

.call-action.good {
  background: linear-gradient(135deg, var(--crm-green), #22c2a8);
  color: #081713;
}

.call-action.accent {
  background: linear-gradient(135deg, var(--crm-orange), #ff9a4d);
  color: #17110c;
}

.call-action.muted {
  background: #efeee9;
  color: #333;
}

.call-action.danger {
  background: #fff;
  color: var(--crm-red);
}

.call-plan-form,
.call-note-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: #f8f7f3;
  border: 1px solid rgba(35, 35, 35, .08);
}

.call-plan-form {
  display: grid;
  gap: 10px;
}

.call-note-form {
  display: grid;
  gap: 10px;
}

.call-plan-form label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.call-plan-form button,
.call-note-form button {
  min-height: 44px;
  border-radius: 16px;
  background: #242424;
  color: #fff;
  font-weight: 900;
}

.call-open {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  min-height: 46px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid rgba(35, 35, 35, .12);
  color: #242424;
  font-weight: 950;
  text-decoration: none;
}

/* Ручное письмо / цены */

.manual-email-warning {
  padding: 16px;
  border-radius: 20px;
  background: #fff7f1;
  border: 1px solid rgba(243, 112, 33, .18);
}

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

/* Мобильная версия */

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding: 10px 12px;
  }

  .brand small {
    display: none;
  }

  .user-pill {
    display: none;
  }

  .tabs {
    top: 62px;
    padding: 10px 12px;
  }

  .content {
    padding: 14px 10px 40px;
  }

  .hero,
  .calls-hero {
    border-radius: 26px;
    flex-direction: column;
  }

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

  .quick-grid a {
    min-height: 84px;
    padding: 15px;
  }

  .detail-head {
    display: grid;
  }

  .info-grid,
  .call-info,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .action-grid,
  .call-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-grid form,
  .action-btn,
  .action-link,
  .call-action,
  .call-actions form {
    width: 100%;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .search button {
    min-height: 46px;
  }

  .call-main-buttons {
    grid-template-columns: 1fr;
  }

  .card-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .top-actions {
    gap: 6px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .brand b {
    font-size: 13px;
  }

  .tabs a {
    padding: 9px 11px;
    font-size: 12px;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .quick-grid b {
    font-size: 26px;
  }

  .lead-card-main {
    padding: 18px;
  }

  .form-card,
  .lead-detail,
  .actions-panel,
  .history,
  .call-card {
    border-radius: 24px;
    padding: 18px;
  }
}

/* PTK CRM — brand header refinement */

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand b {
  font-size: 15px;
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: -.025em;
}

.brand small {
  font-size: 11px;
  line-height: 1.15;
  color: rgba(255, 255, 255, .62);
  font-weight: 700;
  letter-spacing: .01em;
}

.brand-mark {
  font-size: 14px;
}

@media (max-width: 620px) {
  .brand b {
    font-size: 12.5px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand small {
    font-size: 10px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 390px) {
  .brand b {
    max-width: 170px;
  }

  .brand small {
    max-width: 170px;
  }
}

/* Email preview actions as real CRM buttons */
.action-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.action-btn-link:hover {
  text-decoration: none;
}

