/* MobileParts — user cabinet styles (leptos SPA at /app/…).
   Reuses the slate/green tokens defined in auth.css (loaded together). */

/* ----- shell ----- */

.cab {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.cab__navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 58px;
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 30;
}

.cab__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.cab__brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2322C55E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3'/%3E%3C/svg%3E");
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
}

.cab__body {
  display: flex;
  flex: 1;
  align-items: stretch;
}

.cab__sidebar {
  width: 264px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.2rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

/* ----- profile block (bottom of the sidebar, opens a menu) ----- */

.cab__profile {
  position: relative;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.cab__profile-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 0.2rem);
  display: flex;
  flex-direction: column;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.12);
  z-index: 5;
}

.cab__profile-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.cab__profile-item:hover {
  background: var(--light);
}

.cab__profile-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--muted);
}

.cab__profile-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.cab__profile-btn:hover {
  background: var(--light);
}

.cab__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cab__profile-meta {
  min-width: 0;
}

.cab__profile-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab__profile-email {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- nav ----- */

.cab__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cab__nav-item a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.cab__nav-item a:hover {
  background: var(--light);
  color: var(--text);
}

.cab__nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

li.cab__nav-item--active a {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}

/* ----- content ----- */

.cab__content {
  flex: 1;
  min-width: 0;
  padding: 1.8rem 2.4rem;
}

.cab__page-head {
  margin-bottom: 1.6rem;
}

.cab__crumbs {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

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

.cab__crumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}

.cab__title {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cab__subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

.cab__loading {
  color: var(--muted);
  padding: 2rem;
}

/* ----- empty state ----- */

.cab__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cab__empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--light);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab__empty-icon svg {
  width: 24px;
  height: 24px;
}

.cab__empty-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.cab__empty-text {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 400px;
}

/* ----- buttons ----- */

.cab__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

a.cab__btn {
  text-decoration: none;
}

.cab__btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.cab__btn--green {
  background: var(--green);
  color: #052e16;
}

.cab__btn--green:hover:not(:disabled) {
  background: #16a34a;
}

.cab__btn--outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.cab__btn--outline:hover:not(:disabled) {
  border-color: var(--muted);
}

/* ----- settings modal ----- */

.cab-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cab-modal__scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgb(15 23 42 / 0.45);
  cursor: default;
}

.cab-modal__card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cab-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cab-modal__title {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.cab-modal__close {
  border: 0;
  background: var(--light);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab-modal__close svg {
  width: 16px;
  height: 16px;
}

.cab-modal__close:hover {
  color: var(--text);
}

.cab-modal__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: var(--light);
  border-radius: 10px;
  padding: 0.3rem;
}

.cab-modal__tab {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.cab-modal__tab--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.cab-modal__stub {
  padding: 1rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ----- mobile ----- */

.cab__topbar {
  display: none;
}

.cab__burger {
  display: none;
  border: 0;
  background: none;
  padding: 0.3rem;
  cursor: pointer;
  color: var(--text);
}

.cab__burger svg {
  width: 22px;
  height: 22px;
}

.cab__scrim {
  display: none;
}

@media (max-width: 900px) {
  .cab__navbar {
    gap: 0.8rem;
    padding: 0.55rem 1rem;
  }

  .cab__burger {
    display: inline-flex;
  }

  .cab__scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(15 23 42 / 0.4);
    border: 0;
    padding: 0;
    cursor: default;
  }

  .cab__sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    gap: 0.6rem;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .cab__sidebar--open {
    transform: none;
    box-shadow: 0 10px 40px rgb(15 23 42 / 0.2);
  }

  .cab__profile {
    margin-top: 0.4rem;
  }

  .cab__content {
    padding: 1.4rem 1rem;
  }

  .cab-modal {
    padding: 0.75rem;
    align-items: flex-end;
  }
}

/* ----- listings ----- */

.cab__page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.cab__tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.cab__tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cab__tab:hover {
  border-color: var(--muted);
}

.cab__tab--active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.cab__table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cab__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 760px;
}

.cab__table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cab__table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cab__table tr:last-child td {
  border-bottom: none;
}

.cab__part {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 240px;
}

.cab__thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--light);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cab__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.cab__thumb--empty svg {
  width: 20px;
  height: 20px;
}

.cab__part-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.cab__part-title {
  font-weight: 600;
}

.cab__part-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.cab__badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.cab__badge--active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.cab__badge--draft {
  background: var(--light);
  color: var(--muted);
}

.cab__badge--archived {
  background: #fef3c7;
  color: #92400e;
}

.cab__row-actions {
  display: flex;
  gap: 0.3rem;
}

.cab__icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.cab__icon-btn:hover {
  border-color: var(--muted);
  color: var(--text);
}

.cab__icon-btn--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ----- wizard ----- */

