@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700;800;900&display=swap");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Noto Sans Lao",
    system-ui,
    -apple-system,
    sans-serif;
  background: #f5f7fb;
  color: #172033;
}

button,
input,
select,
textarea {
  font-family:
    "Noto Sans Lao",
    system-ui,
    -apple-system,
    sans-serif;
}

a {
  color: #3157d5;
  text-decoration: none;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(20, 35, 70, 0.06);
}

.auth-card {
  width: min(460px, 100%);
}

h1 {
  margin: 0 0 18px;
}

h2 {
  margin-top: 0;
}

.muted {
  color: #6e7890;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 650;
}

input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #ccd3e1;
  border-radius: 10px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: #244bc5;
  color: white;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}

.secondary {
  background: #6b7280;
}

.alert {
  padding: 11px 13px;
  border-radius: 10px;
  margin: 12px 0;
}

.error {
  background: #fff0f0;
  color: #9b1c1c;
}

.success {
  background: #eefbf2;
  color: #176534;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid #e5e9f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
}

.topbar nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.container {
  width: min(1180px, 92vw);
  margin: 30px auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stats .card b {
  font-size: 30px;
  display: block;
}

.stats .card span {
  color: #6e7890;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #e8ebf2;
  white-space: nowrap;
}

.badge {
  padding: 4px 8px;
  background: #eef2ff;
  border-radius: 999px;
}

.inline {
  display: flex;
  gap: 6px;
}

.inline button {
  margin-top: 0;
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar nav span {
    display: none;
  }
}

select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #ccd3e1;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

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

.form-grid label {
  margin-top: 0;
}

.form-actions {
  display: flex;
  align-items: end;
}

.danger {
  background: #b42318;
}

.button-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 9px;
  background: #244bc5;
  color: #fff;
  font-weight: 700;
}

.qr-preview {
  display: block;
  width: min(240px, 80vw);
  height: auto;
  margin: 16px 0;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  padding: 8px;
  background: #fff;
}

.subscription-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

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

.detail-grid>div {
  padding: 14px;
  border: 1px solid #e8ebf2;
  border-radius: 12px;
}

.detail-grid span {
  display: block;
  color: #6e7890;
  margin-bottom: 6px;
}

.payment-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: #f7f9ff;
}

.status-active {
  background: #e9f8ef;
  color: #166534;
}

.status-expiring {
  background: #fff7e6;
  color: #92400e;
}

.status-expired,
.status-suspended {
  background: #fff0f0;
  color: #9b1c1c;
}

.status-inactive,
.status-scheduled {
  background: #eef2ff;
  color: #334155;
}

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

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

textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 13px;
  border: 1px solid #ccd3e1;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

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

.page-head h1,
.page-head h2 {
  margin-bottom: 4px;
}

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

.search-row button {
  margin-top: 0;
}

.secondary-link {
  background: #6b7280;
}

.form-card {
  max-width: 760px;
  margin: auto;
}

.wa-button {
  background: #187d45;
}

.status-text {
  font-size: 18px !important;
}

.inline a {
  display: inline-flex;
  align-items: center;
  padding: 6px 2px;
}

@media (max-width: 760px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .search-row .button-link {
    width: 100%;
    text-align: center;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Sales mobile dashboard */
.sales-app-shell {
  min-height: 100vh;
  background: #07090d;
  color: #f8fafc;
  padding-bottom: 104px;
  overflow-x: hidden;
}

.sales-app-shell a {
  color: inherit;
}

.sales-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 max(18px, 5vw);
  background: rgba(7, 9, 13, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.sales-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.sales-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #e20d1f, #7a0610);
  box-shadow: 0 12px 28px rgba(226, 13, 31, 0.28);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.sales-topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #d7dde8;
}

.sales-topbar nav span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 750;
}

.sales-topbar nav a {
  font-weight: 700;
  color: #aeb7c7;
}

.sales-home {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 30px max(18px, 4vw) 8px;
}

.sales-hero {
  position: relative;
  padding: 28px 0 18px;
}

.sales-hero:before {
  content: "";
  position: absolute;
  inset: -80px -36px auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle,
      rgba(226, 13, 31, 0.3),
      rgba(226, 13, 31, 0) 68%);
  pointer-events: none;
}

.sales-greeting {
  margin: 0 0 10px;
  color: #d7dde8;
  font-size: 20px;
  font-weight: 800;
}

.sales-hero h1 {
  position: relative;
  margin: 0 0 26px;
  color: #fff;
  font-size: clamp(36px, 9vw, 58px);
  line-height: 1.13;
  font-weight: 950;
}

.sales-search-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: #121b24;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 50px rgba(0, 0, 0, 0.28);
}

.sales-search-card span {
  font-size: 32px;
  color: #f05260;
}

.sales-search-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #aeb7c7;
  font-size: 15px;
}

.sales-search-card em {
  font-style: normal;
  font-weight: 850;
  color: #fff;
}

.sales-filter-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.sales-filter-row::-webkit-scrollbar {
  display: none;
}

.sales-filter-row a {
  flex: 0 0 auto;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: #111923;
  color: #e8edf5;
  font-weight: 850;
}

.sales-filter-row a.active {
  background: #e20d1f;
  border-color: #e20d1f;
  color: #fff;
}

.sales-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.sales-action-grid a {
  display: flex;
  min-height: 108px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #101922;
  color: #f8fafc;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.sales-action-grid b {
  display: grid;
  place-items: center;
  max-width: 100%;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 14px;
  background: #1b2834;
  color: #ff4b5c;
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-action-grid span {
  font-size: 13px;
  font-weight: 800;
  color: #dce3ee;
}

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

.sales-stats-panel>div {
  padding: 18px;
  border: 1px solid rgba(226, 13, 31, 0.34);
  border-radius: 18px;
  background: linear-gradient(135deg,
      rgba(226, 13, 31, 0.16),
      rgba(18, 27, 36, 0.96));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.sales-stats-panel span {
  display: block;
  margin-bottom: 8px;
  color: #aeb7c7;
  font-weight: 750;
}

.sales-stats-panel strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 28px;
  line-height: 1.15;
}

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

.sales-section-head h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.sales-section-head a {
  color: #d7dde8;
  font-weight: 800;
}

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

.sales-customer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: #101922;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.sales-customer-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sales-customer-main>span {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fafc, #c6ceda);
  color: #0b1017;
  font-size: 26px;
  font-weight: 950;
}

.sales-customer-main div {
  min-width: 0;
}

.sales-customer-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 18px;
}

.sales-customer-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #98a4b5;
}

.sales-wa {
  flex: 0 0 auto;
  padding: 9px 11px;
  border-radius: 999px;
  background: #e20d1f;
  color: #fff;
  font-weight: 900;
}

.sales-empty {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: #101922;
  color: #d7dde8;
}

.sales-empty a {
  padding: 10px 14px;
  border-radius: 999px;
  background: #e20d1f;
  color: #fff;
  font-weight: 850;
}

.sales-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 4px;
  padding: 10px max(14px, 4vw) calc(10px + env(safe-area-inset-bottom));
  background: rgba(8, 12, 17, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
}

.sales-bottom-nav a {
  display: flex;
  min-width: 0;
  min-height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 18px;
  color: #8f9bad;
  font-size: 12px;
  font-weight: 850;
}

.sales-bottom-nav a span {
  font-size: 22px;
  line-height: 1;
}

.sales-bottom-nav a.active {
  background: #1b2834;
  color: #fff;
}

.sales-bottom-nav a.active span {
  color: #ff4b5c;
}

@media (max-width: 760px) {
  .sales-topbar {
    align-items: flex-start;
    min-height: 76px;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .sales-brand span:last-child {
    display: none;
  }

  .sales-topbar nav {
    gap: 12px;
    font-size: 13px;
  }

  .sales-topbar nav span {
    display: none;
  }

  .sales-home {
    padding-top: 20px;
  }

  .sales-action-grid {
    grid-template-columns: repeat(4, 118px);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .sales-action-grid::-webkit-scrollbar {
    display: none;
  }

  .sales-stats-panel {
    grid-template-columns: 1fr 1fr;
  }

  .sales-stats-panel strong {
    font-size: 23px;
  }

  .sales-customer-card {
    border-radius: 16px;
  }

  .sales-search-card {
    min-height: 74px;
  }

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

@media (min-width: 900px) {
  .sales-app-shell {
    padding-bottom: 36px;
  }

  .sales-bottom-nav {
    left: 50%;
    right: auto;
    bottom: 22px;
    width: min(560px, 90vw);
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 8px;
    background: rgba(8, 12, 17, 0.88);
  }

  .sales-home {
    padding-bottom: 110px;
  }
}

/* Sales customers page */
.sales-customers-home {
  width: min(940px, 100%);
}

.sales-customers-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 20px;
}

.sales-customers-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.12;
  font-weight: 950;
}

.sales-add-customer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 15px;
  background: #e20d1f;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(226, 13, 31, 0.28);
}

.sales-add-customer span {
  font-size: 24px;
  line-height: 1;
}

.sales-customers-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  margin-bottom: 20px;
}

.sales-customers-search form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: #101922;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.sales-customers-search form span {
  font-size: 28px;
  color: #ff4b5c;
}

.sales-customers-search input {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  outline: 0;
}

.sales-customers-search input::placeholder {
  color: #8591a3;
}

.sales-customers-search form a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #1b2834;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.sales-customers-search button {
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 66px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: #101922;
  color: #ff4b5c;
  font-size: 24px;
}

.sales-customers-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.sales-customers-stats>div {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #101922;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.sales-customers-stats span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(226, 13, 31, 0.14);
  color: #ff4b5c;
  font-size: 24px;
}

.sales-customers-stats small {
  color: #aeb7c7;
  font-size: 13px;
  font-weight: 800;
}

.sales-customers-stats strong {
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.sales-customers-list-section .sales-section-head h2 span {
  color: #8f9bad;
  font-size: 16px;
  font-weight: 800;
}

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

.sales-customer-list-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #101922;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.sales-customer-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #1b2834;
  color: #ff4b5c;
  font-size: 24px;
  font-weight: 950;
}

.sales-customer-list-card.tone-2 .sales-customer-avatar {
  background: rgba(226, 13, 31, 0.18);
  color: #ff7a86;
}

.sales-customer-list-card.tone-3 .sales-customer-avatar {
  background: rgba(248, 250, 252, 0.12);
  color: #fff;
}

.sales-customer-list-card.tone-4 .sales-customer-avatar {
  background: rgba(255, 75, 92, 0.12);
  color: #ff4b5c;
}

.sales-customer-list-card.tone-5 .sales-customer-avatar {
  background: rgba(144, 153, 168, 0.16);
  color: #dce3ee;
}

.sales-customer-info {
  min-width: 0;
}

.sales-customer-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.sales-customer-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  margin-right: 12px;
  color: #aeb7c7;
  font-size: 14px;
  font-weight: 750;
}

.sales-customer-meta span {
  color: #ff4b5c;
}

.sales-customer-info p {
  margin: 7px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7f8da1;
  font-size: 13px;
}

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

.sales-customer-actions>a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1b2834;
  color: #dce3ee;
  font-size: 13px;
  font-weight: 850;
}

.sales-customer-actions .sales-wa {
  background: #e20d1f;
  color: #fff;
}

.sales-customer-actions .sales-open {
  width: 38px;
  padding: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 760px) {
  .sales-customers-head {
    align-items: flex-start;
    margin-top: 18px;
  }

  .sales-customers-head .sales-greeting {
    display: none;
  }

  .sales-add-customer {
    min-height: 48px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .sales-customers-search {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .sales-customers-search form,
  .sales-customers-search button {
    min-height: 62px;
  }

  .sales-customers-stats {
    grid-template-columns: repeat(4, 150px);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .sales-customers-stats::-webkit-scrollbar {
    display: none;
  }

  .sales-customer-list-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }

  .sales-customer-avatar {
    width: 54px;
    height: 54px;
  }

  .sales-customer-meta {
    display: flex;
    margin-right: 0;
  }

  .sales-customer-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .sales-customer-actions>a:not(.sales-open):not(.sales-wa) {
    display: none;
  }

  .sales-customer-actions .sales-open {
    background: transparent;
    width: 28px;
  }

  .sales-customer-info p {
    display: none;
  }
}

@media (max-width: 430px) {
  .sales-customers-head {
    gap: 12px;
  }

  .sales-customers-head h1 {
    font-size: 28px;
  }

  .sales-add-customer {
    font-size: 13px;
  }

  .sales-customer-meta {
    font-size: 12px;
  }

  .sales-customer-name {
    font-size: 16px;
  }

  .sales-customer-list-card {
    border-radius: 16px;
  }
}

.sales-customers-page {
  background: #07090d;
}

/* Sales car calculator */
.sales-calculator-page {
  background: #07090d;
}

.sales-calculator-home {
  width: min(860px, 100%);
}

.sales-calculator-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 18px;
}

.sales-calculator-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 8vw, 50px);
  line-height: 1.1;
  font-weight: 950;
}

.sales-calculator-title p {
  margin: 8px 0 0;
  color: #98a4b5;
  font-weight: 750;
}

.sales-calculator-title button {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101922;
  color: #dce3ee;
  border-radius: 999px;
}

.sales-car-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #101922;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.sales-car-image-picker {
  display: block;
  margin: 0;
  cursor: pointer;
}

.sales-car-image-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.sales-car-image-picker span {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  background: linear-gradient(145deg, #1b2834, #0c1219);
  color: #98a4b5;
  font-weight: 900;
  overflow: hidden;
}

.sales-car-image-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sales-car-fields {
  display: grid;
  gap: 12px;
  align-content: center;
}

.sales-car-fields label {
  margin: 0;
  color: #aeb7c7;
}

.sales-car-fields input {
  margin-top: 8px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #0c1219;
  color: #fff;
}

.sales-calculator-panel {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: #101922;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
}

.sales-calculator-panel h2 {
  margin: 0 0 18px;
  color: #ff4b5c;
  font-size: 24px;
}

.sales-calc-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.sales-calc-row>label {
  margin: 0;
  color: #dce3ee;
  font-weight: 850;
}

.sales-calc-row input,
.sales-calc-row select {
  border-color: rgba(255, 255, 255, 0.12);
  background: #0c1219;
  color: #fff;
}

.sales-stepper,
.sales-down-control {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #0c1219;
}

.sales-down-control {
  grid-template-columns: 120px 52px minmax(0, 1fr) 52px;
}

.sales-stepper input,
.sales-down-control input,
.sales-down-control select {
  border: 0;
  border-radius: 0;
  text-align: center;
  background: transparent;
}

.sales-stepper button,
.sales-down-control button {
  margin: 0;
  border-radius: 0;
  background: #162230;
  color: #fff;
  font-size: 22px;
}

.sales-down-control select {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 850;
}

.sales-calc-summary {
  display: grid;
  gap: 10px;
  margin: 22px 0 18px;
  padding: 16px;
  border-radius: 18px;
  background: #0c1219;
}

.sales-calc-summary>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #aeb7c7;
}

.sales-calc-summary span {
  font-weight: 800;
}

.sales-calc-summary strong {
  color: #fff;
  font-size: 18px;
}

.sales-calc-summary em {
  font-style: normal;
}

