:root {
  --ink: #1f283e !important;
  --gold: #e62337 !important;
  --line: #e4e6eb !important;
  --cream: #f5f5f7 !important;
  --brand-red: #e62337;
  --brand-burgundy: #b01825;
  --brand-navy: #1f283e;
}

.crm-deal {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px 16px;
  max-width: 620px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  background: #fff;
}

.crm-deal span {
  color: #7e8899;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.crm-deal strong {
  color: #172642;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.crm-deal a {
  width: fit-content;
  color: #e9273f;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.crm-deal a:hover { text-decoration: underline; }

.crm-deal a.crm-deal-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  padding: 8px 12px 8px 8px;
  border-radius: 10px;
  background: #172642;
  color: #fff;
  text-decoration: none;
}

.crm-deal-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.crm-deal-link b { font-size: 12px; }
.crm-deal-link i { font-size: 14px; font-style: normal; }
.crm-deal a.crm-deal-link:hover { background: #243657; text-decoration: none; }

@media (min-width: 901px) {
  .case-title {
    align-items: flex-start;
    gap: 30px;
  }

  .case-title > div:first-child {
    min-width: 0;
    flex: 1;
  }

  .case-title-side {
    display: grid;
    width: min(420px, 38vw);
    justify-items: end;
    gap: 9px;
  }

  .case-title-side .case-status { margin: 0; }

  .case-title-side .crm-deal {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px;
    gap: 3px;
  }

  .case-title-side .crm-deal strong {
    font-size: 14px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .case-title-side .crm-deal-link {
    padding: 6px 10px 6px 7px;
  }

  .case-title-side .crm-deal-link img {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 900px) {
  .case-title-side { margin-top: 14px; }
  .case-title-side .case-status { display: inline-block; margin: 0 0 10px; }
}

.case-main .case-card:first-child { padding: 18px 22px; }
.case-main .case-card:first-child .case-data { margin-top: 12px; gap: 8px 24px; }
.case-main .case-card:first-child .case-data > div { padding-top: 9px; }
.case-main .case-card:first-child .case-data dt { margin-bottom: 4px; }
.case-main .case-card:first-child .case-data dd { line-height: 1.3; }
.case-main .case-card:first-child .case-data a { color: #172642; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.detail-panel a.amo-partner-card-button {
  display: inline-grid;
  gap: 2px;
  min-width: 230px;
  padding: 12px 18px;
  border: 1px solid #ff4459;
  border-radius: 11px;
  background: linear-gradient(180deg, #ff4057 0%, #e91835 100%);
  box-shadow: 0 5px 0 #a80f25, 0 10px 18px rgba(194, 21, 48, .25);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.amo-partner-card-button span { font-size: 13px; }
.amo-partner-card-button small { color: rgba(255,255,255,.78); font-size: 10px; font-weight: 700; }
.detail-panel a.amo-partner-card-button:hover { filter: brightness(1.05); }
.detail-panel a.amo-partner-card-button:active {
  box-shadow: 0 1px 0 #a80f25, 0 4px 9px rgba(194, 21, 48, .2);
  transform: translateY(4px);
}
.detail-panel a.amo-partner-card-button:focus-visible { outline: 3px solid rgba(233,39,63,.28); outline-offset: 4px; }

@media (max-width: 640px) {
  .crm-deal { margin-top: 14px; padding: 12px 14px; }
  .crm-deal strong { font-size: 15px; }
}

@media (max-width: 720px) {
  .content > .stats {
    display: none;
  }

  .content > .welcome {
    margin-bottom: 20px;
  }
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #f5f5f7;
  color: var(--brand-navy);
  max-width: 100%;
  overflow-x: hidden;
}

.logo {
  display: block;
  width: 174px;
  height: 42px;
  background: url("/lireate-logo.svg") left center / contain no-repeat;
  font-size: 0;
  letter-spacing: 0;
}

.logo span,
.logo b {
  display: none !important;
}

.login-brand,
.admin-top,
.check-top,
.case-top {
  background: var(--brand-navy) !important;
}

.shell aside {
  background: #f1f2f5 !important;
  color: #5f6878;
  border-right: 1px solid #dde0e6;
}

.login-brand .logo,
.admin-top .logo,
.check-top .logo,
.case-top .logo {
  filter: brightness(0) invert(1);
}

.shell aside .logo {
  filter: none;
}

.overline,
.section-number,
.panel-head a,
.text-button,
.application-card summary,
.case-error a,
.dropzone span {
  color: var(--brand-red) !important;
}

.auth-tabs button.active,
.auth-tabs a.active,
.shell nav a.active {
  border-color: var(--brand-red) !important;
}

.shell nav a.active {
  background: #fff !important;
}

.shell nav a {
  display: block;
  box-sizing: border-box;
  color: #4f596a;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}

.shell nav a:hover {
  background: #e5e7ec;
  color: var(--brand-navy);
}

.shell nav a.active {
  color: var(--brand-navy);
  box-shadow: 0 5px 18px rgba(31, 40, 62, .07);
}

.shell .aside-bottom,
.shell .aside-bottom a,
.shell .aside-bottom button {
  color: #667080;
}

.shell .aside-bottom a:hover,
.shell .aside-bottom button:hover {
  color: var(--brand-red);
}

.account-menu { position: relative; }
.account-trigger {
  padding: 9px 13px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
  color: #172642;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.account-trigger::after { content: "⌄"; margin-left: 8px; color: #8b94a2; }
.account-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #e1e5eb;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(23,38,66,.16);
}
.account-dropdown a,.account-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #172642;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-dropdown a:hover,.account-dropdown button:hover { background: #f2f4f7; }
.account-dropdown #logout { color: #c71932; }

.shell nav i,
.login form button,
.welcome button,
.admin-title > button,
.save,
.form-actions button,
#success button,
.conversation form button,
.application-success button {
  background: var(--brand-red) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(230, 35, 55, .18);
}

.login form button:hover,
.welcome button:hover,
.admin-title > button:hover,
.save:hover,
.form-actions button:hover,
#success button:hover,
.conversation form button:hover,
.application-success button:hover {
  background: var(--brand-burgundy) !important;
}

.panel,
.form-card,
.case-card,
dialog {
  border-radius: 12px !important;
  box-shadow: 0 8px 30px rgba(31, 40, 62, .045);
}

.case-row:hover,
.row:hover {
  background: #fff7f8 !important;
}

.types input:checked + span {
  border-color: var(--brand-red) !important;
  background: #fff5f6 !important;
  box-shadow: 0 0 0 1px var(--brand-red) !important;
}

.funnel-step.done:before,
.funnel-step.current:before,
.funnel-step.done:after {
  background: var(--brand-red) !important;
}

.funnel-step.current:after {
  background: var(--brand-navy) !important;
}

.stage-history span + span:before,
.result-document {
  border-color: var(--brand-red) !important;
}

.message.mine {
  background: var(--brand-navy) !important;
}

.client-message.staff {
  background: #fff0f2 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 3px rgba(230, 35, 55, .11);
  outline: none;
}

@media (max-width: 720px) {
  .login {
    display: block !important;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .login-brand {
    min-height: 300px !important;
    padding: 28px 24px !important;
    justify-content: flex-start !important;
  }

  .logo {
    width: 142px;
    height: 34px;
  }

  .login-brand .logo {
    display: block !important;
    margin: 0 0 52px !important;
  }

  .login-brand h1 {
    margin: 12px 0 0 !important;
    max-width: 330px;
    font-size: 32px !important;
    line-height: 1.08 !important;
  }

  .login-brand .overline {
    margin: 0;
    font-size: 9px !important;
  }

  .login-side,
  .registration-side {
    display: block !important;
    width: 100%;
    min-width: 0;
    padding: 28px 20px 44px !important;
  }

  .auth-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    margin: 0 0 28px !important;
  }

  .auth-tabs button,
  .auth-tabs a {
    min-width: 0;
    padding: 12px 6px !important;
    font-size: 14px;
    white-space: nowrap;
  }

  .login form,
  .registration-side form,
  .application-success {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
  }

  .login h2,
  .application-success h2 {
    max-width: 100%;
    font-size: 28px !important;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .login .hint,
  .login .help,
  .application-success p {
    max-width: 100%;
    font-size: 13px !important;
    overflow-wrap: anywhere;
  }

  .login label,
  .login input,
  .registration-side select,
  .registration-side textarea,
  .login form button {
    max-width: 100%;
    min-width: 0;
  }

  .application-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }
}