.cab__steps {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.cab__step {
  font-weight: 600;
}

.cab__step--active {
  color: var(--green-dark);
}

.cab__wizard-step {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cab__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2.2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cab__dropzone:hover {
  border-color: var(--green);
  background: rgb(34 197 94 / 0.04);
}

.cab__file-input {
  display: none;
}

.cab__dropzone-title {
  font-weight: 700;
}

.cab__dropzone-sub {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 420px;
}

.cab__dropzone-note {
  font-size: 0.82rem;
  color: var(--muted);
}

.cab__thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cab__thumb-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cab__thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cab__thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgb(15 23 42 / 0.7);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab__grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.cab__wiz-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
}

.cab__wiz-title-value {
  font-weight: 700;
}

.cab__wizard-foot {
  display: flex;
  justify-content: flex-end;
}

.cab__wizard-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  flex-wrap: wrap;
}

.cab__wizard-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ----- orders ----- */

.cab__orders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cab__order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cab__order-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.cab__order-num {
  font-weight: 800;
  font-size: 1.02rem;
}

.cab__order-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.cab__order-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
}

.cab__order-item-title {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
}

.cab__order-item-sum {
  font-weight: 700;
  white-space: nowrap;
}

.cab__order-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.cab__order-seller {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 1;
  min-width: 0;
}

a.cab__order-seller:hover {
  color: var(--text);
}

.cab__order-total {
  font-weight: 800;
  font-size: 1.05rem;
}

.cab__order-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

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

.cab__order-track {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.cab__badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.cab__badge--confirmed {
  background: #dbeafe;
  color: #1d4ed8;
}

.cab__badge--shipped {
  background: #ede9fe;
  color: #6d28d9;
}

.cab__badge--cancelled {
  background: var(--danger-soft);
  color: #b91c1c;
}

/* ----- reviews ----- */

.cab__reviews {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cab__review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.cab__review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cab__review-stars {
  color: #f59e0b;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.cab__review-text {
  margin: 0.4rem 0 0.2rem;
  font-size: 0.93rem;
}

.cab__review-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.cab__stars-pick {
  display: flex;
  gap: 0.3rem;
}

.cab__star-btn {
  border: 0;
  background: var(--light);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.cab__star-btn--on {
  background: #fef3c7;
  color: #f59e0b;
}

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

  .cab__page-actions {
    justify-content: stretch;
  }

  .cab__page-actions .cab__btn {
    width: 100%;
    justify-content: center;
  }
}

/* ----- cart ----- */

.cab__cart {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.2rem;
  align-items: start;
}

.cab__cart-lines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cab__cart-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.cab__cart-seller {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.cab__cart-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.cab__cart-line-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.cab__cart-line-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.cab__cart-line-title:hover {
  text-decoration: underline;
}

.cab__qty {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cab__qty-num {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 600;
}

.cab__cart-line-sum {
  font-weight: 700;
  min-width: 96px;
  text-align: right;
}

.cab__cart-total {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: sticky;
  top: 74px;
}

.cab__cart-total-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.cab__cart-total-row--sum {
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
}

/* ----- favorites ----- */

.cab__fav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cab__fav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cab__fav-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--light);
}

.cab__fav-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.cab__fav-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.cab__fav-title:hover {
  text-decoration: underline;
}

.cab__fav-price {
  font-weight: 800;
}

.cab__fav-foot {
  margin-top: auto;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

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

  .cab__cart-total {
    position: sticky;
    bottom: 0;
  }

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

  .cab__cart-line-sum {
    display: none;
  }
}

/* ----- settings page (single page, no tabs) ----- */

.cab__settings {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 560px;
}

.cab__settings-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
}

.cab__settings-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ----- dashboard (/app) ----- */

.cab__dash {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}

.cab__dash-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cab__dash-card:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.cab__dash-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cab__dash-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cab__dash-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.cab__dash-h2 {
  font-size: 1rem;
  margin: 0 0 0.7rem;
}

.cab__dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cab__dash-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.cab__dash-list li:last-child .cab__dash-row {
  border-bottom: 0;
}

.cab__dash-row:hover {
  background: var(--light);
}

.cab__dash-kind {
  font-weight: 600;
  min-width: 4.5rem;
}

.cab__dash-sum {
  margin-left: auto;
  font-weight: 600;
}

/* ----- messages (/app/messages) ----- */

.chat {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 58px - 12rem);
  min-height: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat__list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 0.6rem;
}

.chat__group {
  margin-bottom: 0.8rem;
}

