.legal-entities-page { --le-line: #dce4e8; --le-muted: #5d6a72; color: #1c2931; max-width: 1200px; margin-inline: auto; letter-spacing: 0; }
.legal-entities-page *, .le-dialog * { box-sizing: border-box; }
.legal-entities-page [hidden] { display: none !important; }
.legal-entities-page button, .legal-entities-page input, .legal-entities-page select, .legal-entities-page textarea { font: inherit; letter-spacing: 0; }
.legal-entities-page .btn { min-height: 44px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; font-size: 14px; }
.legal-entities-page .btn-primary { background: #187445; border-color: #187445; }
.legal-entities-page .btn-primary:hover { background: #125c36; border-color: #125c36; }
.legal-entities-page .btn-outline-primary { color: #16673e; border-color: #b1cfc0; background: white; }
.legal-entities-page .btn-outline-primary:hover { background: #eaf4ed; color: #16673e; }
.legal-entities-page .btn-outline-primary:disabled { color: #7c8a91; border-color: #d3dde1; background: white; opacity: 1; }
.legal-entities-page button:focus-visible, .legal-entities-page input:focus-visible, .legal-entities-page select:focus-visible, .legal-entities-page textarea:focus-visible { outline: 3px solid #338bc6; outline-offset: 2px; }
.le-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; }
.le-lead { flex: 1 1 320px; margin: 0; max-width: 760px; color: var(--le-muted); font-size: 15px; line-height: 1.5; }
.le-muted { color: var(--le-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.le-label { display: block; color: var(--le-muted); font-size: 13px; font-weight: 600; }
.le-warning { color: #9a4b00; }
.le-notice { padding: 12px 16px; margin-bottom: 16px; border-left: 3px solid #187445; background: #eaf4ed; color: #14532d; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.le-failure { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 12px 16px; border-left: 3px solid #b74350; background: #fcf0f1; color: #8b2734; }
.le-failure p { margin: 0; flex: 1 1 240px; overflow-wrap: anywhere; }
.le-entities { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; padding-bottom: 28px; }
.le-card { border: 1px solid var(--le-line); border-radius: 8px; padding: 16px; background: white; min-width: 0; }
.le-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.le-card-head h3 { margin: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.le-card-head .btn { flex: 0 0 auto; }
.le-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0; }
.le-facts dt { color: var(--le-muted); font-size: 13px; font-weight: 600; }
.le-facts dd { margin: 0; font-size: 16px; font-weight: 600; }
.le-details { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.le-empty { margin: 0; padding: 16px; border: 1px dashed #bccbd2; border-radius: 8px; color: var(--le-muted); }
.le-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.le-section-head h3 { margin: 0; font-size: 20px; }
.le-check-all { display: inline-flex; align-items: center; gap: 22px; min-height: 44px; margin: 8px 0 0; padding-left: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.legal-entities-page input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; accent-color: #187445; }
.le-store-list { margin-top: 8px; border-top: 1px solid var(--le-line); }
.le-store { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 12px 20px; padding: 14px 0; border-bottom: 1px solid var(--le-line); }
.le-store > * { min-width: 0; }
.le-store-check { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; cursor: pointer; }
.le-store:not(:has(.le-store-check)) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.le-store strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.le-store small { display: block; color: var(--le-muted); font-size: 13px; overflow-wrap: anywhere; }
.le-store small:empty { display: none; }
.le-store-closed .le-store-name strong { color: var(--le-muted); }
.le-store-plan strong { color: #855919; }
.le-dialog { padding: 0; border: 1px solid #d6e1e6; border-radius: 8px; width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); color: #1c2931; }
.le-dialog-wide { width: min(720px, calc(100% - 24px)); }
.le-dialog::backdrop { background: #172b3a80; }
.le-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.le-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #d6e1e6; flex: 0 0 auto; }
.le-dialog header > div { min-width: 0; }
.le-dialog h2 { margin: 0; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.le-dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow-y: auto; min-height: 0; }
.le-dialog footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid #d6e1e6; flex: 0 0 auto; }
.le-dialog label { display: block; margin: 0; font-size: 13px; font-weight: 600; min-width: 0; }
.le-dialog input:not([type="checkbox"]), .le-dialog select, .le-dialog textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 5px; border: 1px solid #bccbd2; border-radius: 6px; padding: 9px 12px; background: white; color: #1c2931; font-size: 16px; }
.le-dialog input, .le-dialog select, .le-dialog textarea { font-weight: 400; }
.le-dialog textarea { resize: vertical; line-height: 1.45; }
.le-dialog-body > .btn { align-self: flex-start; }
.le-dialog input:disabled, .le-dialog select:disabled, .le-dialog textarea:disabled { background: #f3f6f7; color: #53626b; }
.le-close, .le-remove { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #526570; font-size: 26px; line-height: 1; }
.le-close:hover, .le-remove:hover { border-color: #c5d6dc; background: #edf3f5; color: #183c49; }
.le-chosen { margin: 4px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.5; max-height: 160px; overflow-y: auto; }
.le-question { padding: 12px 14px; border-left: 3px solid #b7791f; background: #fdf6e7; color: #5c3d0c; font-size: 14px; line-height: 1.5; }
.le-question p { margin: 0 0 6px; overflow-wrap: anywhere; }
.le-question p:last-child { margin-bottom: 0; }
.le-error { margin: 0; color: #a12626; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.le-periods { display: flex; flex-direction: column; }
.le-period { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 124px 44px; align-items: end; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid var(--le-line); }
.le-period:first-child { padding-top: 0; }
.le-period-start strong { display: flex; align-items: center; min-height: 44px; margin-top: 5px; font-size: 15px; }
.le-period-state { align-self: end; display: flex; align-items: center; min-height: 44px; color: var(--le-muted); font-size: 13px; white-space: nowrap; }
.le-period-planned { color: #855919; font-weight: 600; }
.store-legal-entity { margin-top: 20px; padding-top: 16px; border-top: 1px solid #dce3e4; min-width: 0; font-size: 14px; line-height: 1.5; }
.store-legal-entity:empty, .store-legal-entity[hidden] { display: none; }
.store-legal-entity h3 { margin: 0 0 8px; font-size: 18px; }
.store-legal-entity p { margin: 0 0 4px; overflow-wrap: anywhere; }
.store-legal-entity label { display: block; font-size: 14px; font-weight: 600; }
.store-legal-entity select { margin-top: 6px; font-size: 16px; min-height: 44px; }
.store-legal-entity .store-legal-entity-note { color: #53626b; }
.store-legal-entity .store-legal-entity-error { color: #a12626; }
@media (max-width: 860px) {
  .le-store, .le-store:not(:has(.le-store-check)) { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 12px; }
  .le-store:not(:has(.le-store-check)) { grid-template-columns: minmax(0, 1fr); }
  .le-store-check { grid-row: 1 / span 4; align-self: start; }
  .le-store-owner, .le-store-plan, .le-store-history { grid-column: 2; }
  .le-store:not(:has(.le-store-check)) > * { grid-column: 1; }
  .le-store-plan:empty { display: none; }
  .le-store-history { justify-self: start; margin-top: 4px; }
}
@media (max-width: 560px) {
  .le-period { grid-template-columns: minmax(0, 1fr) 44px; }
  .le-period > label, .le-period > .le-period-start { grid-column: 1; }
  .le-period-state { grid-column: 1; min-height: 0; }
  .le-period > .le-remove, .le-period > span:last-child { grid-column: 2; grid-row: 1; align-self: end; }
  .le-dialog footer .btn { flex: 1 1 auto; }
}
.le-issues { margin-bottom: 20px; padding: 14px 16px; border-left: 3px solid #b7791f; background: #fdf6e7; color: #5c3d0c; }
.le-issues h3 { margin: 0 0 8px; font-size: 16px; }
.le-issues ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.le-issues li { overflow-wrap: anywhere; }
.le-issues li + li { margin-top: 4px; }
.le-connections { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--le-line); }
.le-connection { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 8px 0; }
.le-connection > div { min-width: 0; }
.le-connection strong { display: block; font-size: 14px; }
.le-connection .btn { flex: 0 0 auto; }
.le-connection-state { display: block; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.le-connection-ok { color: #17643c; }
.le-connection-warn { color: #855919; }
.le-connection-error { color: #a12626; }
.le-fields { display: flex; flex-direction: column; gap: 14px; }
.le-switch { display: flex !important; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.le-dialog .le-switch input, .le-dialog .le-choice input[type="radio"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: #187445; }
.le-choice { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.le-choice legend { float: none; width: auto; margin: 0 0 4px; padding: 0; font-size: 13px; font-weight: 600; color: var(--le-muted, #5d6a72); }
.le-choice > label:has(input[type="radio"]) { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 400; cursor: pointer; }
.le-result { padding: 12px 14px; border-left: 3px solid #187445; background: #eaf4ed; color: #14532d; font-size: 14px; line-height: 1.5; }
.le-result p { margin: 0 0 4px; overflow-wrap: anywhere; }
.le-result p:last-child { margin-bottom: 0; }
.le-tax-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.le-tax-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid var(--le-line); }
.le-tax-rows li > span { min-width: 0; overflow-wrap: anywhere; }
.le-tax-rows .le-tax-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.le-tax-rows .btn-link { min-height: 44px; padding: 0 8px; font-size: 14px; }
.le-tax-form { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.le-tax-form legend { float: none; width: auto; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--le-muted, #5d6a72); }
@media (max-width: 560px) {
  .le-tax-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
