/* =====================================================================
   ИЭММ — ЛИЧНЫЙ КАБИНЕТ v1 (стили к js/iemm-lk.js)
   ОТКАТ: в /bitrix/php_interface/iemm_cabinet.php поставить IEMM_LK = false.
   ===================================================================== */
:root {
	--lk-accent: var(--theme-base-color, #365edc);
	--lk-ink: #1a1d24; --lk-text: #4a5160; --lk-muted: #8a91a0;
	--lk-line: #eceff5; --lk-soft: #f6f8fc; --lk-r: 14px;
	--lk-shadow: 0 10px 30px rgba(20, 30, 60, .10);
}
.iemm-ic { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.iemm-muted { color: var(--lk-muted); font-size: 13px; }
.iemm-pad { padding: 24px 0; }
.iemm-lk__loading { color: var(--lk-muted); padding: 30px 0; font-size: 14px; }

/* ---------- кнопки, поля ---------- */
.iemm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--lk-line); background: #fff; color: var(--lk-ink) !important; font-size: 13.5px; font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s; }
.iemm-btn:hover { border-color: rgba(54, 94, 220, .45); color: var(--lk-accent) !important; }
.iemm-btn:disabled { opacity: .6; cursor: default; }
.iemm-btn--primary { background: var(--lk-accent); border-color: var(--lk-accent); color: #fff !important; }
.iemm-btn--primary:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(54, 94, 220, .28); }
.iemm-btn--primary.is-done { background: #1f9d55; border-color: #1f9d55; }
.iemm-btn--ghost { background: transparent; }
.iemm-btn--danger:hover { color: #d33 !important; border-color: rgba(221, 51, 51, .4); }
.iemm-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #e3e7ef; border-radius: 10px; background: #fff; font-size: 14px; color: var(--lk-ink); outline: 0; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.iemm-input:focus { border-color: var(--lk-accent); box-shadow: 0 0 0 3px rgba(54, 94, 220, .14); }
.iemm-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: rgba(54, 94, 220, .1); color: var(--lk-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- приветствие и плитки ---------- */
.iemm-hello { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border: 1px solid var(--lk-line); border-radius: var(--lk-r); background: linear-gradient(135deg, rgba(54, 94, 220, .07), rgba(54, 94, 220, 0) 60%), #fff; margin-bottom: 18px; flex-wrap: wrap; }
.iemm-hello__ava, .iemm-cab__ava { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--lk-accent); color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.iemm-hello__txt { flex: 1 1 200px; min-width: 0; }
.iemm-hello__t { font-size: 20px; font-weight: 700; color: var(--lk-ink); margin-bottom: 2px; }
.iemm-hello__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.iemm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.iemm-tile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 18px; min-height: 140px; border: 1px solid var(--lk-line); border-radius: var(--lk-r); background: #fff; color: var(--lk-ink) !important; text-decoration: none !important; transition: border-color .2s, box-shadow .2s, transform .2s; box-sizing: border-box; }
.iemm-tile:hover { border-color: rgba(54, 94, 220, .35); box-shadow: var(--lk-shadow); transform: translateY(-2px); }
.iemm-tile__ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(54, 94, 220, .08); color: var(--lk-accent); margin-bottom: 10px; transition: background .2s, color .2s; }
.iemm-tile:hover .iemm-tile__ic { background: var(--lk-accent); color: #fff; }
.iemm-tile__t { font-weight: 700; font-size: 15px; }
.iemm-tile__v { font-size: 13.5px; color: var(--lk-accent); font-weight: 600; }
.iemm-tile__s { font-size: 12.5px; color: var(--lk-muted); line-height: 1.35; }

.iemm-sec { margin-bottom: 28px; }
.iemm-sec__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.iemm-sec__h h3 { margin: 0; font-size: 19px; color: var(--lk-ink); }
.iemm-sec__h a { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; text-decoration: none; }

/* ---------- заказы ---------- */
.iemm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.iemm-toolbar__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.iemm-toolbar .iemm-search { max-width: 300px; }
.iemm-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--lk-soft); }
.iemm-tabs button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--lk-text); cursor: pointer; }
.iemm-tabs button span { color: var(--lk-muted); font-weight: 500; margin-left: 3px; }
.iemm-tabs button.is-on { background: #fff; color: var(--lk-ink); box-shadow: 0 1px 4px rgba(20, 30, 60, .1); }
.iemm-order { border: 1px solid var(--lk-line); border-radius: var(--lk-r); background: #fff; margin-bottom: 12px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.iemm-order:hover { border-color: rgba(54, 94, 220, .3); box-shadow: 0 4px 16px rgba(20, 30, 60, .06); }
.iemm-order__head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--lk-line); background: var(--lk-soft); }
.iemm-order__no { font-weight: 700; color: var(--lk-ink); font-size: 15px; }
.iemm-order__sum { font-weight: 700; font-size: 16px; color: var(--lk-ink); min-width: 90px; text-align: right; }
.iemm-order__body { padding: 14px 20px; }
.iemm-order__items { list-style: none; margin: 0; padding: 0; }
.iemm-order__items li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--lk-line); font-size: 14px; }
.iemm-order__items li:last-child { border-bottom: 0; }
.iemm-order__items li:before { display: none !important; }
.iemm-order__text { font-size: 14px; color: var(--lk-text); line-height: 1.55; }
.iemm-order__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; font-size: 13.5px; color: var(--lk-ink); }
.iemm-order__meta span { display: block; font-size: 12px; color: var(--lk-muted); }
.iemm-order__foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 16px; }