.sales-monthly-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 16px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e20d1f, #7a0610);
  color: #fff;
  box-shadow: 0 18px 42px rgba(226, 13, 31, 0.25);
}

.sales-monthly-result span {
  font-weight: 850;
}

.sales-monthly-result strong {
  font-size: clamp(34px, 9vw, 54px);
  line-height: 1;
}

.sales-calc-note {
  margin: 14px 0;
  color: #98a4b5;
  text-align: center;
}

.sales-calc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sales-calc-actions button {
  margin: 0;
  min-height: 54px;
  border: 1px solid rgba(226, 13, 31, 0.7);
  border-radius: 14px;
  background: transparent;
  color: #fff;
}

.sales-calc-actions button:last-child {
  background: #e20d1f;
  border-color: #e20d1f;
}

@media (max-width: 760px) {
  .sales-calculator-title {
    margin-top: 18px;
  }

  .sales-calculator-title button {
    padding: 9px 12px;
  }

  .sales-car-card {
    grid-template-columns: 120px minmax(0, 1fr);
    padding: 14px;
  }

  .sales-calc-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sales-down-control {
    grid-template-columns: 94px 48px minmax(0, 1fr) 48px;
  }

  .sales-stepper {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .sales-calculator-panel {
    padding: 16px;
  }

  .sales-calc-summary>div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .sales-monthly-result {
    grid-template-columns: 1fr;
  }

  .sales-calc-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .sales-car-card {
    grid-template-columns: 1fr;
  }

  .sales-car-image-picker span {
    aspect-ratio: 16/9;
  }

  .sales-calc-actions {
    grid-template-columns: 1fr;
  }

  .sales-down-control {
    grid-template-columns: 1fr 46px 1fr 46px;
  }

  .sales-down-control select {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Sales calculation history */
.sales-calculator-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sales-calculator-tools a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(226, 13, 31, 0.58);
  border-radius: 999px;
  background: rgba(226, 13, 31, 0.14);
  color: #fff;
  font-weight: 850;
}

.sales-calc-alert a {
  display: inline-flex;
  margin-left: 10px;
  font-weight: 900;
  color: #e20d1f;
}

.sales-history-home {
  width: min(1020px, 100%);
}

.sales-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 18px;
}

.sales-history-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 8vw, 50px);
  line-height: 1.1;
  font-weight: 950;
}

.sales-history-head p:last-child {
  margin: 8px 0 0;
  color: #98a4b5;
  font-weight: 750;
}

.sales-history-create {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #e20d1f;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(226, 13, 31, 0.26);
}

.sales-history-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #101922;
}

.sales-history-search span {
  color: #ff4b5c;
  font-size: 24px;
}

.sales-history-search input {
  margin: 0;
  border-color: rgba(255, 255, 255, 0.12);
  background: #0c1219;
  color: #fff;
}

.sales-history-search a {
  padding: 10px 12px;
  border-radius: 12px;
  color: #dce3ee;
  font-weight: 850;
}

.sales-history-search button {
  margin: 0;
  border-radius: 12px;
  background: #e20d1f;
}

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

.sales-history-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(150px, auto);
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #101922;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.sales-history-image {
  display: grid;
  place-items: center;
  min-height: 108px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1b2834, #0c1219);
  overflow: hidden;
  color: #98a4b5;
  font-weight: 900;
}

.sales-history-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sales-history-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.sales-history-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sales-history-title-row strong {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1.25;
}

.sales-history-title-row small {
  display: block;
  margin-top: 4px;
  color: #98a4b5;
}

.sales-history-title-row a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(226, 13, 31, 0.16);
  border: 1px solid rgba(226, 13, 31, 0.62);
  color: #fff;
  font-weight: 950;
}

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

.sales-history-metrics div {
  padding: 10px 12px;
  border-radius: 14px;
  background: #0c1219;
}

.sales-history-metrics span {
  display: block;
  margin-bottom: 4px;
  color: #8f9bad;
  font-size: 12px;
  font-weight: 850;
}

.sales-history-metrics b {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}

.sales-history-metrics em {
  font-style: normal;
  color: #ffb4bc;
}

.sales-history-payment {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 6px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e20d1f, #7a0610);
  color: #fff;
  text-align: right;
}

.sales-history-payment span {
  font-weight: 850;
  color: #ffd4d8;
}

.sales-history-payment strong {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
}

@media (max-width: 840px) {
  .sales-history-head {
    flex-direction: column;
  }

  .sales-history-create {
    width: 100%;
  }

  .sales-history-search {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sales-history-search button,
  .sales-history-search a {
    grid-column: auto;
  }

  .sales-history-card {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .sales-history-payment {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }

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

@media (max-width: 520px) {
  .sales-calculator-tools {
    justify-content: flex-start;
  }

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

  .sales-history-search span {
    display: none;
  }

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

  .sales-history-image {
    aspect-ratio: 16/9;
  }

  .sales-history-metrics {
    grid-template-columns: 1fr;
  }
}

/* Mobile-first calculator fit */
@media (max-width: 520px) {
  .sales-app-shell {
    padding-bottom: 86px;
  }

  .sales-topbar {
    min-height: 58px;
    padding: 10px 12px;
  }

  .sales-topbar nav {
    gap: 9px;
    font-size: 12px;
  }

  .sales-home {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sales-calculator-home {
    width: 100%;
    padding: 10px 10px 86px;
  }

  .sales-calculator-title {
    align-items: center;
    gap: 10px;
    margin: 8px 0 10px;
  }

  .sales-calculator-title h1 {
    font-size: 26px;
    line-height: 1.15;
  }

  .sales-calculator-title p {
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
  }

  .sales-calculator-tools {
    gap: 6px;
  }

  .sales-calculator-tools a,
  .sales-calculator-title button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .sales-calc-alert {
    font-size: 12px;
    line-height: 1.45;
    margin: 8px 0;
    padding: 9px 10px;
  }

  .sales-calc-alert a {
    margin-left: 6px;
  }

  .sales-car-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .sales-car-image-picker span {
    aspect-ratio: 1/1;
    border-radius: 13px;
    font-size: 12px;
  }

  .sales-car-fields {
    gap: 7px;
  }

  .sales-car-fields label {
    font-size: 12px;
  }

  .sales-car-fields input,
  .sales-car-fields select {
    min-height: 38px;
    margin-top: 4px;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 10px;
  }

  .sales-calculator-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .sales-calculator-panel h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .sales-calc-row {
    margin-bottom: 10px;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .sales-calc-row>label {
    font-size: 13px;
    line-height: 1.25;
  }

  .sales-calc-row input,
  .sales-calc-row select {
    min-height: 42px;
    font-size: 15px;
    padding: 8px 10px;
  }

  .sales-stepper {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    border-radius: 12px;
  }

  .sales-down-control {
    grid-template-columns: 74px 42px minmax(0, 1fr) 42px;
    border-radius: 12px;
  }

  .sales-stepper button,
  .sales-down-control button {
    min-height: 42px;
    padding: 0;
    font-size: 19px;
  }

  .sales-down-control select {
    font-size: 13px;
  }

  .sales-calc-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 12px 0 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .sales-calc-summary>div {
    display: block;
    min-width: 0;
  }

  .sales-calc-summary span {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.25;
  }

  .sales-calc-summary strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .sales-monthly-result {
    padding: 14px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: 15px;
  }

  .sales-monthly-result span {
    font-size: 13px;
  }

  .sales-monthly-result strong {
    font-size: 34px;
  }

  .sales-calc-note {
    margin: 9px 0;
    font-size: 11px;
    line-height: 1.4;
  }

  .sales-calc-actions {
    gap: 8px;
    grid-template-columns: 1fr 1fr;
  }

  .sales-calc-actions button {
    min-height: 44px;
    padding: 9px 8px;
    border-radius: 12px;
    font-size: 13px;
  }

  .sales-bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }

  .sales-bottom-nav a {
    min-height: 54px;
    border-radius: 13px;
    font-size: 10px;
    gap: 3px;
  }

  .sales-bottom-nav a span {
    font-size: 17px;
  }
}

/* Reference-style calculator redesign */
.sales-calculator-page {
  background: #06080c;
  color: #f8fafc;
}

.sales-calculator-page .sales-topbar {
  min-height: 56px;
  padding: 10px 14px;
  background: #080a0f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sales-calculator-page .sales-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.sales-calculator-page .sales-topbar nav {
  gap: 10px;
  font-size: 12px;
}

.sales-calc-phone-frame {
  width: min(430px, 100%);
  padding: 12px 12px 82px;
}

.sales-calc-phone-frame .sales-calculator-form {
  display: grid;
  gap: 10px;
}

.sales-calculator-title {
  align-items: center;
  margin: 4px 0 2px;
}

.sales-calculator-title h1 {
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: 0;
  margin: 0;
  color: #fff;
}

.sales-calculator-title p {
  font-size: 12px;
  line-height: 1.35;
  margin: 3px 0 0;
  color: #9da8b8;
}

.sales-calculator-tools {
  gap: 7px;
}

.sales-calculator-tools a,
.sales-calculator-title button {
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: #101923;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dce3ee;
}

.sales-calculator-tools a {
  background: rgba(226, 13, 31, 0.1);
  border-color: #e20d1f;
  color: #fff;
}

.sales-calc-car-summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #111923;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.sales-calc-car-summary .sales-car-image-picker {
  margin: 0;
}

.sales-calc-car-summary .sales-car-image-picker span {
  aspect-ratio: 1.16;
  border-radius: 13px;
  background: #172432;
  color: #91a0b3;
  font-size: 12px;
}

.sales-calc-car-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sales-calc-car-copy>span {
  font-size: 12px;
  color: #aab5c6;
  font-weight: 850;
}

.sales-calc-car-copy label {
  margin: 0;
  color: #aab5c6;
  font-size: 11px;
  font-weight: 850;
}

.sales-calc-car-copy input {
  min-height: 35px;
  margin-top: 3px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #0b1017;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.sales-calculator-panel {
  padding: 12px;
  border-radius: 16px;
  background: #111923;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.sales-calc-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sales-calc-panel-title h2 {
  margin: 0;
  color: #ff4051;
  font-size: 18px;
  line-height: 1.2;
}

.sales-result-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #ff4051;
  font-style: normal;
  font-weight: 900;
}

.sales-calc-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
}

.sales-calc-row>label {
  margin: 0;
  color: #dce3ee;
  font-size: 13px;
  font-weight: 850;
}

.sales-calc-customer-row {
  grid-template-columns: 1fr;
}

.sales-calc-customer-row select,
.sales-calc-row input,
.sales-calc-row select {
  min-height: 39px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #0b1017;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
}

.sales-stepper,
.sales-down-control {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  background: #0b1017;
  overflow: hidden;
}

.sales-down-control {
  grid-template-columns: 58px 42px minmax(0, 1fr) 42px;
}

.sales-stepper button,
.sales-down-control button {
  min-height: 39px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #172432;
  color: #fff;
  font-size: 18px;
}

.sales-stepper input,
.sales-down-control input,
.sales-down-control select {
  min-height: 39px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.sales-down-control select {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.sales-calc-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 11px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0b1017;
}

.sales-result-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: #aeb7c7;
}

.sales-result-row span:not(.sales-result-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.sales-result-row strong {
  white-space: nowrap;
  font-size: 13px;
  color: #fff;
  font-weight: 900;
  text-align: right;
}

.sales-result-row em {
  font-style: normal;
}

.sales-monthly-result {
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 9px;
  padding: 15px 16px;
  border-radius: 15px;
  background: linear-gradient(135deg, #e20d1f, #8e0612);
  box-shadow: 0 18px 34px rgba(226, 13, 31, 0.24);
  color: #fff;
}

.sales-monthly-result span {
  font-size: 13px;
  font-weight: 850;
}

.sales-monthly-result strong {
  font-size: 38px;
  line-height: 1;
}

.sales-calc-note {
  margin: 8px 0 10px;
  color: #9ca7b7;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.sales-calc-actions {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sales-calc-actions button {
  min-height: 45px;
  margin: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

.sales-calc-action-secondary {
  background: #101923 !important;
  border: 1px solid #e20d1f !important;
  color: #fff !important;
}

.sales-calc-action-primary {
  background: #e20d1f !important;
  border: 1px solid #e20d1f !important;
  color: #fff !important;
}

@media (max-width: 520px) {
  .sales-calc-phone-frame {
    padding: 10px 10px 76px;
  }

  .sales-calculator-title h1 {
    font-size: 25px;
  }

  .sales-calc-row {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 8px;
  }

  .sales-calc-customer-row {
    grid-template-columns: 1fr;
  }

  .sales-calc-car-summary {
    grid-template-columns: 90px minmax(0, 1fr);
    padding: 10px;
  }

  .sales-monthly-result {
    min-height: 82px;
    padding: 14px;
  }

  .sales-monthly-result strong {
    font-size: 34px;
  }

  .sales-bottom-nav a {
    min-height: 52px;
  }
}

/* Black-red calculator theme */
.sales-calculator-page {
  background: linear-gradient(180deg, #05070b 0%, #0b1017 52%, #16070b 100%);
  color: #f8fafc
}

.sales-calculator-page .sales-topbar {
  background: rgba(5, 7, 11, .94);
  border-bottom: 1px solid rgba(226, 13, 31, .2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28)
}

.sales-calculator-page .sales-topbar nav a {
  color: #aeb7c7
}

.sales-calculator-page .sales-brand-mark {
  background: linear-gradient(135deg, #ff3347, #8e0612);
  box-shadow: 0 10px 24px rgba(226, 13, 31, .28)
}

.sales-calc-phone-frame {
  width: min(430px, 100%);
  padding: 12px 12px 84px
}

.sales-calculator-title h1 {
  color: #fff;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0
}

.sales-calculator-title p {
  color: #9da8b8
}

.sales-calculator-tools a,
.sales-calculator-title button {
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .38);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22)
}

.sales-calculator-tools a {
  background: linear-gradient(135deg, #ff3347, #8e0612);
  border-color: transparent;
  color: #fff
}

.sales-calc-car-summary {
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .22);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .24)
}

.sales-calc-car-summary .sales-car-image-picker span {
  background: linear-gradient(135deg, #171f2a, #0b1017);
  color: #ff5a68
}

.sales-calc-car-copy>span,
.sales-calc-car-copy label {
  color: #9da8b8
}

.sales-calc-car-copy input {
  background: #0b1017;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .13)
}

.sales-calculator-panel {
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .22);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24)
}

.sales-calc-panel-title h2 {
  color: #ff4051
}

.sales-calc-row>label {
  color: #e5e7eb
}

.sales-calc-customer-row select,
.sales-calc-row input,
.sales-calc-row select {
  background: #0b1017;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .13)
}

.sales-stepper,
.sales-down-control {
  background: #0b1017;
  border: 1px solid rgba(255, 255, 255, .13)
}

.sales-stepper button,
.sales-down-control button {
  background: #172432;
  color: #fff
}

.sales-stepper input,
.sales-down-control input,
.sales-down-control select {
  background: #0b1017;
  color: #fff
}

.sales-down-control select {
  border-right: 1px solid rgba(255, 255, 255, .1)
}

.sales-calc-summary {
  background: #0b1017;
  border: 1px solid rgba(255, 255, 255, .08);
  gap: 0;
  margin: 10px 0 10px;
  padding: 8px 12px
}

.sales-result-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: #aeb7c7
}

.sales-result-icon {
  color: #ff4051
}

.sales-result-row span:not(.sales-result-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #aeb7c7;
  font-size: 12px;
  font-weight: 800
}

.sales-result-row strong {
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: right
}

.sales-monthly-result {
  min-height: 82px;
  background: linear-gradient(135deg, #ff3347, #8e0612);
  box-shadow: 0 18px 34px rgba(226, 13, 31, .26)
}

.sales-calc-note {
  color: #9da8b8
}

.sales-calc-action-secondary {
  background: #111923 !important;
  border: 1px solid #e20d1f !important;
  color: #fff !important
}

.sales-calc-action-primary {
  background: linear-gradient(135deg, #ff3347, #8e0612) !important;
  border: 0 !important;
  color: #fff !important
}

.sales-calculator-page .sales-bottom-nav {
  background: rgba(5, 7, 11, .96);
  border: 1px solid rgba(226, 13, 31, .18);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .34)
}

.sales-calculator-page .sales-bottom-nav a {
  color: #8f9bad
}

.sales-calculator-page .sales-bottom-nav a.active {
  background: #172432;
  color: #fff
}

.sales-calculator-page .sales-bottom-nav a.active span {
  color: #ff4051
}

@media(max-width:520px) {
  .sales-calc-phone-frame {
    padding: 10px 10px 78px
  }

  .sales-calculator-title h1 {
    font-size: 26px
  }

  .sales-calc-summary {
    padding: 8px 10px
  }

  .sales-result-row {
    gap: 5px;
    padding: 2px 0
  }

  .sales-monthly-result {
    min-height: 78px
  }

  .sales-bottom-nav a {
    min-height: 52px
  }
}

/* Calculator car modal picker */
.sales-car-selected {
  width: 100%;
  display: grid;
  gap: 7px
}

.sales-car-selected-label {
  color: #9da8b8;
  font-size: 12px;
  font-weight: 850
}

.sales-car-selected-body {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px
}

.sales-car-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1.45;
  border-radius: 12px;
  background: linear-gradient(135deg, #171f2a, #0b1017);
  color: #ff5a68;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden
}

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

.sales-car-selected-copy {
  min-width: 0
}

.sales-car-selected-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2
}

.sales-car-selected-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9da8b8;
  font-size: 12px;
  font-weight: 750
}