.chat__group-name {
  margin: 0.2rem 0.4rem 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.chat__group-role {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.chat__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: calc(100% - 0.8rem);
  margin: 0 0 0.15rem 0.8rem;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-left: 2px solid var(--border);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.chat__item:hover {
  background: var(--light);
}

.chat__item--active {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.chat__item-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__item-last {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat__placeholder,
.chat__empty {
  margin: auto;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chat__back {
  display: none;
  border: 0;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
}

.chat__head-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat__head-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat__head-part {
  font-size: 0.8rem;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  padding: 0.55rem 1rem;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.chat__order-main {
  font-weight: 600;
}

.chat__order-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.chat__order-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.chat__track {
  width: 150px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.chat__wait {
  color: var(--muted);
  font-size: 0.8rem;
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
}

.chat__msg {
  align-self: flex-start;
  max-width: min(75%, 520px);
  padding: 0.5rem 0.75rem;
  background: var(--light);
  border-radius: 14px 14px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat__msg--mine {
  align-self: flex-end;
  background: var(--green-soft);
  border-radius: 14px 14px 4px 14px;
}

.chat__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.chat__img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
}

.chat__time {
  align-self: flex-end;
  font-size: 0.68rem;
  color: var(--muted);
}

.chat__composer {
  border-top: 1px solid var(--border);
  padding: 0.7rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat__row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat__input {
  flex: 1;
  resize: none;
  min-height: 0;
}

.chat__attach {
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.3rem;
}

.chat__send {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.chat__send svg {
  width: 20px;
  height: 20px;
  transform: translateX(1px);
}

.chat__send:hover:not(:disabled) {
  background: var(--green-dark);
  transform: scale(1.05);
}

.chat__send:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat__badge,
.cab__nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.cab__nav-badge {
  margin-left: auto;
}

.chat__error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.82rem;
}

.chat__attached {
  position: relative;
  align-self: flex-start;
}

.chat__attached img {
  height: 64px;
  border-radius: 8px;
  display: block;
}

.chat__attached button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 900px) {
  .chat {
    grid-template-columns: 1fr;
    height: calc(100dvh - 58px - 9rem);
  }

  .chat__pane {
    display: none;
  }

  .chat--open .chat__pane {
    display: flex;
  }

  .chat--open .chat__list {
    display: none;
  }

  .chat__list {
    border-right: 0;
  }

  .chat__back {
    display: inline-block;
  }

  .chat__msg {
    max-width: 88%;
  }
}

/* ----- telegram-style composer ----- */

.tg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "input expand"
    "bar bar";
  gap: 0.15rem 0.5rem;
  padding: 0.6rem 0.7rem 0.5rem;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 22px;
}

.tg:focus-within {
  border-color: var(--green);
}

.tg__input {
  grid-area: input;
  width: 100%;
  min-height: 24px;
  max-height: 140px;
  padding: 0.1rem 0.2rem;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.tg__expand,
.tg__collapse {
  grid-area: expand;
  align-self: start;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tg__expand:hover {
  background: var(--border);
}

.tg__expand svg {
  width: 17px;
  height: 17px;
}

.tg__collapse {
  display: none;
}

.tg__bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.tg__bar .chat__send {
  margin-left: auto;
  width: 38px;
  height: 38px;
}

.tg__icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tg__icon:hover {
  background: var(--border);
  color: var(--text);
}

.tg__icon svg {
  width: 22px;
  height: 22px;
}

.tg__emoji {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.4rem);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.1rem;
  width: min(100%, 340px);
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.15);
  z-index: 5;
}

.tg__emoji button {
  border: 0;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
}

.tg__emoji button:hover {
  background: var(--light);
}

/* fullscreen editor */
.chat__composer--expanded {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 0.8rem;
  background: var(--surface);
  border: 0;
}

.chat__composer--expanded .tg {
  flex: 1;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "expand expand"
    "input input"
    "bar bar";
  background: var(--surface);
  border: 0;
  border-radius: 0;
  padding: 0;
}

.chat__composer--expanded .tg__collapse {
  display: inline-flex;
}

.chat__composer--expanded .tg__expand {
  display: none;
}

.chat__composer--expanded .tg__input {
  max-height: none;
  height: 100% !important;
  font-size: 1.05rem;
  padding: 0.5rem 0.3rem;
}

.chat__composer--expanded .tg__emoji {
  bottom: 3.6rem;
}

/* editing banner + message actions */
.chat__editing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.7rem;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dark);
}

.chat__editing button {
  border: 0;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: inherit;
}

.chat__msg--mine {
  cursor: pointer;
}

.chat__msg--selected {
  box-shadow: 0 0 0 2px var(--green);
}

.chat__msg-actions {
  display: flex;
  gap: 0.6rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgb(15 23 42 / 0.08);
}

.chat__msg-actions button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
}

.chat__msg-actions .chat__msg-del {
  color: #b91c1c;
}

/* ----- product cards in the cabinet (same look as the catalog list) ----- */

.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}

.pc {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.pc:hover {
  transform: translateY(-2px);
}

.pc__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 120% at 20% 10%, #e2e8f0 0%, #f1f5f9 45%, #cbd5e1 100%);
  border-bottom: 1px solid var(--border);
}

.pc__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc__badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid rgb(34 197 94 / 0.35);
}

.pc__fav {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.92);
  color: var(--danger);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pc__fav:hover {
  transform: scale(1.08);
}

.pc__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1rem;
  flex: 1;
}

.pc__model {
  margin: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pc__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

.pc__title a:hover {
  color: var(--green-dark);
}

.pc__rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pc__star {
  color: #cbd5e1;
  font-size: 0.85rem;
}

.pc__star--on {
  color: #f59e0b;
}

.pc__count,
.pc__stock {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.pc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.6rem;
}

.pc__price {
  font-weight: 700;
}

.cab__order-item-link:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.chat__msg--wide {
  min-width: min(78%, 360px);
}

.cab__btn--dark {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.cab__btn--dark:hover {
  background: #1e293b;
}
