/* «Мои встречи» — стили по дизайн-системе LD (DealersManagePanel/docs/design-system-ld-apps-b24.md),
   мобильная адаптация: шапка 56 px, отступы 16 px на телефоне и 24 px на десктопе, safe-area. */

@font-face {font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/montserrat-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;}
@font-face {font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/montserrat-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
@font-face {font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;}
@font-face {font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/montserrat-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

:root {
  --ff-basic: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --yellow-700: #FFEC00;
  --yellow-500: #FFF24D;
  --yellow-100: #FFFAB3;
  --yellow-700-30: #FFEC004D;

  --grey-900: #1B1B1B;
  --grey-800: #383737;
  --grey-700: #262626;
  --grey-600: #333333;
  --grey-500: #515151;
  --grey-450: #666666;
  --grey-100: #BEBEBE;
  --grey-50: #EAEAEA;

  --white-1000: #FFFFFF;
  --grey-25: #F9F9F9;
  --mist-50: #FBFBFC;
  --mist-80: #F9F8FB;
  --mist-90: #F6F5FB;
  --mist-100: #F2F1F6;
  --mist-200: #ECEBF0;
  --mist-300: #DDDAE8;
  --mist-500: #B2B0B8;
  --mist-700: #6E668F;

  --status-success: #23AD59;
  --status-success-bg: #E9F7EF;
  --status-warning: #FCB73E;
  --status-warning-bg: #FFF8EC;
  --status-danger: #F4364C;
  --status-danger-bg: #FEEBEE;

  --bg-page-light: var(--mist-100);
  --lightcard-bg: var(--mist-50);
  --text-primary: var(--grey-700);
  --text-muted: var(--grey-100);
  --border-default: var(--mist-300);
  --border-line-default: var(--mist-100);
  --table-row-hover-bg: var(--mist-90);
  --product-sku-and-attr: var(--mist-700);
  --placeholder: var(--mist-500);

  --box-shadow: 0 0 16px rgb(187 178 224 / 20%);
  --yellow-button-hover-shadow: 0 8px 32px var(--yellow-700-30);
  --radius-sm: 4px;
  --radius-md: 8px;

  --gutter: 16px;
  --header-h: 56px;
}
@media (min-width: 768px) {:root {--gutter: 24px; --header-h: 64px;}}

* {box-sizing: border-box;}
html {-webkit-text-size-adjust: 100%;}
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page-light);
  color: var(--text-primary);
  font-family: var(--ff-basic);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Каркас */
.ld-app-layout {min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg-page-light);}
.ld-main {flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: var(--gutter); padding-bottom: calc(var(--gutter) + env(safe-area-inset-bottom));}

/* Шапка */
.ld-app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) calc(var(--gutter) + env(safe-area-inset-right)) 0 calc(var(--gutter) + env(safe-area-inset-left));
  background-color: var(--grey-700);
  border-bottom: 2px solid var(--yellow-700);
  color: var(--white-1000);
}
.ld-app-header__brand {display: flex; align-items: center; gap: 12px; min-width: 0;}
.ld-logo {display: block; width: 52px; height: auto; flex-shrink: 0;}
.ld-app-header__title {margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--white-1000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.ld-app-header__title-full {display: none;}
.ld-app-header__actions {display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--grey-50); min-width: 0;}
.ld-app-header__user {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;}
@media (min-width: 480px) {
  .ld-app-header {gap: 16px;}
  .ld-logo {width: 60px;}
  .ld-app-header__title {font-size: 16px;}
  .ld-app-header__title-full {display: inline;}
  .ld-app-header__title-short {display: none;}
}

/* Заголовки */
.ld-section-title {margin: 0 0 16px; font-size: 18px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;}
@media (min-width: 768px) {.ld-section-title {font-size: 20px;}}
.ld-card__title {margin: 0 0 12px; font-size: 16px; font-weight: 600; line-height: 1.4;}
.ld-meta {color: var(--product-sku-and-attr); font-size: 12px; font-weight: 500; letter-spacing: 0.05em;}