/* ---------- карточки товаров в ЛК ---------- */
.iemm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.iemm-grid--strip { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.iemm-pc { position: relative; display: flex; flex-direction: column; border: 1px solid var(--lk-line); border-radius: var(--lk-r); background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s; }
.iemm-pc:hover { border-color: rgba(54, 94, 220, .3); box-shadow: var(--lk-shadow); transform: translateY(-2px); }
.iemm-pc__img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 14px; background: #fff; }
.iemm-pc__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.iemm-pc__noimg { color: #c9cfdb; }
.iemm-pc__body { display: flex; flex-direction: column; gap: 6px; padding: 0 14px 14px; flex: 1; }
.iemm-pc__art { font-size: 11.5px; color: var(--lk-muted); }
.iemm-pc__name { font-size: 13.5px; line-height: 1.35; color: var(--lk-ink) !important; text-decoration: none !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.iemm-pc__name:hover { color: var(--lk-accent) !important; }
.iemm-pc__price { margin-top: auto; font-size: 15px; color: var(--lk-ink); }
.iemm-pc__price s { color: var(--lk-muted); font-size: 12.5px; margin-left: 4px; }
.iemm-pc__btns { display: flex; gap: 6px; }
.iemm-pc__btns .iemm-btn { flex: 1; height: 36px; padding: 0 10px; font-size: 13px; }
.iemm-pc__btns .iemm-btn--ghost { flex: 0 0 36px; padding: 0; }

/* ---------- сердечко ---------- */
.iemm-fav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; padding: 0; background: none; color: #9aa1b0; cursor: pointer; transition: color .15s, transform .15s, background .15s, box-shadow .15s; }
.iemm-fav-btn:hover { color: #e5484d; }
.iemm-fav-btn.is-on { color: #e5484d; }
.iemm-fav-btn.is-on .iemm-ic path { fill: currentColor; }
.iemm-fav-btn:active { transform: scale(.9); }
.iemm-fav-btn--card { position: absolute; z-index: 3; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(20, 30, 60, .12); }
.iemm-fav-btn--card:hover { transform: scale(1.1); }
.iemm-fav-btn--detail { height: 44px; padding: 0 18px; margin-top: 10px; width: 100%; border: 1px solid var(--lk-line); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 600; color: var(--lk-ink); }
.iemm-fav-btn--detail .iemm-ic { color: #e5484d; }
.iemm-fav-btn--detail:hover { border-color: rgba(229, 72, 77, .45); color: #e5484d; }
.iemm-fav-btn--detail.is-on { background: rgba(229, 72, 77, .06); border-color: rgba(229, 72, 77, .35); }
@keyframes iemmPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.iemm-fav-btn.is-on .iemm-ic { animation: iemmPop .3s ease; }

/* счётчик избранного */
.iemm-fav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; box-sizing: border-box; }
.iemm-fav-count.is-empty { display: none; }

/* ---------- шапка: «Избранное» ---------- */
.iemm-hdr__fav .iemm-hdr__fav-ico { position: relative; display: block; color: #333; }
.iemm-hdr__fav .iemm-ic { width: 23px; height: 21px; display: block; }
.iemm-hdr__fav a:hover .iemm-hdr__fav-ico { color: var(--lk-accent); }
.iemm-hdr__fav .iemm-fav-count { position: absolute; top: -6px; right: -10px; }

/* ---------- шапка: меню «Кабинет» (как у ВсеИнструменты) ---------- */
.cabinet-dropdown.iemm-cab .dropdown { min-width: 250px; padding: 8px !important; border-radius: 14px !important; border: 1px solid var(--lk-line) !important; box-shadow: 0 16px 40px rgba(20, 30, 60, .14) !important; background: #fff; }
.iemm-cab__head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--lk-line); text-decoration: none !important; }
.iemm-cab__ava { width: 38px; height: 38px; font-size: 14px; }
.iemm-cab__who { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.iemm-cab__who b { color: var(--lk-ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.iemm-cab__who small { color: var(--lk-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item { padding: 0 !important; border: 0 !important; margin: 0 !important; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item > a { display: flex !important; align-items: center; gap: 10px; padding: 8px 10px !important; border-radius: 9px; font-size: 13.5px !important; color: var(--lk-ink) !important; text-align: left; white-space: nowrap; transition: background .15s, color .15s; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item > a .iemm-ic { color: var(--lk-muted); transition: color .15s; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item > a:hover { background: var(--lk-soft); color: var(--lk-accent) !important; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item > a:hover .iemm-ic { color: var(--lk-accent); }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item > a .iemm-fav-count { margin-left: auto; }
.cabinet-dropdown.iemm-cab .cabinet-dropdown__item--last { margin-top: 6px !important; padding-top: 6px !important; border-top: 1px solid var(--lk-line) !important; }

/* ---------- боковое меню ЛК ---------- */
.side-menu.iemm-lk-side > li > .link-wrapper > a { display: flex !important; align-items: center; gap: 10px; }
.side-menu.iemm-lk-side > li > .link-wrapper > a .iemm-ic { color: var(--lk-muted); transition: color .15s; }
.side-menu.iemm-lk-side > li > .link-wrapper > a:hover .iemm-ic, .side-menu.iemm-lk-side > li > .link-wrapper > a.link--active .iemm-ic { color: var(--lk-accent); }
.side-menu.iemm-lk-side > li > .link-wrapper > a .iemm-fav-count { margin-left: auto; }

/* ---------- организации ---------- */
.iemm-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.iemm-org { display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid var(--lk-line); border-radius: var(--lk-r); background: #fff; }
.iemm-org.is-default { border-color: rgba(54, 94, 220, .4); box-shadow: 0 0 0 3px rgba(54, 94, 220, .06); }
.iemm-org__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.iemm-org__head .iemm-tile__ic { margin: 0; }
.iemm-org__name { font-weight: 700; font-size: 15.5px; color: var(--lk-ink); }
.iemm-org__name .iemm-badge { margin-left: 6px; vertical-align: middle; }
.iemm-org__rows { display: grid; grid-template-columns: 80px 1fr; gap: 5px 10px; margin: 0 0 14px; font-size: 13.5px; }
.iemm-org__rows dt { color: var(--lk-muted); font-weight: 400; }
.iemm-org__rows dd { margin: 0; color: var(--lk-ink); word-break: break-word; }
.iemm-org__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.iemm-org__btns .iemm-btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
.iemm-form { padding: 22px 24px; border: 1px solid rgba(54, 94, 220, .3); border-radius: var(--lk-r); background: #fff; margin-bottom: 16px; box-shadow: var(--lk-shadow); }
.iemm-form__t { font-size: 17px; font-weight: 700; color: var(--lk-ink); margin-bottom: 14px; }
.iemm-form__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.iemm-field { display: flex; flex-direction: column; gap: 5px; margin: 0; font-weight: 400; }
.iemm-field > span { font-size: 12.5px; color: var(--lk-muted); }
.iemm-field--full { grid-column: 1 / -1; }
.iemm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lk-ink); font-weight: 400; cursor: pointer; }
.iemm-check input { width: 17px; height: 17px; accent-color: var(--lk-accent); margin: 0; }
.iemm-form__err { color: #d33; font-size: 13.5px; min-height: 18px; margin: 10px 0 4px; }
.iemm-form__btns { display: flex; gap: 8px; }
.iemm-org-select { margin-bottom: 8px !important; }

/* ---------- пустые состояния, тосты ---------- */
.iemm-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 46px 20px; border: 1px dashed #dfe4ee; border-radius: var(--lk-r); background: #fff; }
.iemm-empty__ic { display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 70px; border-radius: 50%; background: rgba(54, 94, 220, .08); color: var(--lk-accent); margin-bottom: 6px; }
.iemm-empty__t { font-size: 17px; font-weight: 700; color: var(--lk-ink); }
.iemm-empty__d { font-size: 14px; color: var(--lk-muted); max-width: 420px; margin-bottom: 8px; }
.iemm-lk-toast { position: fixed; z-index: 10050; left: 50%; bottom: 28px; transform: translate(-50%, 16px); display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: #1a1d24; color: #fff; font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.iemm-lk-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.iemm-lk-toast a { color: #9db4ff !important; text-decoration: underline; }
.iemm-lk-toast .iemm-ic { color: #ff6b70; }
.iemm-lk-toast .iemm-ic path { fill: currentColor; }

/* профиль */
.iemm-lk-profile__pass { margin-top: 18px; font-size: 14px; }

/* ---------- адаптив ---------- */
@media (max-width: 1199px) { .iemm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991px) { .iemm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .iemm-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) {
	.iemm-hello { padding: 18px; }
	.iemm-hello__btns { width: 100%; }
	.iemm-hello__btns .iemm-btn { flex: 1; }
	.iemm-tile { min-height: 0; padding: 14px; }
	.iemm-tile__ic { width: 36px; height: 36px; margin-bottom: 6px; }
	.iemm-grid, .iemm-grid--strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.iemm-order__head { grid-template-columns: 1fr auto; }
	.iemm-order__sum { grid-column: 1 / -1; text-align: left; }
	.iemm-form__grid { grid-template-columns: 1fr; }
	.iemm-orgs { grid-template-columns: 1fr; }
	.iemm-toolbar .iemm-search { max-width: none; }
}
/* ===== ЛИЧНЫЙ КАБИНЕТ v1 — КОНЕЦ ===== */