.sales-car-selected-copy b {
  font-weight: 750
}

.sales-car-change-button {
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 13, 31, .42);
  background: #171f2a;
  color: #ff5a68;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none
}

.sales-car-modal[hidden] {
  display: none
}

.sales-car-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58)
}

.sales-car-modal-backdrop {
  position: absolute;
  inset: 0
}

.sales-car-modal-panel {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 13, 31, .32);
  background: #111923;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42)
}

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

.sales-car-modal-head h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 950
}

.sales-car-modal-head button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #172432;
  color: #ff5a68
}

.sales-car-modal-content {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center
}

.sales-car-modal-image span {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: linear-gradient(135deg, #171f2a, #0b1017);
  color: #ff4051
}

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

.sales-car-modal-actions button {
  min-height: 42px;
  margin: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900
}

.sales-car-modal-actions button:first-child {
  background: #0b1017;
  border: 1px solid rgba(255, 255, 255, .13);
  color: #dce3ee
}

.sales-car-modal-actions button:last-child {
  background: linear-gradient(135deg, #ff3347, #8e0612);
  border: 0;
  color: #fff
}

@media(max-width:520px) {
  .sales-car-selected-body {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 8px
  }

  .sales-car-thumb {
    width: 64px
  }

  .sales-car-change-button {
    padding: 7px 10px;
    font-size: 11px
  }

  .sales-car-modal {
    padding: 12px
  }

  .sales-car-modal-panel {
    border-radius: 18px
  }

  .sales-car-modal-content {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px
  }
}

/* Black-red subscription mobile UI */
.sales-subscription-page {
  background: linear-gradient(180deg, #05070b 0%, #0b1017 52%, #16070b 100%);
  color: #f8fafc
}

.sales-subscription-page .sales-topbar {
  background: rgba(5, 7, 11, .94);
  border-bottom: 1px solid rgba(226, 13, 31, .2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28)
}

.sales-subscription-page .sales-brand-mark {
  background: linear-gradient(135deg, #ff3347, #8e0612);
  box-shadow: 0 10px 24px rgba(226, 13, 31, .28)
}

.sales-subscription-page .sales-topbar nav a,
.sales-subscription-page .sales-topbar nav span {
  color: #aeb7c7
}

.sales-subscription-page .sales-bottom-nav {
  background: rgba(5, 7, 11, .96);
  border: 1px solid rgba(226, 13, 31, .18);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .34)
}

.sales-subscription-page .sales-bottom-nav a {
  color: #8f9bad
}

.sales-subscription-page .sales-bottom-nav a.active {
  background: #172432;
  color: #fff
}

.sales-subscription-page .sales-bottom-nav a.active span {
  color: #ff4051
}

.sales-subscription-home {
  width: min(430px, 100%);
  padding: 12px 12px 86px
}

.sales-subscription-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 12px
}

.sales-subscription-hero p {
  margin: 0 0 3px;
  color: #ff4051;
  font-size: 12px;
  font-weight: 900
}

.sales-subscription-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 950
}

.sales-subscription-hero span {
  display: block;
  margin-top: 4px;
  color: #9da8b8;
  font-size: 12px;
  font-weight: 750
}

.sales-subscription-hero a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3347, #8e0612);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(226, 13, 31, .22)
}

.sales-subscription-alert {
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0;
  padding: 10px 12px
}

.sales-subscription-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border-radius: 20px;
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .22);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24)
}

.sales-subscription-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  text-align: center
}

.sales-subscription-empty span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #172432;
  color: #ff4051;
  font-size: 24px
}

.sales-subscription-empty h2 {
  margin: 0;
  color: #fff;
  font-size: 20px
}

.sales-subscription-empty p {
  margin: 0;
  color: #9da8b8;
  font-size: 13px
}

.sales-subscription-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #171f2a, #111923)
}

.sales-subscription-head span {
  display: block;
  color: #ff4051;
  font-size: 12px;
  font-weight: 900
}

.sales-subscription-head h2 {
  margin: 2px 0 3px;
  color: #fff;
  font-size: 22px;
  line-height: 1.15
}

.sales-subscription-head p {
  margin: 0;
  color: #9da8b8;
  font-size: 12px;
  font-weight: 750
}

.sales-subscription-head strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950
}

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

.sales-subscription-metrics div {
  min-width: 0;
  padding: 11px;
  border-radius: 14px;
  background: #0b1017;
  border: 1px solid rgba(255, 255, 255, .08)
}

.sales-subscription-metrics span {
  display: block;
  margin-bottom: 4px;
  color: #9da8b8;
  font-size: 11px;
  font-weight: 850
}

.sales-subscription-metrics b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px
}

.sales-payment-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 18px;
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22)
}

.sales-renewal-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 18px;
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22)
}

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

.sales-payment-head span,
.sales-renewal-card span {
  display: block;
  color: #ff4051;
  font-size: 11px;
  font-weight: 950
}

.sales-payment-head h3,
.sales-renewal-card h3 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 17px;
  line-height: 1.2
}

.sales-payment-head strong {
  color: #fff;
  font-size: 16px;
  white-space: nowrap
}

.sales-payment-panel p {
  margin: 0;
  color: #9da8b8;
  font-size: 12px;
  line-height: 1.45
}

.sales-payment-qr {
  display: block;
  width: min(210px, 74vw);
  height: auto;
  margin: 0 auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(226, 13, 31, .28);
  background: #fff
}

.sales-payment-form,
.sales-renewal-card form {
  display: grid;
  gap: 9px
}

.sales-payment-form label,
.sales-renewal-card label {
  margin: 0;
  color: #dce3ee;
  font-size: 12px;
  font-weight: 850
}

.sales-payment-form input,
.sales-renewal-card select {
  margin-top: 5px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: #0b1017;
  color: #fff;
  border-radius: 12px;
  font-size: 13px
}

.sales-payment-form button,
.sales-renewal-card button {
  min-height: 44px;
  margin: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff3347, #8e0612);
  color: #fff;
  font-weight: 950
}

.sales-review-panel {
  padding: 12px;
  border-radius: 14px;
  background: #0b1017;
  border: 1px solid rgba(226, 13, 31, .22);
  color: #ff8a94;
  font-size: 13px;
  font-weight: 800
}

.sales-subscription-history {
  margin-top: 14px
}

.sales-subscription-history-list {
  display: grid;
  gap: 9px
}

.sales-subscription-history-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: #111923;
  border: 1px solid rgba(226, 13, 31, .18);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .22)
}

.sales-subscription-history-item div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px
}

.sales-subscription-history-item strong {
  color: #fff;
  font-size: 13px
}

.sales-subscription-history-item span,
.sales-subscription-history-item small {
  color: #9da8b8;
  font-size: 11px;
  font-weight: 750
}

.sales-subscription-history-item p {
  margin: 0;
  color: #ff4051;
  font-size: 12px;
  font-weight: 900
}

@media(max-width:520px) {
  .sales-subscription-home {
    padding: 10px 10px 78px
  }

  .sales-subscription-hero h1 {
    font-size: 26px
  }

  .sales-subscription-card {
    padding: 12px;
    border-radius: 18px
  }

  .sales-subscription-head h2 {
    font-size: 20px
  }

  .sales-subscription-metrics {
    gap: 7px
  }

  .sales-payment-panel,
  .sales-renewal-card {
    padding: 12px
  }
}

/* One-screen professional calculator UI */
.sales-calculator-page .sales-topbar {
  min-height: 48px;
  padding: 7px 11px
}

.sales-calculator-page .sales-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px
}

.sales-calculator-page .sales-topbar nav {
  gap: 8px;
  font-size: 11px
}

.sales-calculator-page .sales-topbar nav span {
  max-width: 112px
}

.sales-calc-phone-frame {
  width: min(390px, 100%);
  padding: 8px 9px 66px
}

.sales-calc-phone-frame .sales-calculator-form {
  gap: 7px
}

.sales-calculator-title {
  margin: 2px 0 6px;
  gap: 8px
}

.sales-calculator-title h1 {
  font-size: 22px;
  line-height: 1.08
}

.sales-calculator-title p {
  display: none
}

.sales-calculator-tools {
  gap: 5px
}

.sales-calculator-tools a,
.sales-calculator-title button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px
}

.sales-calc-alert {
  margin: 5px 0;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.35
}

.sales-calc-car-summary {
  padding: 8px;
  border-radius: 14px
}

.sales-car-selected {
  gap: 4px
}

.sales-car-selected-label {
  font-size: 10px
}

.sales-car-selected-body {
  grid-template-columns: 52px minmax(0, 1fr) 78px;
  gap: 7px
}

.sales-car-thumb {
  width: 52px;
  border-radius: 10px;
  font-size: 10px
}

.sales-car-selected-copy strong {
  font-size: 13px
}

.sales-car-selected-copy small {
  margin-top: 1px;
  font-size: 10px
}

.sales-car-change-button {
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 10px;
  font-size: 10px
}

.sales-calculator-panel {
  padding: 10px;
  border-radius: 15px
}

.sales-calc-panel-title {
  margin-bottom: 7px
}

.sales-calc-panel-title h2 {
  font-size: 16px
}

.sales-result-icon {
  width: 17px;
  height: 17px;
  font-size: 11px
}

.sales-calc-row {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 7px;
  margin-bottom: 7px
}

.sales-calc-customer-row {
  grid-template-columns: 1fr
}

.sales-calc-row>label {
  font-size: 11px;
  line-height: 1.2
}

.sales-calc-row input,
.sales-calc-row select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 9px
}

.sales-stepper,
.sales-down-control {
  min-height: 34px;
  border-radius: 10px
}

.sales-stepper {
  grid-template-columns: 36px minmax(0, 1fr) 36px
}

.sales-down-control {
  grid-template-columns: 48px 36px minmax(0, 1fr) 36px
}

.sales-stepper button,
.sales-down-control button {
  min-height: 34px;
  font-size: 16px
}

.sales-stepper input,
.sales-down-control input,
.sales-down-control select {
  min-height: 34px;
  font-size: 12px
}

.sales-calc-summary {
  margin: 7px 0 7px;
  padding: 7px 9px;
  border-radius: 12px
}

.sales-result-row {
  gap: 5px;
  padding: 2px 0
}

.sales-result-row span:not(.sales-result-icon) {
  font-size: 11px
}

.sales-result-row strong {
  font-size: 12px
}

.sales-monthly-result {
  min-height: 64px;
  margin: 0 0 7px;
  padding: 11px 12px;
  border-radius: 13px
}

.sales-monthly-result span {
  font-size: 11px
}

.sales-monthly-result strong {
  font-size: 30px
}

.sales-calc-note {
  display: none
}

.sales-calc-actions {
  gap: 7px
}

.sales-calc-actions button {
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 11px;
  font-size: 12px
}

.sales-calculator-page .sales-bottom-nav {
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, minmax(0, 1fr))
}

.sales-calculator-page .sales-bottom-nav a {
  min-height: 46px;
  border-radius: 12px;
  font-size: 9px;
  gap: 2px
}

.sales-calculator-page .sales-bottom-nav a span {
  font-size: 15px
}

@media(max-width:380px) {
  .sales-calc-phone-frame {
    padding-left: 7px;
    padding-right: 7px
  }

  .sales-calc-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 6px
  }

  .sales-down-control {
    grid-template-columns: 44px 34px minmax(0, 1fr) 34px
  }

  .sales-car-selected-body {
    grid-template-columns: 48px minmax(0, 1fr) 72px
  }

  .sales-car-thumb {
    width: 48px
  }

  .sales-monthly-result strong {
    font-size: 27px
  }
}

/* Calculator summary no-wrap polish */
.sales-calc-summary {
  min-width: 0;
  overflow: hidden
}

.sales-result-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  white-space: nowrap
}

.sales-result-row span:not(.sales-result-icon) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sales-result-row strong {
  display: block;
  min-width: max-content;
  white-space: nowrap;
  text-align: right
}

.sales-result-row em,
.sales-result-row b {
  white-space: nowrap
}

/* =========================================================
   SALES DASHBOARD - RESPONSIVE WEB APP
   Fit PC / Laptop / Tablet / Mobile
   ========================================================= */

.sales-app-shell {
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

.sales-topbar {
  width: 100%;
  min-height: 64px;
  padding-left: clamp(12px, 3vw, 42px);
  padding-right: clamp(12px, 3vw, 42px);
}

.sales-home {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px) clamp(14px, 3vw, 32px) 120px;
}

/* Hero */
.sales-hero {
  padding: 18px 0 20px;
}

.sales-greeting {
  font-size: clamp(15px, 1.5vw, 20px);
  margin-bottom: 8px;
}

.sales-hero h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.12;
  margin-bottom: 22px;
}

/* Search */
.sales-search-card {
  width: 100%;
  min-height: 64px;
  padding: 0 clamp(14px, 2vw, 22px);
  gap: 12px;
}