/* Карточки */
.ld-card {background: var(--lightcard-bg); border-radius: var(--radius-md); box-shadow: var(--box-shadow); padding: var(--gutter);}
.ld-stack {display: flex; flex-direction: column; gap: 12px;}
.ld-card > .ld-btn + .ld-stack:not(:empty) {margin-top: 16px;}

/* Ключ — значение */
.ld-spec-row {display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 12px;}
.ld-spec-row:last-child {margin-bottom: 0;}
.ld-spec-row__label {color: var(--grey-450); font-weight: 400; display: flex; flex: 1; align-items: baseline;}
.ld-spec-row__label::after {content: ""; flex: 1; margin: 0 8px; border-bottom: 2px dotted #C5CFDA;}
.ld-spec-row__value {color: var(--text-primary); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums;}

/* Статусы и бейджи */
.ld-status {display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; white-space: nowrap;}
.ld-status::before {content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grey-450);}
.ld-status--success::before {background: var(--status-success);}
.ld-status--warning::before {background: var(--status-warning);}
.ld-status--danger::before {background: var(--status-danger);}
.ld-badge {display: inline-flex; align-items: center; padding: 4px 8px; background: var(--yellow-700); color: var(--grey-700); border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;}
.ld-badge--warning {background: var(--status-warning-bg); color: var(--grey-700); box-shadow: inset 0 0 0 1px var(--status-warning);}

/* Кнопки */
.ld-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 39px; padding: 0 24px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-family: var(--ff-basic); font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0.05em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 200ms ease-out, box-shadow 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}
.ld-btn--primary {background: var(--yellow-700); color: var(--grey-700);}
.ld-btn--primary:hover:not(:disabled) {background: var(--yellow-500); box-shadow: var(--yellow-button-hover-shadow);}
.ld-btn--primary:disabled {background: var(--yellow-100); color: var(--text-muted); cursor: not-allowed;}
.ld-btn--secondary {background: var(--grey-700); color: var(--white-1000);}
.ld-btn--secondary:hover:not(:disabled) {background: var(--yellow-700); color: var(--grey-700);}
.ld-btn--outline {background: transparent; border-color: var(--mist-300); color: var(--text-primary);}
.ld-btn--outline:hover:not(:disabled) {border-color: var(--text-primary); background: var(--mist-90);}
.ld-btn--lg {height: 49px; padding: 0 32px; font-size: 14px;}
.ld-btn--sm {height: 32px; padding: 0 16px; border-radius: var(--radius-sm); font-size: 11px;}
.ld-btn--block {width: 100%;}

/* Служебные экраны (загрузка, сессия истекла, ошибки) */
.ld-screen-message {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: 60vh; padding: var(--gutter); text-align: center;
}
.ld-screen-message h2 {margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; max-width: 28em;}
.ld-screen-message p {margin: 0; color: var(--grey-500); max-width: 32em;}
.ld-screen-message__icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow-700); color: var(--grey-700); font-size: 26px; font-weight: 700;
}
.ld-screen-message__icon--danger {background: var(--status-danger-bg); color: var(--status-danger);}
.ld-spinner {width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--mist-300); border-top-color: var(--grey-700); animation: ld-spin 800ms linear infinite;}
@keyframes ld-spin {to {transform: rotate(360deg);}}
@media (prefers-reduced-motion: reduce) {.ld-spinner {animation-duration: 2400ms;}}

.ld-screen-message--inline {min-height: 30vh;}

/* Заголовок экрана */
.ld-page-head {display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px;}
.ld-page-head .ld-section-title {margin: 0 0 4px;}
.ld-capitalize::first-letter {text-transform: uppercase;}
.ld-main {max-width: 760px;}

/* Шапка: иконка настроек */
.ld-icon-btn {display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); color: var(--white-1000); font-size: 20px; text-decoration: none; flex-shrink: 0; transition: background-color 200ms ease-out, color 200ms ease-out;}
.ld-icon-btn:hover, .ld-icon-btn:focus-visible {background: var(--yellow-700); color: var(--grey-700);}

/* Кнопки: состояние загрузки и фокус */
.ld-btn__spinner {width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ld-spin 700ms linear infinite;}
.ld-btn:focus-visible, .ld-link:focus-visible, .ld-back:focus-visible, .ld-meeting-card:focus-visible {outline: 2px solid var(--grey-700); outline-offset: 2px;}
.ld-btn--secondary:disabled, .ld-btn--outline:disabled {opacity: 0.5; cursor: not-allowed;}

/* Уведомления (вместо alert) */
.ld-notice {display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; line-height: 1.45; border-left: 4px solid var(--grey-450); background: var(--white-1000); box-shadow: var(--box-shadow);}
.ld-notice--static {margin: 12px 0 0; box-shadow: none;}
.ld-notice--success {border-left-color: var(--status-success); background: var(--status-success-bg);}
.ld-notice--warning {border-left-color: var(--status-warning); background: var(--status-warning-bg);}
.ld-notice--danger {border-left-color: var(--status-danger); background: var(--status-danger-bg);}
.ld-notice--info {border-left-color: var(--mist-700); background: var(--mist-90);}
.ld-notice__close {flex-shrink: 0; width: 28px; height: 28px; margin: -4px -8px -4px 0; border: 0; background: transparent; color: var(--grey-500); font-size: 20px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm);}
.ld-hint-list {margin: 8px 0; padding-left: 18px; font-weight: 400;}
.ld-hint-list li {margin-bottom: 6px;}

/* Карточки и предупреждения */
.ld-card--warning {box-shadow: inset 4px 0 0 var(--status-warning), var(--box-shadow);}
.ld-card--warning p {margin: 0 0 8px;}
.ld-card--warning .ld-btn {margin-top: 8px;}
.ld-empty p {margin: 0;}
.ld-status--done::before {background: var(--mist-700);}

/* Рабочий день */
.ld-workday {display: flex; flex-direction: column; gap: 12px;}
.ld-workday__row {display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;}
.ld-workday .ld-status {font-size: 14px; font-weight: 600;}
.ld-confirm p {margin: 0 0 12px; font-weight: 500;}
.ld-confirm__actions {display: flex; gap: 8px; flex-wrap: wrap;}
.ld-confirm__actions .ld-btn {flex: 1 1 140px;}

/* Список встреч: карточки с фирменной анимацией заполнения слева направо */
.ld-meeting-list {display: flex; flex-direction: column; gap: 12px;}
.ld-meeting-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; padding-right: 40px;
  background: var(--lightcard-bg); border-radius: var(--radius-md); box-shadow: var(--box-shadow);
  color: var(--text-primary); text-decoration: none;
}
.ld-meeting-card::before {content: ""; position: absolute; inset: 0; z-index: -1; background: var(--table-row-hover-bg); transform: scaleX(0); transform-origin: left center; transition: transform 300ms ease-out; pointer-events: none;}
.ld-meeting-card::after {content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--mist-500);}
.ld-meeting-card:active::before {transform: scaleX(1);}
@media (hover: hover) and (pointer: fine) {.ld-meeting-card:hover::before {transform: scaleX(1);}}
.ld-meeting-card__top {display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;}
.ld-meeting-card__time {font-size: 13px; font-weight: 600; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; color: var(--product-sku-and-attr);}
.ld-meeting-card__badges {display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;}
.ld-meeting-card__title {font-size: 15px; font-weight: 600; line-height: 1.35;}
.ld-meeting-card__place {font-size: 13px; color: var(--grey-500);}

/* Экран встречи */
.ld-back {display: inline-flex; align-items: center; min-height: 40px; margin: -8px 0 8px; color: var(--grey-500); font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-decoration: none;}
.ld-back:hover {color: var(--text-primary);}
.ld-meeting {display: flex; flex-direction: column; gap: 16px;}
.ld-meeting > .ld-notice {margin-bottom: 0;}
.ld-meeting__status {display: flex; align-items: center; gap: 12px; flex-wrap: wrap;}
.ld-meeting__title {margin: 12px 0 8px; font-size: 18px; font-weight: 600; line-height: 1.35;}
@media (min-width: 768px) {.ld-meeting__title {font-size: 20px;}}
.ld-specs {margin-top: 16px;}
.ld-spec-row__value {max-width: 65%; overflow-wrap: anywhere;}
.ld-link {display: inline-flex; margin-top: 8px; color: var(--grey-700); font-weight: 600; font-size: 13px; text-decoration: underline; text-decoration-color: var(--yellow-700); text-decoration-thickness: 2px; text-underline-offset: 4px;}