.sales-search-card strong {
  min-width: 0;
  font-size: clamp(13px, 1.3vw, 15px);
}

/* Filter */
.sales-filter-row {
  width: 100%;
  gap: 8px;
  margin-top: 16px;
}

.sales-filter-row a {
  padding: 9px 16px;
  font-size: 13px;
}

/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.sales-action-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.sales-action-grid a {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 12px 8px;
}

.sales-action-grid b {
  min-width: 40px;
  max-width: 90%;
  height: 40px;
  padding: 0 8px;
  font-size: 20px;
}

.sales-action-grid span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* =========================================================
   STATS
   ========================================================= */

.sales-stats-panel {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.sales-stats-panel>div {
  min-width: 0;
  padding: 16px;
}

.sales-stats-panel strong {
  max-width: 100%;
  font-size: clamp(21px, 3vw, 30px);
}

/* =========================================================
   RECENT CUSTOMERS
   ========================================================= */

.sales-recent {
  width: 100%;
}

.sales-section-head {
  margin-bottom: 12px;
}

.sales-section-head h2 {
  font-size: clamp(19px, 2vw, 24px);
}

.sales-customer-list {
  width: 100%;
  gap: 10px;
}

.sales-customer-card {
  width: 100%;
  min-width: 0;
  padding: 13px;
  gap: 10px;
}

.sales-customer-main {
  min-width: 0;
  flex: 1 1 auto;
}

.sales-customer-main>span {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 21px;
}

.sales-customer-main div {
  min-width: 0;
}

.sales-customer-main strong {
  max-width: 100%;
  font-size: 16px;
}

.sales-customer-main small {
  max-width: 100%;
  font-size: 12px;
}

.sales-wa {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */

.sales-bottom-nav {
  width: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  padding:
    7px max(7px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-right));

  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.sales-bottom-nav a {
  min-width: 0;
  min-height: 54px;
  padding: 4px 2px;
  border-radius: 13px;
}

.sales-bottom-nav a span {
  font-size: 19px;
}

.sales-bottom-nav a {
  font-size: 10px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

  .sales-home {
    max-width: 760px;
  }

  .sales-action-grid {
    gap: 10px;
  }

  .sales-action-grid a {
    min-height: 90px;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {

  .sales-app-shell {
    padding-bottom: 76px;
  }

  .sales-topbar {
    min-height: 58px;
    padding: 8px 12px;
  }

  .sales-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .sales-topbar nav {
    gap: 8px;
    font-size: 12px;
  }

  .sales-topbar nav span {
    display: none;
  }

  .sales-brand span:last-child {
    display: none;
  }

  .sales-home {
    width: 100%;
    max-width: 100%;
    padding:
      10px 10px 86px;
  }

  .sales-hero {
    padding: 12px 0 12px;
  }

  .sales-greeting {
    font-size: 14px;
    margin-bottom: 7px;
  }

  .sales-hero h1 {
    font-size: clamp(29px, 9vw, 42px);
    margin-bottom: 16px;
  }

  /* Search */
  .sales-search-card {
    min-height: 58px;
    padding: 0 13px;
    border-radius: 15px;
    gap: 9px;
  }

  .sales-search-card span {
    font-size: 26px;
  }

  .sales-search-card strong {
    font-size: 13px;
  }

  .sales-search-card em {
    font-size: 12px;
  }

  /* Filters */
  .sales-filter-row {
    margin-top: 12px;
    gap: 7px;
  }

  .sales-filter-row a {
    padding: 8px 13px;
    font-size: 12px;
  }

  /* Quick Actions
       IMPORTANT: no horizontal scroll
    */
  .sales-action-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 7px 0 12px;
  }

  .sales-action-grid a {
    min-height: 78px;
    padding: 9px 7px;
    border-radius: 14px;
    gap: 6px;
  }

  .sales-action-grid b {
    min-width: 34px;
    width: auto;
    height: 34px;
    border-radius: 10px;
    font-size: 17px;
  }

  .sales-action-grid span {
    font-size: 11px;
  }

  /* Stats */
  .sales-stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
  }

  .sales-stats-panel>div {
    padding: 12px;
    border-radius: 14px;
  }

  .sales-stats-panel span {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .sales-stats-panel strong {
    font-size: 18px;
  }

  /* Recent */
  .sales-section-head {
    gap: 8px;
    margin-bottom: 9px;
  }

  .sales-section-head h2 {
    font-size: 18px;
  }

  .sales-section-head a {
    font-size: 12px;
  }

  .sales-customer-list {
    gap: 8px;
  }

  .sales-customer-card {
    padding: 11px;
    border-radius: 14px;
  }

  .sales-customer-main {
    gap: 10px;
  }

  .sales-customer-main>span {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 18px;
  }

  .sales-customer-main strong {
    font-size: 14px;
  }

  .sales-customer-main small {
    font-size: 11px;
  }

  .sales-wa {
    padding: 7px 9px;
    font-size: 11px;
  }

  /* Bottom navigation */
  .sales-bottom-nav {
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    gap: 2px;
  }

  .sales-bottom-nav a {
    min-height: 52px;
    border-radius: 12px;
    gap: 2px;
    font-size: 9px;
  }

  .sales-bottom-nav a span {
    font-size: 18px;
  }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 430px) {

  .sales-home {
    padding-left: 8px;
    padding-right: 8px;
  }

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

  .sales-search-card {
    min-height: 54px;
    border-radius: 13px;
  }

  .sales-search-card span {
    font-size: 23px;
  }

  .sales-search-card strong {
    font-size: 12px;
  }

  .sales-filter-row a {
    padding: 7px 11px;
    font-size: 11px;
  }

  .sales-action-grid {
    gap: 7px;
  }

  .sales-action-grid a {
    min-height: 74px;
  }

  .sales-action-grid b {
    min-width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .sales-action-grid span {
    font-size: 10px;
  }

  .sales-stats-panel>div {
    padding: 10px;
  }

  .sales-stats-panel strong {
    font-size: 17px;
  }

  .sales-customer-card {
    padding: 9px;
  }

  .sales-customer-main>span {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .sales-customer-main strong {
    font-size: 13px;
  }

  .sales-customer-main small {
    font-size: 10px;
  }

  .sales-wa {
    padding: 6px 8px;
    font-size: 10px;
  }
}


/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1200px) {

  .sales-home {
    max-width: 1180px;
    padding-left: 30px;
    padding-right: 30px;
  }

  .sales-action-grid {
    gap: 16px;
  }

  .sales-action-grid a {
    min-height: 110px;
  }

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

  .sales-customer-card {
    min-height: 82px;
  }
}

/* =========================================================
   SALES CALCULATOR SUMMARY - FULL WIDTH LEFT RIGHT
   ========================================================= */

.sales-calc-summary {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  overflow: visible;
}

.sales-calc-summary .sales-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 16px;
}

.sales-calc-summary .sales-result-row>span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.sales-calc-summary .sales-result-row>strong {
  min-width: max-content;
  margin-left: auto;
  white-space: nowrap;
  text-align: right;
}

/* Dedicated, always-visible selected-car details after the change button. */
.sales-calc-car-summary .sales-car-details {
  display: grid !important;
  grid-template-rows: auto auto auto;
  align-content: center;
  min-width: 0;
  visibility: visible !important;
}

/* Keep the selected car's name and model directly beside the change button. */
.sales-calc-car-summary .sales-car-selected-body {
  grid-template-columns: 52px auto minmax(0, 1fr);
}

.sales-calc-car-summary .sales-car-selected-copy {
  display: block;
  min-width: 0;
}

.sales-calc-car-summary .sales-car-selected-field-label,
.sales-calc-car-summary .sales-car-selected-name,
.sales-calc-car-summary .sales-car-selected-model {
  display: block;
}

.sales-calc-car-summary .sales-car-selected-field-label {
  margin-bottom: 1px;
  color: #9da8b8;
  font-size: 10px;
  font-weight: 750;
}

.sales-calc-car-summary .sales-car-selected-name {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-calc-car-summary .sales-car-selected-model {
  margin-top: 1px;
  overflow: hidden;
  color: #9da8b8;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .sales-calc-car-summary .sales-car-selected-body {
    grid-template-columns: 48px auto minmax(0, 1fr);
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .sales-calc-summary .sales-result-row {
    gap: 8px;
  }
}

/* Selected vehicle card */
.sales-calc-car-summary {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sales-calc-car-summary .sales-car-selected {
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #e7ebf1;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .05);
}

.sales-calc-car-summary .sales-car-selected-label {
  color: #4b5563;
  font-size: 10px;
  font-weight: 700;
}

.sales-calc-car-summary .sales-car-selected-body {
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
}

.sales-calc-car-summary .sales-car-thumb {
  width: 58px;
  aspect-ratio: 1.35;
  border-radius: 5px;
  background: #f1f3f5;
  color: #6b7280;
}

.sales-calc-car-summary [data-car-selection-display] {
  display: flex !important;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  color: #111827 !important;
}

.sales-calc-car-summary .sales-car-card-name {
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-calc-car-summary .sales-car-card-model {
  overflow: hidden;
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-calc-car-summary .sales-car-change-button {
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: #f4f7fb;
  color: #4d8fe8;
  font-size: 10px;
  font-weight: 800;
}

.sales-calc-car-summary [data-car-selection-display] {
  grid-column: 2;
  grid-row: 1;
}

.sales-calc-car-summary .sales-car-change-button {
  grid-column: 3;
  grid-row: 1;
}

/* Installment-year selector */
.sales-year-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(226, 13, 31, .28);
  border-radius: 10px;
  background: #111923;
}

.sales-year-options button {
  min-height: 28px;
  padding: 4px 2px;
  border: 0;
  border-radius: 7px;
  background: #172b3b;
  color: #d9e2ec;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.sales-year-options button:hover {
  background: #233c50;
}

.sales-year-options button.active {
  background: linear-gradient(135deg, #ff3347, #b80b19);
  color: #fff;
  box-shadow: 0 3px 8px rgba(226, 13, 31, .3);
}

@media (max-width:380px) {
  .sales-year-options {
    gap: 3px;
    padding: 5px;
  }

  .sales-year-options button {
    min-height: 26px;
    font-size: 9px;
  }
}

/* Single-field down-payment entry */
.sales-calc-row .sales-down-control {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(226, 13, 31, .32);
  border-radius: 10px;
  background: #0b1017;
}

.sales-calc-row .sales-down-control select {
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  background: #172432;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sales-calc-row .sales-down-control input {
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  background: #0b1017;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

/* Horizontal down-payment stepper */
.sales-calc-row .sales-down-control {
  grid-template-columns: 62px 40px minmax(0, 1fr) 40px;
}

.sales-calc-row .sales-down-control select {
  min-height: 40px;
}

.sales-calc-row .sales-down-control button {
  display: grid;
  min-height: 40px;
  margin: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #172432;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.sales-calc-row .sales-down-control input {
  min-height: 40px;
  text-align: center;
}

/* Simple down-payment entry */
.sales-calc-row .sales-down-control {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0;
}

.sales-calc-row .sales-down-control select {
  grid-column: 1;
  min-height: 40px;
  border-right: 1px solid rgba(255, 255, 255, .12);
}

.sales-calc-row .sales-down-control input {
  grid-column: 2;
  min-height: 40px;
  text-align: left;
}

.sales-down-payment-mode {
  color: #ff5a68;
  font-size: 10px;
  font-weight: 800;
}

/* Customers page: compact phone layout */
@media (max-width: 520px) {
  .sales-customers-home {
    width: 100%;
    padding: 10px 10px 82px;
  }

  .sales-customers-page .sales-topbar {
    min-height: 50px;
    padding: 8px 11px;
  }

  .sales-customers-page .sales-brand>span:last-child,
  .sales-customers-page .sales-topbar nav>span {
    display: none;
  }

  .sales-customers-page .sales-topbar nav {
    gap: 9px;
    font-size: 10px;
  }

  .sales-customers-head {
    align-items: center;
    gap: 10px;
    margin: 9px 0 12px;
  }

  .sales-customers-head .sales-greeting {
    display: none;
  }

  .sales-customers-head h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .sales-add-customer {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 11px;
  }

  .sales-add-customer span {
    font-size: 16px;
  }

  .sales-customers-search {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
    margin-bottom: 12px;
  }

  .sales-customers-search form,
  .sales-customers-search button {
    min-height: 44px;
    border-radius: 12px;
  }

  .sales-customers-search form {
    padding: 0 11px;
    gap: 8px;
  }

  .sales-customers-search form span {
    font-size: 19px;
  }

  .sales-customers-search input {
    font-size: 13px;
  }

  .sales-customers-search button {
    font-size: 18px;
  }

  .sales-customers-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    margin-bottom: 16px;
    padding: 0;
  }

  .sales-customers-stats>div {
    min-height: 90px;
    gap: 4px;
    padding: 10px;
    border-radius: 13px;
  }

  .sales-customers-stats span {
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: 15px;
  }

  .sales-customers-stats small {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sales-customers-stats strong {
    font-size: 22px;
  }

  .sales-section-head {
    align-items: center;
    margin-bottom: 9px;
  }

  .sales-section-head h2 {
    font-size: 15px;
  }

  .sales-section-head h2 span,
  .sales-section-head a {
    font-size: 10px;
  }

  .sales-customers-list {
    gap: 8px;
  }

  .sales-customer-list-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
    border-radius: 13px;
  }

  .sales-customer-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .sales-customer-name {
    font-size: 13px;
  }

  .sales-customer-meta {
    font-size: 10px;
    line-height: 1.25;
  }

  .sales-customer-actions {
    gap: 5px;
  }

  .sales-wa,
  .sales-open {
    min-width: 28px;
    min-height: 28px;
    padding: 5px;
    font-size: 10px;
  }
}

/* Customer form: phone-first layout */
.sales-customer-form-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #05070b 0%, #0b1017 55%, #16070b 100%);
  color: #f8fafc;
}

.sales-customer-form-page .sales-topbar {
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(226, 13, 31, .22);
  background: rgba(5, 7, 11, .95);
}

.sales-customer-form-page .sales-topbar strong {
  color: #fff;
  font-size: 14px;
}

.sales-customer-form-page .sales-topbar nav {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.sales-customer-form-page .sales-topbar nav a {
  color: #cbd5e1;
  text-decoration: none;
}

.sales-customer-form-home {
  width: min(560px, 100%);
  padding: 18px 14px 88px;
}

.sales-customer-form-card {
  padding: 18px;
  border: 1px solid rgba(226, 13, 31, .3);
  border-radius: 18px;
  background: #111923;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.sales-customer-form-card h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 24px;
  line-height: 1.2;
}

.sales-customer-form-card form {
  display: grid;
  gap: 7px;
}

.sales-customer-form-card label {
  margin-top: 6px;
  color: #dce3ee;
  font-size: 13px;
  font-weight: 800;
}

.sales-customer-form-card input,
.sales-customer-form-card textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  background: #0b1017;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: 0;
}

.sales-customer-form-card textarea {
  min-height: 78px;
  resize: vertical;
}

.sales-customer-form-card input:focus,
.sales-customer-form-card textarea:focus {
  border-color: #ff3347;
  box-shadow: 0 0 0 3px rgba(255, 51, 71, .12);
}

.sales-customer-form-card .inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.sales-customer-form-card .inline button,
.sales-customer-form-card .button-link {
  display: grid;
  min-height: 44px;
  place-items: center;
  margin: 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.sales-customer-form-card .inline button {
  border: 0;
  background: linear-gradient(135deg, #ff3347, #b80b19);
  color: #fff;
}

.sales-customer-form-card .secondary-link {
  border: 1px solid rgba(226, 13, 31, .45);
  background: #171f2a;
  color: #fff;
}

.sales-customer-form-card .alert {
  margin: 0 0 8px;
  border-radius: 10px;
  font-size: 13px;
}

@media (max-width:520px) {
  .sales-customer-form-page .sales-topbar strong {
    font-size: 12px;
  }

  .sales-customer-form-page .sales-topbar nav {
    gap: 8px;
    font-size: 10px;
  }

  .sales-customer-form-home {
    padding: 12px 10px 80px;
  }

  .sales-customer-form-card {
    padding: 14px;
    border-radius: 15px;
  }

  .sales-customer-form-card h1 {
    font-size: 21px;
  }

  .sales-customer-form-card label {
    font-size: 12px;
  }

  .sales-customer-form-card input,
  .sales-customer-form-card textarea {
    font-size: 14px;
  }
}

/* Customer form: brighter card and clearly separated fields */
.sales-customer-form-page {
  background: linear-gradient(180deg, #eef3f9 0%, #f7f9fc 100%);
}

.sales-customer-form-page .sales-topbar {
  background: #080c12;
}

.sales-customer-form-card {
  border-color: #dce4ee;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .12);
}

.sales-customer-form-card h1 {
  color: #152235;
}

.sales-customer-form-card label {
  color: #334155;
}

.sales-customer-form-card input,
.sales-customer-form-card textarea {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #111827;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}

.sales-customer-form-card input:focus,
.sales-customer-form-card textarea:focus {
  border-color: #ef233c;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239, 35, 60, .12);
}

.sales-customer-form-card .secondary-link {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

/* Customer form: black-red theme with clearer field contrast */
.sales-customer-form-page {
  background: linear-gradient(180deg, #05070b 0%, #0b1017 55%, #16070b 100%);
}

.sales-customer-form-card {
  border-color: rgba(226, 13, 31, .48);
  background: #141d28;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .32);
}

.sales-customer-form-card h1 {
  color: #fff;
}

.sales-customer-form-card label {
  color: #e5e7eb;
}

.sales-customer-form-card input,
.sales-customer-form-card textarea {
  border-color: #3b4a5d;
  background: #0a1017;
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}

.sales-customer-form-card input:focus,
.sales-customer-form-card textarea:focus {
  border-color: #ff3347;
  background: #0d141e;
  box-shadow: 0 0 0 3px rgba(255, 51, 71, .15);
}

.sales-customer-form-card .secondary-link {
  border-color: rgba(226, 13, 31, .52);
  background: #182231;
  color: #fff;
}

/* Sales dashboard: balanced phone layout */
.sales-dashboard-page {
  background: linear-gradient(180deg, #05070b 0%, #0b1017 54%, #16070b 100%);
}

@media (max-width: 520px) {
  .sales-dashboard-page .sales-topbar {
    min-height: 50px;
    padding: 8px 11px;
  }

  .sales-dashboard-page .sales-brand>span:last-child,
  .sales-dashboard-page .sales-topbar nav>span {
    display: none;
  }

  .sales-dashboard-page .sales-topbar nav {
    gap: 9px;
    font-size: 10px;
  }

  .sales-dashboard-page .sales-home {
    padding: 13px 10px 78px;
  }

  .sales-dashboard-page .sales-hero {
    margin-bottom: 10px;
  }

  .sales-dashboard-page .sales-greeting {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .sales-dashboard-page .sales-hero h1 {
    font-size: 27px;
    line-height: 1.12;
  }

  .sales-dashboard-page .sales-search-card {
    min-height: 46px;
    margin: 11px 0 9px;
    padding: 9px 11px;
    border-radius: 13px;
  }

  .sales-dashboard-page .sales-search-card span {
    font-size: 18px;
  }

  .sales-dashboard-page .sales-search-card strong {
    font-size: 11px;
  }

  .sales-dashboard-page .sales-search-card em {
    padding: 5px 7px;
    font-size: 10px;
  }

  .sales-dashboard-page .sales-filter-row {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sales-dashboard-page .sales-filter-row a {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .sales-dashboard-page .sales-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 12px;
    overflow: visible;
  }

  .sales-dashboard-page .sales-action-grid a {
    min-height: 78px;
    padding: 9px 7px;
    border-radius: 14px;
  }

  .sales-dashboard-page .sales-action-grid b {
    min-width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .sales-dashboard-page .sales-action-grid span {
    font-size: 11px;
  }

  .sales-dashboard-page .sales-stats-panel {
    gap: 8px;
    margin-bottom: 15px;
  }

  .sales-dashboard-page .sales-stats-panel>div {
    min-height: 76px;
    padding: 11px;
    border-radius: 13px;
  }

  .sales-dashboard-page .sales-stats-panel span {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .sales-dashboard-page .sales-stats-panel strong {
    font-size: 18px;
  }

  .sales-dashboard-page .sales-recent .sales-section-head h2 {
    font-size: 16px;
  }

  .sales-dashboard-page .sales-customer-card {
    padding: 10px;
    border-radius: 13px;
  }
}

/* Calculation history and subscription: compact phone layout */
.sales-history-page {
  background: linear-gradient(180deg, #05070b 0%, #0b1017 54%, #16070b 100%);
  color: #f8fafc;
}

@media (max-width: 520px) {

  .sales-history-page .sales-topbar,
  .sales-subscription-page .sales-topbar {
    min-height: 50px;
    padding: 8px 11px;
  }

  .sales-history-page .sales-brand>span:last-child,
  .sales-history-page .sales-topbar nav>span,
  .sales-subscription-page .sales-brand>span:last-child,
  .sales-subscription-page .sales-topbar nav>span {
    display: none;
  }

  .sales-history-page .sales-topbar nav,
  .sales-subscription-page .sales-topbar nav {
    gap: 9px;
    font-size: 10px;
  }

  .sales-history-home {
    width: 100%;
    padding: 12px 10px 78px;
  }

  .sales-history-head {
    gap: 9px;
    margin: 3px 0 11px;
  }

  .sales-history-head h1 {
    font-size: 24px;
  }

  .sales-history-head p:last-child {
    margin-top: 3px;
    font-size: 11px;
  }

  .sales-history-create {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 11px;
  }

  .sales-history-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin-bottom: 12px;
    padding: 7px 9px;
    border-radius: 12px;
  }

  .sales-history-search input {
    min-height: 34px;
    font-size: 12px;
  }

  .sales-history-search button,
  .sales-history-search a {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .sales-history-card {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .sales-history-image {
    grid-column: 1;
    grid-row: 1;
    min-height: 70px;
    aspect-ratio: 1;
    border-radius: 10px;
  }

  .sales-history-main {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
  }

  .sales-history-title-row strong {
    font-size: 13px;
  }

  .sales-history-title-row small {
    font-size: 10px;
  }

  .sales-history-title-row a {
    padding: 5px 7px;
    font-size: 10px;
  }

  .sales-history-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .sales-history-metrics div {
    padding: 6px 7px;
    border-radius: 9px;
  }

  .sales-history-metrics span,
  .sales-history-metrics b {
    font-size: 9px;
  }

  .sales-history-payment {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  .sales-history-payment strong {
    font-size: 23px;
  }

  .sales-subscription-home {
    width: 100%;
    padding: 12px 10px 78px;
  }

  .sales-subscription-hero {
    margin: 2px 0 10px;
  }

  .sales-subscription-hero h1 {
    font-size: 24px;
  }

  .sales-subscription-hero p,
  .sales-subscription-hero span {
    font-size: 10px;
  }

  .sales-subscription-card {
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .sales-subscription-head h2 {
    font-size: 18px;
  }

  .sales-subscription-head p {
    font-size: 11px;
  }

  .sales-subscription-metrics div {
    padding: 9px;
  }

  .sales-subscription-metrics span {
    font-size: 10px;
  }

  .sales-subscription-metrics b {
    font-size: 14px;
  }

  .sales-payment-panel,
  .sales-renewal-card {
    padding: 11px;
    border-radius: 13px;
  }

  .sales-payment-form input,
  .sales-payment-form button {
    min-height: 42px;
    font-size: 13px;
  }
}

/* Keep the bottom navigation visible above every phone page */
@media (max-width: 760px) {
  .sales-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .sales-app-shell {
    padding-bottom: 76px;
  }
}

/* Global floating company navigation */
.sales-bottom-nav {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  box-sizing: border-box;
  background: rgba(5, 7, 11, .97);
  border-top: 1px solid rgba(226, 13, 31, .34);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, .32);
}

.sales-bottom-nav a {
  text-decoration: none;
}

@media (min-width: 761px) {
  .sales-bottom-nav {
    left: 50% !important;
    right: auto !important;
    bottom: 16px !important;
    width: min(640px, 92vw);
    transform: translateX(-50%) !important;
    border: 1px solid rgba(226, 13, 31, .32);
    border-radius: 18px;
    padding: 6px;
  }
}

@media (max-width: 760px) {
  .sales-bottom-nav {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100%;
    transform: none !important;
  }

  .sales-app-shell,
  body:has(.sales-bottom-nav) {
    padding-bottom: 82px;
  }
}

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

/* Selected-car image uses one quarter of the card width */
.sales-calc-car-summary .sales-car-selected-body {
  grid-template-columns: 25% minmax(0, 1fr) auto;
}

.sales-calc-car-summary .sales-car-thumb {
  width: 100%;
  aspect-ratio: 1.3;
}

/* Polished selected-car product card */
.sales-calc-car-summary .sales-car-selected {
  padding: 11px;
  border-radius: 12px;
}

.sales-calc-car-summary .sales-car-selected-label {
  margin-bottom: 1px;
  font-size: 11px;
}

.sales-calc-car-summary .sales-car-selected-body {
  min-height: 78px;
  align-items: stretch;
  gap: 11px;
}

.sales-calc-car-summary .sales-car-thumb {
  min-height: 78px;
  border-radius: 8px;
  background: #eef2f6;
}

.sales-calc-car-summary .sales-car-thumb img {
  object-fit: cover;
}

.sales-calc-car-summary [data-car-selection-display] {
  align-self: center;
}

.sales-calc-car-summary .sales-car-card-name {
  font-size: 15px;
  letter-spacing: .1px;
}

.sales-calc-car-summary .sales-car-card-model {
  margin-top: 2px;
  font-size: 11px;
}

.sales-calc-car-summary .sales-car-change-button {
  align-self: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 9px;
  background: #edf4ff;
  color: #347be0;
  font-size: 11px;
}

@media (max-width:380px) {
  .sales-calc-car-summary .sales-car-selected {
    padding: 9px;
  }

  .sales-calc-car-summary .sales-car-selected-body {
    min-height: 70px;
    gap: 8px;
  }

  .sales-calc-car-summary .sales-car-thumb {
    min-height: 70px;
  }

  .sales-calc-car-summary .sales-car-card-name {
    font-size: 13px;
  }

  .sales-calc-car-summary .sales-car-change-button {
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* Large product-style car image */
.sales-calc-car-summary .sales-car-selected-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  min-height: 0;
  gap: 10px;
}

.sales-calc-car-summary .sales-car-thumb {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-height: 220px;
  aspect-ratio: 1.55;
  border-radius: 10px;
  background: #eef2f6;
}

.sales-calc-car-summary [data-car-selection-display] {
  grid-column: 1;
  grid-row: 2;
  min-height: 38px;
}

.sales-calc-car-summary .sales-car-change-button {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.sales-calc-car-summary .sales-car-card-name {
  font-size: 17px;
}

.sales-calc-car-summary .sales-car-card-model {
  font-size: 12px;
}

@media (max-width:380px) {
  .sales-calc-car-summary .sales-car-thumb {
    min-height: 185px;
  }

  .sales-calc-car-summary .sales-car-card-name {
    font-size: 15px;
  }
}

/* Full-bleed selected-car image without a white frame */
.sales-calculator-page .sales-calc-car-summary {
  margin-right: -9px;
  margin-left: -9px;
  width: calc(100% + 18px);
}

.sales-calculator-page .sales-calc-car-summary .sales-car-selected {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sales-calculator-page .sales-calc-car-summary .sales-car-selected-label {
  display: block;
  padding: 7px 10px;
  background: #0b1017;
  color: #dce3ee;
}

.sales-calculator-page .sales-calc-car-summary .sales-car-selected-body {
  gap: 0;
  background: #0b1017;
}

.sales-calculator-page .sales-calc-car-summary .sales-car-thumb {
  border-radius: 0;
}

.sales-calculator-page .sales-calc-car-summary [data-car-selection-display] {
  padding: 10px 12px;
  background: #0b1017;
}

.sales-calculator-page .sales-calc-car-summary .sales-car-change-button {
  margin-right: 11px;
}

@media (max-width:380px) {
  .sales-calculator-page .sales-calc-car-summary {
    margin-right: -7px;
    margin-left: -7px;
    width: calc(100% + 14px);
  }
}

/* Calculator uses the full available screen width */
.sales-calculator-page .sales-calc-phone-frame {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-right: 0;
  padding-left: 0;
}

.sales-calculator-page .sales-calculator-form {
  width: 100%;
}

.sales-calculator-page .sales-calculator-title,
.sales-calculator-page .sales-calculator-panel {
  margin-right: 10px;
  margin-left: 10px;
}

.sales-calculator-page .sales-calc-car-summary {
  margin-right: 0;
  margin-left: 0;
  width: 100%;
}

/* Vehicle image: clear at the top, fading into the lower surface */
.sales-calculator-page .sales-car-thumb {
  position: relative;
  isolation: isolate;
}

.sales-calculator-page .sales-car-thumb img {
  position: relative;
  z-index: 0;
}

.sales-calculator-page .sales-car-thumb::after {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 58%;
  pointer-events: none;
  content: "";
  background: linear-gradient(to bottom, rgba(5, 7, 11, 0) 0%, rgba(5, 7, 11, .15) 36%, rgba(5, 7, 11, .72) 100%);
}

/* Product hero image treatment */
.sales-calculator-page .sales-car-selected-label {
  display: none;
}

.sales-calculator-page .sales-car-selected-body {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0b1017;
}

.sales-calculator-page .sales-car-thumb {
  display: block;
  width: 100%;
  min-height: 250px;
  aspect-ratio: 1.55;
  background: #1c2730;
}

.sales-calculator-page .sales-car-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sales-calculator-page .sales-car-thumb::after {
  height: 64%;
  background: linear-gradient(to bottom, rgba(5, 7, 11, 0) 0%, rgba(5, 7, 11, .08) 30%, rgba(5, 7, 11, .86) 100%);
}

.sales-calculator-page [data-car-selection-display] {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 14px;
  left: 16px;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.sales-calculator-page .sales-car-card-name {
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.sales-calculator-page .sales-car-card-model {
  color: #d7e0ea;
  font-size: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.sales-calculator-page .sales-car-change-button {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  margin: 0;
  background: rgba(5, 7, 11, .72);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
  backdrop-filter: blur(8px);
}

@media (max-width:380px) {
  .sales-calculator-page .sales-car-thumb {
    min-height: 220px;
  }
}

/* Use the car hero image as the calculator header */
.sales-calculator-page .sales-calculator-title {
  display: none;
}

.sales-calculator-page .sales-car-selected-label {
  display: none !important;
}

.sales-calculator-page .sales-calc-car-summary {
  margin-top: 0;
}

.sales-calculator-page .sales-car-selected-body {
  margin-top: 0;
}

/* Edge-to-edge car hero with a soft detail card */
.sales-calculator-page .sales-topbar {
  display: none;
}

.sales-calculator-page .sales-calc-phone-frame {
  padding-top: 0;
}

.sales-calculator-page [data-car-selection-display] {
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: rgba(12, 20, 30, .78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  backdrop-filter: blur(7px);
}

.sales-calculator-page .sales-car-card-name {
  color: #fff;
}

.sales-calculator-page .sales-car-card-model {
  color: #d5deea;
}

.sales-calculator-page [data-car-selection-display] {
  background: rgba(12, 20, 30, .48);
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

.sales-calculator-page .sales-calc-car-summary [data-car-selection-display] {
  background: rgba(11, 16, 23, .32);
}

.sales-calculator-page [data-car-selection-display] {
  bottom: 4px;
}

.sales-calculator-page .sales-car-thumb img {
  height: 110%;
  transform: translateY(-10%);
}

/* Larger car hero, more compact vehicle details */
.sales-calculator-page .sales-car-thumb {
  min-height: 285px;
}

.sales-calculator-page [data-car-selection-display] {
  padding: 8px 10px;
  border-radius: 11px;
}

.sales-calculator-page .sales-car-card-name {
  font-size: 14px;
}

.sales-calculator-page .sales-car-card-model {
  font-size: 10px;
}

@media (max-width:380px) {
  .sales-calculator-page .sales-car-thumb {
    min-height: 245px;
  }
}

/* Refined floating bottom navigation */
@media (max-width:760px) {
  .sales-bottom-nav {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    padding: 6px !important;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 19px;
    background: rgba(7, 11, 17, .94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .42), 0 0 0 1px rgba(226, 13, 31, .14);
    backdrop-filter: blur(16px);
  }

  .sales-bottom-nav a {
    min-height: 48px;
    padding: 5px 2px;
    border-radius: 13px;
    color: #aeb9c8;
    font-size: 9px;
    font-weight: 800;
    transition: background .2s ease, color .2s ease;
  }

  .sales-bottom-nav a span {
    font-size: 16px;
  }

  .sales-bottom-nav a.active {
    background: linear-gradient(145deg, #ff3347, #b70b18);
    color: #fff;
    box-shadow: 0 5px 13px rgba(226, 13, 31, .3);
  }

  .sales-bottom-nav a.active span {
    color: #fff;
  }
}

/* Consistent, larger navigation icons on every phone page */
@media (max-width:760px) {
  .sales-bottom-nav {
    min-height: 66px;
  }

  .sales-bottom-nav a {
    min-height: 54px;
    font-size: 9px;
  }

  .sales-bottom-nav a span {
    font-size: 21px;
    line-height: 1;
  }
}

/* Universal floating navigation dock */
@media (max-width:760px) {
  .sales-bottom-nav {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    width: calc(100% - 28px) !important;
    max-width: 520px;
    transform: translateX(-50%) !important;
    padding: 6px !important;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    background: rgba(8, 12, 18, .92);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(226, 13, 31, .18);
    backdrop-filter: blur(20px);
  }

  .sales-bottom-nav a {
    min-height: 54px;
    border-radius: 14px;
  }

  .sales-bottom-nav a.active {
    background: linear-gradient(145deg, #ff3347 0%, #c20b19 100%);
    box-shadow: 0 7px 16px rgba(226, 13, 31, .36);
  }

  .sales-app-shell,
  body:has(.sales-bottom-nav) {
    padding-bottom: 96px;
  }
}

/* High-contrast floating dock */
@media (max-width:760px) {
  .sales-bottom-nav {
    bottom: 22px !important;
    padding: 8px !important;
    border: 1px solid rgba(226, 13, 31, .46);
    border-radius: 23px;
    background: #111923;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .58), 0 0 0 4px rgba(5, 7, 11, .34);
  }

  .sales-bottom-nav a {
    min-height: 56px;
    gap: 3px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .025);
    font-size: 9px;
  }

  .sales-bottom-nav a span {
    font-size: 22px;
  }

  .sales-bottom-nav a.active {
    background: linear-gradient(145deg, #ff3e51, #b60715);
    box-shadow: 0 8px 18px rgba(226, 13, 31, .44);
  }
}

/* Compact dock size shared by all pages */
@media (max-width:760px) {
  .sales-bottom-nav {
    bottom: 12px !important;
    min-height: 0;
    padding: 5px !important;
    border-radius: 17px;
    gap: 4px;
  }

  .sales-bottom-nav a {
    min-height: 46px;
    padding: 4px 2px;
    border-radius: 12px;
    gap: 2px;
    font-size: 8px;
  }

  .sales-bottom-nav a span {
    font-size: 18px;
  }
}

/* Dashboard visual system */
.sales-dashboard-page .sales-hero {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 15px;
  border: 1px solid rgba(226, 13, 31, .28);
  border-radius: 20px;
  background: radial-gradient(circle at 100% 0, rgba(226, 13, 31, .28), transparent 42%), linear-gradient(145deg, #111923, #080d14);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}

.sales-dashboard-page .sales-hero h1 {
  max-width: 680px;
  margin: 3px 0 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.sales-dashboard-page .sales-greeting {
  color: #ff8190;
  font-weight: 800;
}

.sales-dashboard-page .sales-search-card {
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(5, 10, 16, .58);
  box-shadow: none;
}

.sales-dashboard-page .sales-filter-row a {
  border: 1px solid rgba(255, 255, 255, .1);
  background: #121e2a;
}

.sales-dashboard-page .sales-filter-row a.active {
  border-color: transparent;
  background: linear-gradient(145deg, #ff3347, #b70b18);
}

.sales-dashboard-page .sales-action-grid a {
  border: 1px solid rgba(255, 255, 255, .11);
  background: linear-gradient(145deg, #162230, #0d151e);
  transition: transform .18s ease, border-color .18s ease;
}

.sales-dashboard-page .sales-action-grid a:hover {
  border-color: rgba(226, 13, 31, .52);
  transform: translateY(-2px);
}

.sales-dashboard-page .sales-action-grid b {
  background: #1c2c3b;
  color: #ff4051;
}

.sales-dashboard-page .sales-stats-panel>div {
  border-color: rgba(226, 13, 31, .38);
  background: linear-gradient(145deg, rgba(226, 13, 31, .14), #111923 58%);
}

.sales-dashboard-page .sales-recent {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: #0d151e;
}

@media (max-width:520px) {
  .sales-dashboard-page .sales-home {
    padding: 12px 10px 100px;
  }

  .sales-dashboard-page .sales-hero {
    padding: 14px 12px 12px;
    border-radius: 16px;
  }

  .sales-dashboard-page .sales-hero h1 {
    margin-bottom: 11px;
    font-size: 25px;
  }

  .sales-dashboard-page .sales-action-grid a {
    min-height: 80px;
  }

  .sales-dashboard-page .sales-recent {
    padding: 10px;
    border-radius: 15px;
  }
}

/* Calculator form finishing details */
.sales-calculator-page .sales-calculator-panel {
  margin: 10px;
  padding: 13px;
  border: 1px solid rgba(226, 13, 31, .42);
  border-radius: 18px;
  background: linear-gradient(145deg, #121d29, #0d131c);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}

.sales-calculator-page .sales-calc-panel-title {
  margin-bottom: 10px;
}

.sales-calculator-page .sales-calc-panel-title h2 {
  font-size: 18px;
}

.sales-calculator-page .sales-calc-row {
  margin-bottom: 9px;
}

.sales-calculator-page .sales-calc-row>label {
  color: #f1f5f9;
  font-size: 12px;
}

.sales-calculator-page .sales-calc-row input,
.sales-calculator-page .sales-calc-row select {
  min-height: 42px;
  border-radius: 10px;
  font-size: 14px;
}

.sales-calculator-page .sales-calc-summary {
  margin-top: 10px;
  border-radius: 13px;
}

.sales-calculator-page .sales-monthly-result {
  border-radius: 14px;
}

.sales-calculator-page .sales-calc-actions {
  gap: 8px;
}

.sales-calculator-page .sales-calc-actions button {
  min-height: 44px;
  border-radius: 11px;
  font-size: 13px;
}

@media (max-width:380px) {
  .sales-calculator-page .sales-calculator-panel {
    margin: 8px;
    padding: 11px;
    border-radius: 15px;
  }

  .sales-calculator-page .sales-calc-row>label {
    font-size: 11px;
  }
}

/* History cards: fixed vehicle thumbnail that never stretches with card content. */
@media (max-width:760px) {
  .sales-history-page .sales-history-card {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
  }

  .sales-history-page .sales-history-image {
    width: 86px;
    height: 104px;
    min-height: 104px;
    aspect-ratio: auto;
    align-self: start;
    overflow: hidden;
    background: #0b1017;
  }

  .sales-history-page .sales-history-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
}

/* Keep the vehicle thumbnail centered in a mobile history card. */
@media (max-width:760px) {
  .sales-history-page .sales-history-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sales-history-page .sales-history-image {
    grid-column: 1;
    grid-row: 2;
    width: 96px;
    height: 86px;
    min-height: 86px;
    margin: 0 auto;
  }

  .sales-history-page .sales-history-main {
    grid-column: 1;
    grid-row: 1;
  }

  .sales-history-page .sales-history-payment {
    grid-column: 1;
    grid-row: 3;
  }
}

/* Restore the original two-column history card; center its vehicle thumbnail vertically. */
@media (max-width:760px) {
  .sales-history-page .sales-history-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
  }

  .sales-history-page .sales-history-image {
    grid-column: 1;
    grid-row: 1;
    width: 86px;
    height: 104px;
    min-height: 104px;
    margin: auto 0;
    align-self: center;
  }

  .sales-history-page .sales-history-main {
    grid-column: 2;
    grid-row: 1;
  }

  .sales-history-page .sales-history-payment {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* BMA Sales Tools brand logo for every Sales header. */
.sales-app-shell .sales-brand {
  gap: 0;
}

.sales-app-shell .sales-brand-mark {
  width: 88px !important;
  height: 42px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #050608 url('../images/bma-sales-tools-header.jpeg') center / contain no-repeat !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
}

.sales-app-shell .sales-brand>span:last-child {
  display: none !important;
}

@media (max-width:760px) {
  .sales-app-shell .sales-brand-mark {
    width: 70px !important;
    height: 34px !important;
  }
}

/* Customer detail â€” mobile-first dark/red Sales UI. */
.sales-customer-view-page {
  min-height: 100vh;
  background: radial-gradient(circle at 85% 0, rgba(131, 8, 22, .28), transparent 28%), linear-gradient(180deg, #070a0e 0%, #0d070a 100%);
  color: #f7f9fc;
}

.sales-customer-view-home {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 14px 100px;
}

.sales-customer-profile,
.sales-customer-info-grid article,
.sales-customer-note-card {
  border: 1px solid rgba(226, 13, 31, .32);
  background: #121b25;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}

.sales-customer-profile {
  padding: 16px;
  border-radius: 18px;
}

.sales-customer-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sales-customer-avatar {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #ff3549, #a80815);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
}

.sales-customer-profile-head p {
  margin: 0 0 3px;
  color: #ff5263;
  font-size: 11px;
  font-weight: 800;
}

.sales-customer-profile-head h1 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sales-customer-profile-head small {
  color: #99a9ba;
  font-size: 11px;
}

.sales-customer-view-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.sales-customer-view-actions a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid #ed1c2e;
  border-radius: 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.sales-customer-view-actions .sales-customer-wa {
  border: 0;
  background: linear-gradient(135deg, #ff3347, #ba0917);
}

.sales-customer-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 11px 0;
}

.sales-customer-info-grid article {
  min-height: 78px;
  padding: 11px;
  border-radius: 14px;
}

.sales-customer-info-grid span {
  display: block;
  margin-bottom: 7px;
  color: #91a7bf;
  font-size: 10px;
  font-weight: 800;
}

.sales-customer-info-grid strong {
  display: block;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sales-customer-note-card {
  margin-top: 10px;
  padding: 13px;
  border-radius: 15px;
}

.sales-customer-note-card h2 {
  margin: 0 0 7px;
  color: #fff;
  font-size: 14px;
}

.sales-customer-note-card p {
  min-height: 24px;
  margin: 0;
  color: #b6c2d0;
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sales-customer-delete {
  margin-top: 13px;
}

.sales-customer-delete button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 72, 86, .78);
  border-radius: 12px;
  background: transparent;
  color: #ff7280;
  font-weight: 850;
}

@media (max-width:380px) {
  .sales-customer-view-home {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sales-customer-profile-head h1 {
    font-size: 18px;
  }
}

/* Tighter spacing for customer details. */
.sales-customer-view-page .sales-customer-view-home {
  padding-top: 12px;
}

.sales-customer-view-page .sales-customer-profile {
  padding: 13px;
}

.sales-customer-view-page .sales-customer-view-actions {
  margin-top: 10px;
  gap: 7px;
}

.sales-customer-view-page .sales-customer-info-grid {
  gap: 7px;
  margin: 8px 0;
}

.sales-customer-view-page .sales-customer-info-grid article {
  min-height: 70px;
  padding: 9px;
}

.sales-customer-view-page .sales-customer-note-card {
  margin-top: 7px;
  padding: 11px;
}

.sales-customer-view-page .sales-customer-delete {
  margin-top: 9px;
}

/* Compact customer records screen, based on the Sales Tools list pattern. */
.sales-customer-filter-row {
  display: flex;
  gap: 7px;
  margin: -4px 0 11px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sales-customer-filter-row a {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #344353;
  border-radius: 999px;
  color: #b8c5d2;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.sales-customer-filter-row a.active {
  border-color: #ee1c2d;
  color: #fff;
  background: #e91528;
}

@media (max-width:760px) {
  .sales-customers-page .sales-customers-home {
    padding: 10px 10px 94px;
  }

  .sales-customers-page .sales-customers-head {
    margin: 3px 0 9px;
  }

  .sales-customers-page .sales-customers-head h1 {
    font-size: 21px;
  }

  .sales-customers-page .sales-add-customer {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 10px;
  }

  .sales-customers-page .sales-customers-search {
    margin-bottom: 8px;
  }

  .sales-customers-page .sales-customers-search form,
  .sales-customers-page .sales-customers-search button {
    min-height: 42px;
  }

  .sales-customers-page .sales-customers-stats {
    display: none;
  }

  .sales-customers-page .sales-customers-list-section {
    margin-top: 8px;
  }

  .sales-customers-page .sales-section-head {
    margin-bottom: 8px;
  }

  .sales-customers-page .sales-section-head h2 {
    font-size: 15px;
  }

  .sales-customers-page .sales-customers-list {
    gap: 7px;
  }

  .sales-customers-page .sales-customer-list-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 9px;
    border-radius: 12px;
  }

  .sales-customers-page .sales-customer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 14px;
  }

  .sales-customers-page .sales-customer-name {
    font-size: 12px;
  }

  .sales-customers-page .sales-customer-meta {
    margin-top: 2px;
    font-size: 9px;
  }

  .sales-customers-page .sales-customer-info p {
    display: none;
  }

  .sales-customers-page .sales-customer-actions {
    gap: 5px;
  }

  .sales-customers-page .sales-customer-actions a:not(.sales-wa):not(.sales-open) {
    display: none;
  }

  .sales-customers-page .sales-customer-actions .sales-wa {
    width: 30px;
    height: 30px;
    font-size: 9px;
  }
}

/* Customer status badges and working status filters. */
.sales-customer-list-card {
  position: relative;
}

.sales-customer-status {
  position: absolute;
  top: 8px;
  right: 42px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.sales-customer-status.is-new {
  color: #ffd7dc;
  background: rgba(226, 13, 31, .2);
}

.sales-customer-status.is-whatsapp {
  color: #d9fff0;
  background: rgba(31, 152, 93, .25);
}

@media (max-width:760px) {
  .sales-customer-status {
    top: 8px;
    right: 45px;
  }
}

.sales-customer-status.is-following {
  color: #ffd7dc;
  background: rgba(226, 13, 31, .2);
}

.sales-customer-status.is-appointment {
  color: #e4f0ff;
  background: rgba(42, 123, 214, .25);
}

.sales-customer-status.is-closed {
  color: #d9fff0;
  background: rgba(31, 152, 93, .25);
}

.sales-customer-status.is-cancelled {
  color: #d5d8df;
  background: rgba(117, 125, 137, .3);
}

.sales-profile-status {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 9px;
}

.sales-profile-status.is-following {
  color: #ffd7dc;
  background: rgba(226, 13, 31, .2)
}

.sales-profile-status.is-appointment {
  color: #e4f0ff;
  background: rgba(42, 123, 214, .25)
}

.sales-profile-status.is-closed {
  color: #d9fff0;
  background: rgba(31, 152, 93, .25)
}

.sales-profile-status.is-cancelled {
  color: #d5d8df;
  background: rgba(117, 125, 137, .3)
}

/* Compact customer form for a phone-sized screen. */
@media (max-width:760px) {
  .sales-customer-form-page .sales-customer-form-home {
    padding: 10px 11px 92px;
  }

  .sales-customer-form-page .sales-customer-form-card {
    padding: 13px;
    border-radius: 15px;
  }

  .sales-customer-form-page .sales-customer-form-card h1 {
    margin: 0 0 10px;
    font-size: 19px;
  }

  .sales-customer-form-page .sales-customer-form-card form {
    display: grid;
    gap: 4px;
  }

  .sales-customer-form-page .sales-customer-form-card label {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.2;
  }

  .sales-customer-form-page .sales-customer-form-card input,
  .sales-customer-form-page .sales-customer-form-card select {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .sales-customer-form-page .sales-customer-form-card textarea {
    min-height: 56px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .sales-customer-form-page .sales-customer-form-card .inline {
    gap: 8px;
    margin-top: 7px;
  }

  .sales-customer-form-page .sales-customer-form-card .inline>* {
    min-height: 39px;
    font-size: 12px;
  }
}

/* Subscription typography aligned with the other Sales mobile screens. */
@media (max-width:760px) {
  .sales-subscription-page .sales-subscription-home {
    padding: 11px 11px 94px;
  }

  .sales-subscription-page .sales-subscription-hero h1 {
    font-size: 21px;
    line-height: 1.18;
  }

  .sales-subscription-page .sales-subscription-hero p {
    font-size: 10px;
  }

  .sales-subscription-page .sales-subscription-hero span {
    font-size: 10px;
    line-height: 1.35;
  }

  .sales-subscription-page .sales-subscription-hero a {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .sales-subscription-page .sales-subscription-head span,
  .sales-subscription-page .sales-subscription-metrics span,
  .sales-subscription-page .sales-payment-panel span,
  .sales-subscription-page .sales-renewal-card span {
    font-size: 10px;
  }

  .sales-subscription-page .sales-subscription-head h2 {
    font-size: 17px;
  }

  .sales-subscription-page .sales-subscription-head p {
    font-size: 11px;
  }

  .sales-subscription-page .sales-subscription-head strong {
    font-size: 10px;
  }

  .sales-subscription-page .sales-subscription-metrics b {
    font-size: 12px;
  }

  .sales-subscription-page .sales-payment-head h3,
  .sales-subscription-page .sales-renewal-card h3 {
    font-size: 15px;
  }

  .sales-subscription-page .sales-payment-head strong {
    font-size: 13px;
  }

  .sales-subscription-page .sales-payment-panel p,
  .sales-subscription-page .sales-review-panel {
    font-size: 11px;
    line-height: 1.45;
  }

  .sales-subscription-page .sales-payment-form label,
  .sales-subscription-page .sales-renewal-card label {
    font-size: 11px;
  }

  .sales-subscription-page .sales-payment-form button,
  .sales-subscription-page .sales-renewal-card button {
    min-height: 40px;
    font-size: 12px;
  }

  .sales-subscription-page .sales-subscription-history .sales-section-head h2 {
    font-size: 15px;
  }

  .sales-subscription-page .sales-subscription-history-item strong {
    font-size: 12px;
  }

  .sales-subscription-page .sales-subscription-history-item span,
  .sales-subscription-page .sales-subscription-history-item small,
  .sales-subscription-page .sales-subscription-history-item p {
    font-size: 10px;
  }
}

/* Loan conditions â€” compact finance cards in the Sales dark/red system. */
.sales-loan-conditions-page {
  min-height: 100vh;
  background: radial-gradient(circle at 84% 0, rgba(138, 9, 25, .25), transparent 30%), linear-gradient(180deg, #070a0e, #0d070a);
}

.sales-loan-conditions-home {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 13px 12px 96px;
}

.sales-loan-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 0 12px;
}

.sales-loan-hero p {
  margin: 0 0 3px;
  color: #ff4051;
  font-size: 10px;
  font-weight: 850;
}

.sales-loan-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.17;
}

.sales-loan-hero span {
  display: block;
  margin-top: 4px;
  color: #9da8b8;
  font-size: 10px;
}

.sales-loan-hero>a {
  display: grid;
  flex: 0 0 auto;
  min-height: 38px;
  place-items: center;
  padding: 0 11px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff3347, #b90816);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.sales-loan-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin-bottom: 11px;
  padding: 8px;
  border: 1px solid #2c3a49;
  border-radius: 13px;
  background: #121b25;
}

.sales-loan-search>span {
  color: #ff4051;
  font-size: 18px;
}

.sales-loan-search input {
  min-width: 0;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  outline: 0;
}

.sales-loan-search select {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #2d3c4b;
  border-radius: 8px;
  background: #0b1017;
  color: #dce5ef;
  font-size: 10px;
}

.sales-loan-search button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: #e8172b;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.sales-loan-condition-list {
  display: grid;
  gap: 9px;
}

.sales-loan-condition-card {
  padding: 12px;
  border: 1px solid #2b3a49;
  border-radius: 15px;
  background: #121b25;
  box-shadow: 0 9px 22px rgba(0, 0, 0, .2);
}

.sales-loan-condition-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sales-loan-condition-title>span {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #ff5364;
  background: rgba(226, 13, 31, .16);
  font-size: 19px;
}

.sales-loan-condition-title>div {
  min-width: 0;
  flex: 1;
}

.sales-loan-condition-title h2 {
  margin: 0;
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-loan-condition-title small {
  display: block;
  margin-top: 3px;
  color: #94a9bd;
  font-size: 9px;
}

.sales-loan-condition-title>b {
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 9px;
  white-space: nowrap;
}

.sales-loan-condition-title .is-active {
  color: #d9fff0;
  background: rgba(33, 155, 96, .25);
}

.sales-loan-condition-title .is-inactive {
  color: #d7dce3;
  background: rgba(118, 126, 138, .28);
}

.sales-loan-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 11px 0 9px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sales-loan-metrics>div {
  min-width: 0;
  padding: 0 7px;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.sales-loan-metrics>div:first-child {
  padding-left: 0;
}

.sales-loan-metrics>div:last-child {
  padding-right: 0;
  border-right: 0;
}

.sales-loan-metrics span {
  display: block;
  color: #94a9bd;
  font-size: 9px;
}

.sales-loan-metrics strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.sales-loan-points {
  display: grid;
  gap: 4px;
  color: #c5d0db;
  font-size: 10px;
  line-height: 1.35;
}

.sales-loan-points span::first-letter {
  color: #49d490;
}

.sales-loan-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
}

.sales-loan-card-actions a {
  padding: 6px 9px;
  border-radius: 8px;
  background: #1a2b3d;
  color: #dceaff;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.sales-loan-card-actions .sales-loan-delete {
  background: transparent;
  border: 1px solid rgba(240, 65, 79, .55);
  color: #ff8490;
}

@media (min-width:761px) {
  .sales-loan-conditions-home {
    padding-top: 22px;
  }
}

/* Loan condition editor. */
.sales-loan-form-page {
  min-height: 100vh;
  background: radial-gradient(circle at 84% 0, rgba(138, 9, 25, .25), transparent 30%), linear-gradient(180deg, #070a0e, #0d070a);
}

.sales-loan-form-home {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 13px 12px 96px;
}

.sales-loan-form-head {
  margin: 3px 0 11px;
}

.sales-loan-form-head p {
  margin: 0 0 3px;
  color: #ff4051;
  font-size: 10px;
  font-weight: 850;
}

.sales-loan-form-head h1 {
  margin: 0;
  color: #fff;
  font-size: 21px;
  line-height: 1.18;
}

.sales-loan-form-head span {
  display: block;
  margin-top: 4px;
  color: #9da8b8;
  font-size: 10px;
}

.sales-loan-form-card {
  padding: 13px;
  border: 1px solid rgba(226, 13, 31, .38);
  border-radius: 16px;
  background: #121b25;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.sales-loan-form-card form {
  display: grid;
  gap: 7px;
}

.sales-loan-form-card label {
  display: grid;
  gap: 4px;
  color: #dce6f1;
  font-size: 11px;
  font-weight: 800;
}

.sales-loan-form-card input,
.sales-loan-form-card select,
.sales-loan-form-card textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #2d3d4d;
  border-radius: 10px;
  outline: 0;
  background: #0b1017;
  color: #fff;
  font: inherit;
  font-size: 12px;
}

.sales-loan-form-card textarea {
  min-height: 64px;
  resize: vertical;
}

.sales-loan-form-card input:focus,
.sales-loan-form-card select:focus,
.sales-loan-form-card textarea:focus {
  border-color: #ed1a2d;
  box-shadow: 0 0 0 2px rgba(237, 26, 45, .14);
}

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

.sales-loan-form-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 3px;
}

.sales-loan-form-actions a,
.sales-loan-form-actions button {
  display: grid;
  min-height: 41px;
  place-items: center;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.sales-loan-form-actions a {
  border: 1px solid #ed1a2d;
  color: #fff;
}

.sales-loan-form-actions button {
  border: 0;
  background: linear-gradient(135deg, #ff3347, #b90816);
  color: #fff;
}

@media (max-width:360px) {
  .sales-loan-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Exact field rhythm for the loan-condition editor. */
@media (max-width:760px) {
  .sales-loan-form-page .sales-loan-form-card {
    padding: 14px 12px;
  }

  .sales-loan-form-page .sales-loan-form-card form {
    gap: 12px;
  }

  .sales-loan-form-page .sales-loan-form-card label {
    gap: 6px;
    font-size: 11px;
  }

  .sales-loan-form-page .sales-loan-form-grid {
    gap: 9px;
  }

  .sales-loan-form-page .sales-loan-form-grid label {
    gap: 6px;
  }

  .sales-loan-form-page .sales-loan-form-card input,
  .sales-loan-form-page .sales-loan-form-card select {
    min-height: 40px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="benefits"] {
    min-height: 96px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="note"] {
    min-height: 64px;
  }
}

/* Loan-logo upload and preview. */
.sales-loan-form-card label small {
  color: #94a9bd;
  font-size: 9px;
  font-weight: 700;
}

.sales-loan-form-card input[type="file"] {
  min-height: 42px;
  padding: 8px;
  font-size: 10px;
}

.sales-loan-logo-preview {
  display: block;
  width: 54px;
  height: 54px;
  margin-top: -7px;
  object-fit: contain;
  border: 1px solid #2d3d4d;
  border-radius: 10px;
  background: #fff;
}

.sales-loan-condition-title .sales-loan-bank-logo {
  overflow: hidden;
  background: #fff;
}

.sales-loan-condition-title .sales-loan-bank-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Balanced vertical rhythm for the loan-condition form. */
@media (max-width:760px) {
  .sales-loan-form-page .sales-loan-form-home {
    padding: 11px 12px 94px;
  }

  .sales-loan-form-page .sales-loan-form-head {
    margin: 2px 0 10px;
  }

  .sales-loan-form-page .sales-loan-form-head h1 {
    margin-bottom: 3px;
  }

  .sales-loan-form-page .sales-loan-form-card {
    padding: 14px 13px;
  }

  .sales-loan-form-page .sales-loan-form-card form {
    gap: 10px;
  }

  .sales-loan-form-page .sales-loan-form-card label {
    gap: 5px;
    line-height: 1.25;
  }

  .sales-loan-form-page .sales-loan-form-grid {
    gap: 9px;
  }

  .sales-loan-form-page .sales-loan-form-card input,
  .sales-loan-form-page .sales-loan-form-card select {
    min-height: 40px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="benefits"] {
    min-height: 82px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="note"] {
    min-height: 58px;
  }

  .sales-loan-form-page .sales-loan-form-actions {
    margin-top: 2px;
  }
}

/* Keep compact two-column controls even on 349px-wide phones. */
@media (max-width:760px) {
  .sales-loan-form-page .sales-loan-form-home {
    padding-top: 8px;
  }

  .sales-loan-form-page .sales-loan-form-head {
    margin-bottom: 7px;
  }

  .sales-loan-form-page .sales-loan-form-card {
    padding: 12px;
    border-radius: 14px;
  }

  .sales-loan-form-page .sales-loan-form-card form {
    gap: 8px;
  }

  .sales-loan-form-page .sales-loan-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }

  .sales-loan-form-page .sales-loan-form-card label {
    gap: 4px;
    font-size: 10px;
  }

  .sales-loan-form-page .sales-loan-form-card input,
  .sales-loan-form-page .sales-loan-form-card select {
    min-height: 37px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .sales-loan-form-page .sales-loan-form-card input[type="file"] {
    min-height: 37px;
    padding: 6px;
    font-size: 9px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="benefits"] {
    min-height: 70px;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="note"] {
    min-height: 50px;
  }
}

/* Remove inherited form margins that were making the loan form too tall. */
@media (max-width:760px) {
  .sales-loan-form-page .sales-loan-form-card form {
    gap: 6px !important;
  }

  .sales-loan-form-page .sales-loan-form-card form>label,
  .sales-loan-form-page .sales-loan-form-card .sales-loan-form-grid,
  .sales-loan-form-page .sales-loan-form-card .sales-loan-form-actions {
    margin: 0 !important;
  }

  .sales-loan-form-page .sales-loan-form-card label {
    gap: 3px !important;
  }

  .sales-loan-form-page .sales-loan-form-grid {
    gap: 6px !important;
  }

  .sales-loan-form-page .sales-loan-form-card input,
  .sales-loan-form-page .sales-loan-form-card select {
    min-height: 36px !important;
  }

  .sales-loan-form-page .sales-loan-form-card input[type="file"] {
    min-height: 34px !important;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="benefits"] {
    min-height: 62px !important;
  }

  .sales-loan-form-page .sales-loan-form-card textarea[name="note"] {
    min-height: 44px !important;
  }
}

/* Loan-condition search: one compact row to preserve card space. */
.sales-loan-search {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 4px 6px;
  border-radius: 11px;
}

.sales-loan-search>span {
  flex: 0 0 15px;
  font-size: 15px;
  line-height: 1;
}

.sales-loan-search input {
  flex: 1 1 auto;
  width: 0;
  min-height: 30px;
  padding: 0 2px;
  font-size: 10px;
}

.sales-loan-search select {
  flex: 0 0 62px;
  width: 62px;
  min-height: 30px;
  padding: 3px 4px;
  border-radius: 7px;
  font-size: 8px;
}

.sales-loan-search select[name="status"] {
  flex-basis: 72px;
  width: 72px;
}

.sales-loan-search button {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
}

@media (max-width:380px) {
  .sales-loan-search {
    gap: 4px;
    padding: 4px;
  }

  .sales-loan-search select {
    flex-basis: 54px;
    width: 54px;
    font-size: 7px;
  }

  .sales-loan-search select[name="status"] {
    flex-basis: 62px;
    width: 62px;
  }
}

/* Keep the loan search action locked at the right edge on every mobile width. */
.sales-loan-search {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 62px 72px 32px;
  gap: 5px;
}

.sales-loan-search input {
  width: 100%;
}

.sales-loan-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 32px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1;
}

@media (max-width:380px) {
  .sales-loan-search {
    grid-template-columns: 15px minmax(0, 1fr) 54px 62px 32px;
    gap: 4px;
  }
}

/* Modern authentication screen. */
.auth-modern-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
  overflow: auto;
  background: radial-gradient(circle at 8% 7%, rgba(229, 28, 48, .26), transparent 31%), radial-gradient(circle at 91% 94%, rgba(141, 14, 29, .27), transparent 28%), #090c12;
}

.auth-modern-card {
  display: grid;
  grid-template-columns: minmax(250px, .85fr) minmax(310px, 1fr);
  width: min(100%, 780px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 22px;
  background: #111823;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42);
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: 34px;
  background: linear-gradient(155deg, rgba(18, 20, 28, .84), rgba(106, 8, 23, .92)), url('../images/bma-sales-tools-header.jpeg') center/cover;
  border-right: 1px solid rgba(255, 255, 255, .1);
}

.auth-brand-panel img {
  width: 142px;
  max-width: 100%;
  height: auto;
  padding: 7px;
  border-radius: 8px;
  background: #080a0e;
}

.auth-brand-panel p {
  max-width: 235px;
  margin: 17px 0 0;
  color: #e9edf4;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.auth-login-panel {
  padding: 42px 40px 30px;
  background: linear-gradient(145deg, #141d28, #0e141d);
}

.auth-intro>span {
  color: #ff5062;
  font-size: 11px;
  font-weight: 850;
}

.auth-intro h1 {
  margin: 6px 0 5px;
  color: #fff;
  font-size: 27px;
  line-height: 1.2;
}

.auth-intro p {
  margin: 0;
  color: #9aa8ba;
  font-size: 11px;
}

.auth-modern-form {
  display: grid;
  gap: 14px;
  margin-top: 25px;
}

.auth-modern-form label {
  display: grid;
  gap: 6px;
  color: #dce5ef;
  font-size: 11px;
  font-weight: 800;
}

.auth-modern-form input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid #334354;
  border-radius: 10px;
  outline: 0;
  background: #0b1119;
  color: #fff;
  font: 600 12px inherit;
}

.auth-modern-form input::placeholder {
  color: #6f7e90;
}

.auth-modern-form input:focus {
  border-color: #ea1d34;
  box-shadow: 0 0 0 3px rgba(234, 29, 52, .14);
}

.auth-modern-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 5px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff3047, #bd0b1c);
  color: #fff;
  font: 850 13px inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(191, 10, 29, .26);
}

.auth-modern-form button span {
  font-size: 20px;
  line-height: 1;
}

.auth-login-panel .alert {
  margin-top: 18px;
  font-size: 11px;
}

.auth-register-link {
  margin: 22px 0 0;
  color: #9ba9bb;
  font-size: 11px;
  text-align: center;
}

.auth-register-link a {
  color: #ff5062;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width:620px) {
  .auth-modern-page {
    padding: 14px
  }

  .auth-modern-card {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 18px
  }

  .auth-brand-panel {
    min-height: 142px;
    padding: 19px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background-position: center
  }

  .auth-brand-panel img {
    width: 116px
  }

  .auth-brand-panel p {
    margin-top: 9px;
    font-size: 10px
  }

  .auth-login-panel {
    padding: 28px 22px 24px
  }

  .auth-intro h1 {
    font-size: 23px
  }

  .auth-modern-form {
    margin-top: 20px;
    gap: 12px
  }
}

.auth-register-card {
  min-height: 520px;
}

.auth-password-hint {
  margin-top: -7px;
  color: #93a2b5;
  font-size: 9px;
  line-height: 1.45;
}

.auth-register-card .auth-login-panel {
  padding-top: 34px;
}

@media (max-width:620px) {
  .auth-register-card {
    min-height: 0;
  }

  .auth-register-card .auth-login-panel {
    padding-top: 27px;
  }
}

.auth-help-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: #556579;
  font-size: 10px;
}

.auth-help-links a {
  color: #aeb9c8;
  text-decoration: none;
}

.auth-help-links a:hover {
  color: #ff5062;
}

.a2hs-btn {
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  margin-top: 13px;
  border: 1px solid #354557;
  border-radius: 9px;
  background: #172232;
  color: #e6edf5;
  font: 800 10px inherit;
  cursor: pointer;
}

.a2hs-btn span {
  color: #ff5062;
  font-size: 14px;
}

/* Tighter login rhythm. */
.auth-modern-card {
  min-height: 420px;
}

.auth-brand-panel {
  padding: 27px 30px;
}

.auth-login-panel {
  padding: 31px 34px 24px;
}

.auth-intro h1 {
  margin: 4px 0 3px;
}

.auth-modern-form {
  gap: 10px;
  margin-top: 17px;
}

.auth-modern-form label {
  gap: 4px;
}

.auth-modern-form input {
  min-height: 40px;
}

.auth-modern-form button {
  min-height: 41px;
  margin-top: 2px;
}

.auth-register-link {
  margin: 15px 0 0;
}

.auth-help-links {
  margin-top: 9px;
}

.a2hs-btn {
  min-height: 34px;
  margin-top: 9px;
}

@media (max-width:620px) {
  .auth-brand-panel {
    min-height: 125px;
    padding: 16px 20px;
  }

  .auth-login-panel {
    padding: 23px 20px 19px;
  }

  .auth-modern-form {
    margin-top: 15px;
    gap: 9px;
  }

  .auth-modern-form input {
    min-height: 39px;
  }

  .auth-register-link {
    margin-top: 13px;
  }
}

/* Raise the login card in the viewport. */
.auth-modern-page {
  place-items: start center;
  padding-top: 13px;
  padding-bottom: 18px;
}

@media (max-width:620px) {
  .auth-modern-page {
    padding-top: 8px;
    padding-bottom: 12px;
  }
}

/* Larger touch targets for login credentials. */
.auth-modern-form input {
  min-height: 50px;
  padding: 0 15px;
  font-size: 13px;
}

.auth-modern-form label {
  font-size: 12px;
}

@media (max-width:620px) {
  .auth-modern-form input {
    min-height: 48px;
    font-size: 13px;
  }
}

/* Prominent account-opening calls to action. */
.auth-register-link {
  margin: 15px 0 7px;
}

.auth-open-account {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(255, 67, 86, .78);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255, 43, 64, .2), rgba(182, 8, 24, .26));
  color: #ff5a6a;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(209, 17, 38, .16);
}

.auth-open-account span {
  font-size: 17px;
  line-height: 1;
}

.auth-help-links .auth-open-account-mini {
  color: #ff6473;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pull credential fields closer to their labels. */
.auth-modern-form {
  gap: 8px;
}

.auth-modern-form label {
  gap: 2px;
  line-height: 1.15;
}

.auth-modern-form label+label {
  margin-top: 1px;
}

@media (max-width:620px) {
  .auth-modern-form {
    gap: 7px;
  }

  .auth-modern-form label {
    gap: 2px;
  }
}

/* Registration subscription and payment-proof fields. */
.auth-register-card {
  min-height: 590px;
}

.auth-modern-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #334354;
  border-radius: 10px;
  outline: 0;
  background: #0b1119;
  color: #fff;
  font: 600 11px inherit;
}

.auth-modern-form select:focus {
  border-color: #ea1d34;
  box-shadow: 0 0 0 3px rgba(234, 29, 52, .14);
}

.auth-modern-form label small {
  color: #93a2b5;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.35;
}

.auth-slip-input {
  padding: 8px !important;
  font-size: 9px !important;
  line-height: 1.2;
}

.auth-register-card .auth-modern-form {
  gap: 9px;
}

@media (max-width:620px) {
  .auth-register-card {
    min-height: 0;
  }

  .auth-modern-form select {
    min-height: 44px;
  }

  .auth-register-card .auth-modern-form {
    gap: 8px;
  }
}

.auth-admin-notify {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #1c9b5e;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 16px rgba(18, 125, 74, .24);
}

.auth-admin-notify span {
  font-size: 15px;
  line-height: 1;
}

.sales-loan-card-actions form {
  margin: 0;
}

.sales-loan-card-actions .sales-loan-delete {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cf1630;
  cursor: pointer;
  font: inherit;
}

.swal-open {
  overflow: hidden;
}

.swal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 9, .72);
  backdrop-filter: blur(5px);
}

.swal-card {
  width: min(100%, 355px);
  padding: 22px 19px 17px;
  border: 1px solid rgba(255, 68, 84, .38);
  border-radius: 18px;
  background: linear-gradient(145deg, #172230, #0d131c);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .56);
  text-align: center;
}

.swal-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin: 0 auto 11px;
  place-items: center;
  border: 2px solid #ff3a4e;
  border-radius: 50%;
  color: #ff5969;
  font-size: 27px;
  font-weight: 900;
}

.swal-card h2 {
  margin: 0;
  font-size: 18px;
}

.swal-card p {
  margin: 9px 4px 18px;
  color: #b7c1ce;
  font-size: 11px;
  line-height: 1.55;
}

.swal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.swal-actions button {
  min-height: 38px;
  border-radius: 9px;
  font: 850 11px inherit;
  cursor: pointer;
}

.swal-cancel {
  border: 1px solid #344556;
  background: #172331;
  color: #d9e1ea;
}

.swal-confirm {
  border: 1px solid #e83349;
  background: linear-gradient(135deg, #ff354a, #b9081b);
  color: #fff;
}

/* Equal, non-wrapping actions on loan-condition cards. */
.sales-loan-card-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.sales-loan-card-actions>a,
.sales-loan-card-actions>form {
  display: block;
  flex: 0 0 84px;
  width: 84px;
  height: 42px;
  margin: 0;
}

.sales-loan-card-actions>a,
.sales-loan-card-actions>form>.sales-loan-delete {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
  border-radius: 9px;
  font: 800 11px/1 inherit;
  white-space: nowrap;
  text-decoration: none;
}

.sales-loan-card-actions>a {
  background: #1a2f45;
  color: #dceaff;
}

.sales-loan-card-actions>form>.sales-loan-delete {
  border: 1px solid #df2740;
  background: transparent;
  color: #ff8c98;
  cursor: pointer;
}

.sales-loan-card-actions>form>.sales-loan-delete:hover {
  background: rgba(226, 13, 31, .13);
}
/* Explicitly lock the Details action to the same dimensions as Delete. */
.sales-loan-card-actions > .sales-loan-detail {
  display:flex !important;
  flex:0 0 84px !important;
  width:84px !important;
  min-width:84px !important;
  max-width:84px !important;
  height:42px !important;
  min-height:42px !important;
  max-height:42px !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  padding:0 !important;
}

/* Isolated delete action: same size as the Details button. */
.sales-loan-card-actions > form > .sales-loan-card-delete {
  display:flex !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  padding:0 !important;
  border:1px solid #df2740;
  border-radius:9px;
  background:transparent;
  color:#ff8c98;
  font:800 11px/1 inherit;
  white-space:nowrap;
  cursor:pointer;
}
.sales-loan-card-actions > form > .sales-loan-card-delete:hover { background:rgba(226,13,31,.13); }

/* Lift the loan-card action row slightly closer to the card content. */
.sales-loan-card-actions { margin-top:4px; }

/* Make the delete form a real 84×42 action slot; hidden fields cannot shift its button. */
.sales-loan-card-actions > form {
  display:flex !important;
  flex:0 0 84px !important;
  width:84px !important;
  height:42px !important;
  align-items:stretch !important;
  padding:0 !important;
  overflow:hidden;
}
.sales-loan-card-actions > form > input[type="hidden"] { display:none !important; }
.sales-loan-card-actions > form > .sales-loan-card-delete {
  flex:1 1 auto;
  align-self:stretch;
}

/* The form is layout-transparent, so Delete is aligned as a direct action item. */
.sales-loan-card-actions > form {
  display:contents !important;
}
.sales-loan-card-actions > form > .sales-loan-card-delete {
  flex:0 0 84px !important;
  width:84px !important;
  min-width:84px !important;
  max-width:84px !important;
  height:42px !important;
  min-height:42px !important;
  max-height:42px !important;
  margin:0 !important;
  align-self:center !important;
}

/* Calculation-history card actions. */
.sales-history-actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.sales-history-actions form { margin:0; }
.sales-history-actions a,
.sales-history-actions button { display:inline-flex; min-height:30px; align-items:center; justify-content:center; box-sizing:border-box; padding:6px 9px; border-radius:9px; font:850 10px/1 inherit; text-decoration:none; cursor:pointer; }
.sales-history-actions a { border:1px solid rgba(226,13,31,.62); background:rgba(226,13,31,.16); color:#fff; }
.sales-history-actions button { border:1px solid rgba(240,65,79,.78); background:transparent; color:#ff8c98; }
.sales-history-actions button:hover { background:rgba(226,13,31,.13); }

/* Equal PDF and delete controls in calculation history. */
.sales-history-actions { gap:7px; }
.sales-history-actions > a,
.sales-history-actions > form,
.sales-history-actions > form > button {
  width:42px;
  min-width:42px;
  height:32px;
  min-height:32px;
  margin:0;
  padding:0;
  box-sizing:border-box;
}
.sales-history-actions > a,
.sales-history-actions > form > button { display:flex; align-items:center; justify-content:center; }