/* Строка-индикатор координат */
.ld-geo {display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;}
.ld-geo--info {background: var(--mist-90); color: var(--grey-500);}
.ld-geo--success {background: var(--status-success-bg);}
.ld-geo--warning {background: var(--status-warning-bg);}
.ld-geo--danger {background: var(--status-danger-bg);}
.ld-geo__pulse {width: 8px; height: 8px; border-radius: 50%; background: var(--mist-700); animation: ld-pulse 1200ms ease-in-out infinite;}
@keyframes ld-pulse {0%, 100% {opacity: 0.3;} 50% {opacity: 1;}}
@media (prefers-reduced-motion: reduce) {.ld-geo__pulse, .ld-btn__spinner {animation: none;}}

/* Поля ввода */
.ld-field {display: flex; flex-direction: column; gap: 8px;}
.ld-field__label {color: var(--grey-500); font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;}
.ld-input {height: 44px; width: 100%; padding: 11px 16px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background-color: var(--white-1000); color: var(--text-primary); font-family: var(--ff-basic); font-size: 16px; font-weight: 500; letter-spacing: 0.03em; outline: none; transition: border-color 150ms ease-out;}
.ld-input::placeholder {color: var(--placeholder); font-weight: 400;}
.ld-input:hover {border-color: var(--placeholder);}
.ld-input:focus {border-color: var(--text-primary);}
.ld-textarea {height: auto; min-height: 96px; resize: vertical; line-height: 1.45;}
@media (min-width: 768px) {.ld-input {font-size: 14px; height: 40px;} .ld-textarea {height: auto;}}

/* Нижняя панель действий: на телефоне прилипает к низу экрана с учётом safe-area */
.ld-actionbar {position: sticky; bottom: 0; z-index: 5; margin: 0 calc(-1 * var(--gutter)) calc(-1 * var(--gutter)); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgb(242 241 246 / 0), var(--bg-page-light) 24%);}
.ld-actionbar__note {margin: 0 0 8px; text-align: center;}
@media (min-width: 768px) {.ld-actionbar {position: static; margin: 0; padding: 0; background: none;}}

/* Листинг настроек */
.ld-list {background: var(--lightcard-bg); border-radius: var(--radius-md); box-shadow: var(--box-shadow); width: 100%; overflow: hidden; --ld-cols: minmax(0, 1fr) auto; --ld-gap: 16px;}
.ld-list__head {display: grid; grid-template-columns: var(--ld-cols); gap: 0 var(--ld-gap); padding: 16px var(--gutter) 12px; border-bottom: 1px solid var(--border-line-default);}
.ld-list__head-cell {color: var(--product-sku-and-attr); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.05em; text-transform: uppercase;}
.ld-list__head-cell--right {text-align: right;}
.ld-list-row {position: relative; isolation: isolate; display: grid; grid-template-columns: var(--ld-cols); gap: 0 var(--ld-gap); padding: 12px var(--gutter); align-items: center; border-bottom: 1px solid var(--border-line-default);}
.ld-list-row:last-child {border-bottom: none;}
.ld-list-row::before {content: ""; position: absolute; inset: 0 0 -1px; z-index: -1; background: var(--table-row-hover-bg); transform: scaleX(0); transform-origin: left center; transition: transform 300ms ease-out; pointer-events: none;}
@media (hover: hover) and (pointer: fine) {.ld-list-row:hover::before {transform: scaleX(1);}}
.ld-list-row__title {font-size: 14px; font-weight: 500;}
.ld-list-row__sku {color: var(--product-sku-and-attr); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;}
.ld-list-row__action {display: flex; justify-content: flex-end;}
