.estateflow-wrapper {
    padding: 20px;
    background: #f5f7fb;
    min-height: 100%;
}

/* Sub-header row under CRM top menu (EstateFlow-specific).
   Mirrors ES9's top module bar, but keeps CRM blue header above. */
:root {
    --estateflow-modulebar-h: 40px;
}

body.estateflow-page {
    --estateflow-modulebar-left: 0px;
}

.estateflow-page .estateflow-modulebar {
    position: fixed;
    top: 50px; /* directly under CRM top bar (.ui-layout-north/#menu) */
    left: var(--estateflow-modulebar-left, 0px);
    right: 0;
    width: auto;
    height: var(--estateflow-modulebar-h);
    z-index: 100; /* under .ui-layout-north (101), above sidebars (10-20) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-sizing: border-box;
    background: #111827;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
    body.estateflow-page {
        --estateflow-modulebar-left: 0px;
    }
}

.estateflow-page .estateflow-modulebar a {
    color: inherit;
    text-decoration: none;
}

.estateflow-page .estateflow-modulebar__left,
.estateflow-page .estateflow-modulebar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.estateflow-page .estateflow-modulebar__left {
    flex: 1 1 auto;
    overflow: hidden;
}

.estateflow-page .estateflow-modulebar__right {
    flex: 0 1 auto;
}

.estateflow-page .estateflow-modulebar__crown {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.estateflow-page .estateflow-modulebar__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.estateflow-page .estateflow-modulebar__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.estateflow-page .estateflow-modulebar__link:hover {
    background: rgba(255, 255, 255, 0.14);
}

.estateflow-page .estateflow-modulebar__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-left: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.estateflow-page .estateflow-modulebar__meta::-webkit-scrollbar {
    display: none;
}

.estateflow-page .estateflow-modulebar__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
}

.estateflow-page .estateflow-modulebar__meta-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.estateflow-page .estateflow-modulebar__meta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.estateflow-page .estateflow-modulebar__meta-link:hover {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.estateflow-page .estateflow-modulebar__meta-link--head {
    font-weight: 600;
}

.estateflow-page .estateflow-modulebar__meta-link.is-active {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.estateflow-page .estateflow-modulebar__meta-num {
    color: #ffffff;
    font-weight: 700;
}

.estateflow-page .estateflow-modulebar__meta-sep {
    color: rgba(255, 255, 255, 0.45);
    margin: 0 2px;
}

.estateflow-page .estateflow-modulebar__icons {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: clamp(240px, 30vw, 520px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.estateflow-page .estateflow-modulebar__icons::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1560px) {
    .estateflow-page .estateflow-modulebar__meta-item {
        font-size: 11px;
        gap: 3px;
        padding: 3px 6px;
    }
}

@media (max-width: 1360px) {
    .estateflow-page .estateflow-modulebar__meta-item:last-child {
        display: none;
    }
}

@media (max-width: 1180px) {
    .estateflow-page .estateflow-modulebar__meta {
        display: none;
    }
}

.estateflow-page .estateflow-modulebar__icon {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    position: relative; /* badge anchor */
}

.estateflow-page .estateflow-modulebar__icon i {
    font-size: 16px;
    line-height: 1;
}

.estateflow-page .estateflow-modulebar__icon:hover {
    background: rgba(255, 255, 255, 0.10);
}

.estateflow-page .estateflow-modulebar__icon:active {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-modulebar__icon:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.estateflow-page .estateflow-modulebar__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 999px;
    background: #22c55e;
    color: #0b1020;
    font-size: 10px;
    line-height: 14px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}

.estateflow-page .estateflow-modulebar__badge.is-hidden {
    display: none;
}

.estateflow-page .estateflow-modulebar__tasks {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.estateflow-page .estateflow-modulebar__tasks:hover {
    background: rgba(255, 255, 255, 0.10);
}

.estateflow-page .estateflow-modulebar__tasks:active {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-modulebar__tasks:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.estateflow-page .estateflow-modulebar__tasksbadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 18px;
    padding: 0 8px;
    border-radius: 999px;
    background: #22c55e;
    color: #0b1020;
    font-weight: 700;
    font-size: 12px;
    line-height: 18px;
    box-sizing: border-box;
}

.estateflow-page .estateflow-modulebar__rightslot {
    display: flex;
    align-items: center;
}

.estateflow-page .estateflow-modulebar__quickadd,
.estateflow-page .estateflow-modulebar__counters {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Make CRM quick-actions ("+ / leftpop") look like the ES9 icon row when moved into the modulebar */
.estateflow-page .estateflow-modulebar .leftpop {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92);
}

.estateflow-page .estateflow-modulebar .leftpop:hover {
    background: rgba(255, 255, 255, 0.10);
}

.estateflow-page .estateflow-modulebar .leftpop:active {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-modulebar .leftpop > i {
    font-size: 16px;
    line-height: 1;
}

.estateflow-page .estateflow-modulebar .leftpop ul.menu {
    top: calc(var(--estateflow-modulebar-h) - 2px) !important;
    right: 0 !important;
    left: auto !important;
}

/* Make moved counters from #rmenu display as a compact icon row in modulebar. */
.estateflow-page .estateflow-modulebar__counters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.estateflow-page .estateflow-modulebar__counters-list li {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.estateflow-page .estateflow-modulebar__counters-list li .pops {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.estateflow-page .estateflow-modulebar__counters-list li .pops:hover {
    background: rgba(255, 255, 255, 0.10);
}

.estateflow-page .estateflow-modulebar__counters-list li .popmenu {
    top: var(--estateflow-modulebar-h) !important;
}

.estateflow-page .estateflow-modulebar__counters-list li .popmenu,
.estateflow-page .estateflow-modulebar__counters-list li .popmenu .popbody {
    position: fixed !important;
}

.estateflow-page .estateflow-modulebar__counters-list li .popmenu {
    display: none;
    z-index: 1100;
}

.estateflow-page .estateflow-modulebar__counters-list li .popmenu.open {
    display: block !important;
}

/* Keep native CRM left sidebar (#rmenu) visible below EstateFlow modulebar. */
.estateflow-page #rmenu {
    top: calc(50px + var(--estateflow-modulebar-h)) !important;
    height: calc(100vh - 50px - var(--estateflow-modulebar-h)) !important;
    display: block !important;
}

/* Hide duplicate EstateFlow label in native CRM left strip.
   Brand stays in EstateFlow modulebar (black row). */
.estateflow-page #rmenu a.razdel[data-id="estateflow"] {
    display: none !important;
}

.estateflow-page .ui-layout-west {
    top: calc(50px + var(--estateflow-modulebar-h)) !important;
    height: calc(100vh - 50px - var(--estateflow-modulebar-h)) !important;
}

.estateflow-page .ui-layout-center.simple,
.estateflow-page .ui-layout-center.compact,
.estateflow-page .ui-layout-center.outlook,
.estateflow-page .ui-layout-center.outlook--close,
.estateflow-page .ui-layout-center.outlook--w40 {
    top: calc(50px + var(--estateflow-modulebar-h)) !important;
    height: calc(100vh - 50px - var(--estateflow-modulebar-h)) !important;
}

/* EstateFlow встраивается внутрь CRM shell (inc/head.php + inc/menu.php).
   В этом режиме sidebar должен быть частью ui-layout-west, а не фиксироваться поверх CRM. */
.ui-layout-west .estateflow-sidebar {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    height: 100% !important;
    width: 100% !important;
    transform: none !important;
    z-index: auto !important;
    /* Сохраняем CRM-цвет колонки, не перекрашиваем её в ES9-градиент */
    background: transparent !important;
    overflow: visible !important;
}

.estateflow-page .ui-layout-west {
    background: var(--tenant-primary-color, var(--blue2, #01579b)) !important;
    overflow: visible !important;
}

body.estateflow-page .estateflow-header {
    display: none !important;
}

.ui-layout-west .estateflow-sidebar.collapsed {
    /* В CRM-shell не “уезжаем” и не прячем навигацию полностью:
       иначе пользователь не сможет вернуть меню обратно. */
    transform: none !important;
    display: block !important;
}

/* CRM-shell: свернутый режим (узкая икон-панель). */
.ui-layout-west.estateflow-collapsed {
    width: 56px !important;
}

/* В узком режиме оставляем только иконки + кнопку разворота */
.ui-layout-west.estateflow-collapsed .estateflow-sidebar__title,
.ui-layout-west.estateflow-collapsed .estateflow-sidebar__arrow {
    display: none !important;
}

.ui-layout-west.estateflow-collapsed .estateflow-sidebar__submenu {
    display: none !important;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__header {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 10px 0 6px;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__toggle {
    order: 0;
}

.estateflow-page .estateflow-sidebar__header {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
    padding: 8px 8px 6px;
}

.estateflow-page .estateflow-sidebar__crmbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

/* CRM quick-actions ("leftpop") moved into the EstateFlow sidebar */
.estateflow-page .estateflow-sidebar__crmbar .leftpop {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92) !important;
    background: rgba(255, 255, 255, 0.09);
    box-sizing: border-box;
}

.estateflow-page .estateflow-sidebar__crmbar .leftpop:hover {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-sidebar__crmbar .leftpop:active {
    background: rgba(255, 255, 255, 0.20);
}

.estateflow-page .estateflow-sidebar__crmbar .leftpop > i {
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.estateflow-page .estateflow-sidebar__crmbar .leftpop ul.menu {
    top: 0 !important;
    left: calc(100% + 8px) !important;
    right: auto !important;
    z-index: 1100;
}

/* CRM counters moved into the EstateFlow sidebar */
.estateflow-page .estateflow-sidebar__crmbar .counters {
    position: static !important;
    height: auto !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

.estateflow-page .estateflow-sidebar__counters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.estateflow-page .estateflow-sidebar__counters-list li {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.estateflow-page .estateflow-sidebar__counters-list li .pops {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
}

.estateflow-page .estateflow-sidebar__counters-list li .pops:hover {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-sidebar__counters-list li .pops i {
    pointer-events: none;
}

.estateflow-page .estateflow-sidebar__counters-list li .bullet {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    line-height: 14px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.estateflow-page .estateflow-sidebar__counters-list li .popmenu {
    bottom: auto !important;
    top: 0 !important;
    left: calc(100% + 8px) !important;
    right: auto !important;
    height: calc(100vh - 200px) !important;
    max-height: calc(100vh - 200px) !important;
}

.estateflow-page .estateflow-sidebar__counters-list li .popmenu {
    position: absolute !important;
}

.estateflow-page .estateflow-sidebar__counters-list li .popmenu {
    display: none;
    z-index: 1100;
}

.estateflow-page .estateflow-sidebar__counters-list li .popmenu.open {
    display: block !important;
}

.estateflow-page .estateflow-sidebar__counters-list li .popmenu .popbody {
    height: calc(100% - 45px);
    max-height: calc(100% - 45px);
    overflow: hidden;
    overflow-y: auto;
    display: block;
}

.estateflow-page .estateflow-sidebar__counters-list li.lpop .popmenu .popbody {
    height: calc(100% - 120px);
    max-height: calc(100% - 120px);
}

.estateflow-page .estateflow-sidebar__quickadd {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 8px 8px;
}

.estateflow-page .estateflow-sidebar__quickadd-toggle,
.estateflow-page .estateflow-sidebar__quickadd-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    cursor: pointer;
    box-sizing: border-box;
    padding: 7px 10px;
    text-align: left;
    transition: background-color 0.2s;
}

.estateflow-page .estateflow-sidebar__quickadd-toggle {
    margin: 0 8px 6px;
}

.estateflow-page .estateflow-sidebar__quickadd-toggle:hover,
.estateflow-page .estateflow-sidebar__quickadd-action:hover {
    background: rgba(255, 255, 255, 0.16);
}

.estateflow-page .estateflow-sidebar__quickadd-toggle.is-open {
    background: rgba(255, 255, 255, 0.18);
}

.estateflow-page .estateflow-sidebar__quickadd-toggle span,
.estateflow-page .estateflow-sidebar__quickadd-action span {
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.estateflow-page .estateflow-sidebar__quickadd-action i {
    font-size: 13px;
}

.ui-layout-west.estateflow-collapsed .estateflow-sidebar__link {
    justify-content: center;
    padding: 12px 0;
}

.ui-layout-west.estateflow-collapsed .estateflow-sidebar__link i {
    margin-right: 0;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__quickadd {
    display: none !important;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__crmbar {
    order: 1;
    width: 100%;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__counters-list {
    flex-direction: column;
    gap: 10px;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__quickadd-toggle {
    width: 34px;
    min-width: 34px;
    padding: 7px 0;
    justify-content: center;
}

.estateflow-page .ui-layout-west.estateflow-collapsed .estateflow-sidebar__quickadd-toggle span {
    display: none;
}

.estateflow-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.estateflow-title {
    font-size: 22px;
    margin: 0;
    color: #2a2e43;
}

.estateflow-subtitle {
    font-size: 13px;
    color: #6f7a90;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.estateflow-actions .button {
    margin-left: 10px;
    margin-bottom: 10px;
}

.estateflow-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-gap: 20px;
}

.estateflow-content > .estateflow-dashboard {
    grid-column: 1 / -1;
    min-width: 0;
}

.estateflow-dashboard-content {
    width: 100%;
    min-width: 0;
}

@media (max-width: 1200px) {
    .estateflow-content {
        grid-template-columns: 1fr;
    }
}

.estateflow-filters,
.estateflow-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    padding: 20px;
}

.estateflow-filter-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.filter-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #d0d7e6;
    border-radius: 6px;
    font-size: 14px;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #334155;
}

.filter-checkbox input {
    margin-right: 6px;
}

.filter-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.filter-hint {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-buttons .button {
    margin-left: 6px;
}

.estateflow-empty {
    text-align: center;
    padding: 60px 20px;
    color: #7782a0;
}

.estateflow-empty i {
    font-size: 42px;
    display: block;
    margin-bottom: 15px;
    color: #a0aec0;
}

.estateflow-match {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #eef2ff;
    gap: 15px;
}

.estateflow-match:last-child {
    border-bottom: none;
}

.estateflow-match__info strong {
    font-size: 14px;
    color: #1f2937;
}

.estateflow-match__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 180px;
}

.estateflow-match__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.estateflow-match__comment {
    margin-top: 4px;
    font-size: 12px;
    color: #475569;
    white-space: pre-wrap;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status.status-new {
    background: #e2e8f0;
    color: #1f2937;
}

.badge-status.status-sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-status.status-viewed {
    background: #ecfccb;
    color: #3f6212;
}

.badge-status.status-selected {
    background: #dcfce7;
    color: #166534;
}

.badge-status.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.button-small {
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.2;
}

/* ============================================
   ДАШБОРД (адаптация стилей es9.ru)
   ============================================ */

/* Статистика объектов, заявок и сделок */
.estateflow-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-stats-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.estateflow-stats-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estateflow-stats-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.estateflow-stats-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.estateflow-stats-item:hover {
    color: #1e40af;
    text-decoration: underline;
}

.estateflow-stats-item.active {
    color: #1e40af;
    font-weight: 600;
}

.estateflow-stats-item-count {
    font-weight: 600;
    color: #1f2937;
}

.estateflow-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.estateflow-kpi-card {
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #eff6ff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.estateflow-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    border-color: rgba(191, 219, 254, 0.5);
}

.estateflow-kpi-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(239, 246, 255, 0.85);
    margin-bottom: 8px;
    font-weight: 600;
}

.estateflow-kpi-card__value {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.estateflow-kpi-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: rgba(219, 234, 254, 0.92);
}

.estateflow-kpi-card__meta strong {
    color: #ffffff;
}

/* Расширенная статистика */
.estateflow-extended-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-extended-stats-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.estateflow-extended-stats-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estateflow-extended-stats-values {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.estateflow-extended-stats-values span {
    font-size: 14px;
    color: #64748b;
}

.estateflow-extended-stats-values strong {
    font-weight: 700;
    color: #1f2937;
}

.estateflow-attention-panel {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    border: 1px solid #e2e8f0;
}

.estateflow-attention-panel__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.estateflow-attention-panel__title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.estateflow-attention-panel__hint {
    font-size: 12px;
    color: #64748b;
}

.estateflow-attention-panel__empty {
    font-size: 13px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.estateflow-attention-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.estateflow-attention-panel__item {
    margin: 0;
}

.estateflow-attention-panel__itemlink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    background: #f8fafc;
    transition: border-color .15s ease, background .15s ease;
}

.estateflow-attention-panel__itemlink:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.estateflow-attention-panel__name {
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
}

.estateflow-attention-panel__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.estateflow-funnels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.estateflow-funnels__column {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    border: 1px solid #e2e8f0;
}

.estateflow-funnels__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.estateflow-funnels__title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.estateflow-funnels__hint {
    font-size: 12px;
    color: #64748b;
    text-align: right;
}

.estateflow-funnels__empty {
    font-size: 13px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.estateflow-funnels__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.estateflow-funnels__item {
    margin: 0;
}

.estateflow-funnels__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.estateflow-funnels__bar {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 34px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    padding: 0 10px;
    box-sizing: border-box;
}

.estateflow-funnels__bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--estateflow-funnel-width, 0%);
    max-width: 100%;
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
    opacity: .92;
}

.estateflow-funnels__item.is-progress .estateflow-funnels__bar::before {
    background: linear-gradient(90deg, #0284c7 0%, #0ea5e9 100%);
}

.estateflow-funnels__item.is-success .estateflow-funnels__bar::before {
    background: linear-gradient(90deg, #15803d 0%, #22c55e 100%);
}

.estateflow-funnels__item.is-failed .estateflow-funnels__bar::before {
    background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%);
}

.estateflow-funnels__item.is-archived .estateflow-funnels__bar {
    border-style: dashed;
}

.estateflow-funnels__stage {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
}

.estateflow-funnels__metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #334155;
}

.estateflow-funnels__metrics strong {
    font-size: 14px;
    line-height: 1.1;
    color: #0f172a;
}

.estateflow-funnels__metrics small {
    font-size: 11px;
    line-height: 1.2;
    color: #64748b;
}

.estateflow-ops-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.estateflow-ops-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    border: 1px solid #e2e8f0;
}

.estateflow-ops-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.estateflow-ops-card__title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.estateflow-ops-card__hint {
    font-size: 12px;
    color: #64748b;
}

.estateflow-ops-card__link {
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
}

.estateflow-ops-card__link:hover {
    text-decoration: underline;
}

.estateflow-ops-card__empty {
    font-size: 13px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.estateflow-ops-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.estateflow-ops-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 9px 10px;
}

.estateflow-ops-item__name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.estateflow-ops-item__name:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.estateflow-ops-item__meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.estateflow-ops-item__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.estateflow-dashboard-statuses {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.estateflow-dashboard-statuses__column {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-dashboard-statuses__title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 10px;
}

.estateflow-dashboard-statuses__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.estateflow-dashboard-statuses__item {
    margin: 0;
}

.estateflow-dashboard-statuses__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 9px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.estateflow-dashboard-statuses__link:hover {
    background: #f8fafc;
    border-color: #dbeafe;
}

.estateflow-dashboard-statuses__link strong {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.estateflow-dashboard-statuses__empty {
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
}

/* Карточки быстрых действий */
.estateflow-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.estateflow-action-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.estateflow-action-card:hover {
    box-shadow: 0 4px 12px rgba(42, 46, 67, 0.12);
    transform: translateY(-2px);
    border-color: #dbeafe;
}

.estateflow-action-card__icon {
    font-size: 32px;
    color: #3b82f6;
    margin-bottom: 12px;
    display: block;
}

.estateflow-action-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.estateflow-action-card__description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Календарь */
.estateflow-calendar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    margin-bottom: 20px;
}

.estateflow-calendar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.estateflow-calendar__month {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.estateflow-calendar__nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.estateflow-calendar__nav-button {
    padding: 6px 10px;
    border: 1px solid #d0d7e6;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.estateflow-calendar__nav-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.estateflow-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.estateflow-calendar__day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 4px;
    text-transform: uppercase;
}

.estateflow-calendar__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.estateflow-calendar__day:hover {
    background: #f1f5f9;
}

.estateflow-calendar__day.today {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.estateflow-calendar__day.selected {
    background: #3b82f6;
    color: #fff;
}

.estateflow-calendar__day.other-month {
    color: #cbd5e1;
}

/* Дашборд: секции с данными */
.estateflow-dashboard-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.estateflow-dashboard-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-dashboard-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.estateflow-dashboard-section__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.estateflow-dashboard-section__link {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.estateflow-dashboard-section__link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.estateflow-dashboard-section__content {
    min-height: 200px;
}

.estateflow-dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.estateflow-dashboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.estateflow-dashboard-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(42, 46, 67, 0.1);
}

.estateflow-dashboard-item__main {
    flex: 1;
    min-width: 0;
}

.estateflow-dashboard-item__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.estateflow-dashboard-item__title .estateflow-link {
    color: #1f2937;
    text-decoration: none;
}

.estateflow-dashboard-item__title .estateflow-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.estateflow-dashboard-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.estateflow-dashboard-item__address {
    display: flex;
    align-items: center;
    gap: 4px;
}

.estateflow-dashboard-item__price {
    font-weight: 600;
    color: #1e40af;
}

.estateflow-dashboard-item__category {
    padding: 2px 6px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 3px;
    font-size: 11px;
}

.estateflow-dashboard-item__payment,
.estateflow-dashboard-item__responsible {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.estateflow-dashboard-item__payment {
    background: #e2e8f0;
    color: #334155;
}

.estateflow-dashboard-item__responsible {
    background: #f1f5f9;
    color: #475569;
}

.estateflow-dashboard-item__status {
    flex-shrink: 0;
    margin-left: 10px;
}

.estateflow-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.estateflow-empty-state__icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.estateflow-empty-state__text {
    font-size: 14px;
    margin-bottom: 15px;
}

/* Статистика пользователей */
.estateflow-user-stats {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-user-stats__title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 15px 0;
}

.estateflow-user-stats__table {
    width: 100%;
    border-collapse: collapse;
}

.estateflow-user-stats__table th {
    text-align: left;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.estateflow-user-stats__table td {
    padding: 10px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.estateflow-user-stats__table tr:hover {
    background: #f8fafc;
}

.estateflow-analytics-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.estateflow-analytics-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.estateflow-analytics-kpi__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.06);
}

.estateflow-analytics-kpi__label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.estateflow-analytics-kpi__value {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    color: #1f2937;
}

.estateflow-analytics-kpi__hint {
    font-size: 12px;
    color: #475569;
    margin-top: 6px;
}

.estateflow-analytics-kpi__link {
    margin-left: 8px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.estateflow-analytics-kpi__link:hover {
    text-decoration: underline;
}

.estateflow-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.estateflow-analytics-grid--trends {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.estateflow-analytics-table th,
.estateflow-analytics-table td {
    vertical-align: middle;
}

.estateflow-analytics-trend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.estateflow-analytics-trend__max {
    font-size: 12px;
    color: #64748b;
}

.estateflow-analytics-trend__bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
    gap: 4px;
    min-height: 170px;
    align-items: end;
}

.estateflow-analytics-trend__bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 170px;
}

.estateflow-analytics-trend__bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
}

.estateflow-analytics-trend__label {
    font-size: 10px;
    color: #64748b;
    line-height: 1;
    min-height: 12px;
}

/* ============================================
   ИНТЕГРАЦИИ В КАРТОЧКЕ ОБЪЕКТА
   ============================================ */

.estateflow-integrations-list {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-integrations-section {
    margin-bottom: 20px;
}

.estateflow-integrations-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 15px 0;
}

.estateflow-integration-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.estateflow-integration-status {
    flex-shrink: 0;
}

.estateflow-integration-info {
    flex: 1;
}

.estateflow-integration-info div {
    margin-bottom: 5px;
}

.estateflow-integration-actions {
    flex-shrink: 0;
}

/* ============================================
   GRID VIEW для объектов (адаптация es9.ru)
   ============================================ */

.estateflow-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.estateflow-view-toggle__button {
    padding: 8px 12px;
    border: 1px solid #d0d7e6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #64748b;
}

.estateflow-view-toggle__button:hover {
    background: #f1f5f9;
}

.estateflow-view-toggle__button.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* ============================================
   REQUESTS: badges + inline editing + kanban
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    background: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}

.status-badge.badge-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.status-new {
    background: #dbeafe;
    color: #1e40af;
}

.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.status-perspective {
    background: #e0e7ff;
    color: #3730a3;
}

.status-won {
    background: #d1fae5;
    color: #065f46;
}

.status-lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Objects statuses (active/reserved/sold/archived) */
.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-reserved {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #fee2e2;
    color: #991b1b;
}

.status-archived {
    background: #e5e7eb;
    color: #6b7280;
}

/* Deals (legacy open/signed/closed/cancelled) */
.status-open {
    background: #dbeafe;
    color: #1e40af;
}

.status-signed {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.readiness-cold {
    border-color: #cbd5e1;
    color: #64748b;
}

.readiness-warm {
    border-color: #f59e0b;
    color: #92400e;
}

.readiness-hot {
    border-color: #ef4444;
    color: #991b1b;
}

/* Make native selects look like badges (ES9-like inline editing). */
.estateflow-inline-badge {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    cursor: pointer;
    padding-right: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%2364758b' d='M5.25 7.75a.75.75 0 0 1 1.06 0L10 11.44l3.69-3.69a.75.75 0 1 1 1.06 1.06l-4.22 4.22a.75.75 0 0 1-1.06 0L5.25 8.81a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px 10px;
}

.estateflow-inline-badge.badge-outline {
    border: 1px solid #cbd5e1;
}

.estateflow-inline-badge:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.estateflow-inline-badge:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.estateflow-kanban {
    overflow-x: auto;
    padding-bottom: 8px;
}

.estateflow-kanban__board {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 140px;
}

.estateflow-kanban__column {
    flex: 0 0 320px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.estateflow-kanban__column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.estateflow-kanban__column-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.estateflow-kanban__column-count {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 2px 8px;
}

.estateflow-kanban__column-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
    max-height: 70vh;
    overflow-y: auto;
}

.estateflow-kanban__column-body.is-drop-target {
    outline: 2px dashed #3b82f6;
    outline-offset: -6px;
}

.estateflow-kanban-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.estateflow-kanban-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
}

.estateflow-kanban-card.is-dragging {
    opacity: 0.6;
}

.estateflow-kanban-card__title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.estateflow-kanban-card__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.estateflow-kanban-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #475569;
}

.estateflow-kanban-card__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Grid view - карточки объектов */
.estateflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.estateflow-grid-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    position: relative;
}

.estateflow-grid-card:hover {
    box-shadow: 0 4px 12px rgba(42, 46, 67, 0.15);
    transform: translateY(-2px);
}

.estateflow-grid-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 48px;
}

.estateflow-grid-card__body {
    padding: 16px;
}

.estateflow-grid-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.estateflow-grid-card__address {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.estateflow-grid-card__params {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #475569;
}

.estateflow-grid-card__param {
    display: flex;
    align-items: center;
    gap: 4px;
}

.estateflow-grid-card__price {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.estateflow-grid-card__price-per-sqm {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.estateflow-grid-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.estateflow-grid-card__status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estateflow-grid-card__actions {
    display: flex;
    gap: 6px;
}

.estateflow-grid-card__action-button {
    padding: 6px 10px;
    border: 1px solid #d0d7e6;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all 0.2s;
}

.estateflow-grid-card__action-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Checkbox overlay (bulk selection) */
.estateflow-grid-card__checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.estateflow-grid-card__checkbox input {
    margin: 0;
}

/* List view - таблица объектов (существующий стиль, улучшенный) */
.estateflow-list-view {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
}

.estateflow-list-view .table {
    margin: 0;
    width: 100%;
}

.estateflow-list-view .table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px;
    border-bottom: 2px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.estateflow-list-view .table thead th .sort-link {
    color: #475569;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.estateflow-list-view .table thead th .sort-link:hover {
    color: #3b82f6;
}

.estateflow-list-view .table thead th:hover {
    background: #f1f5f9;
}

.estateflow-list-view .table tbody tr {
    transition: background 0.2s;
}

.estateflow-list-view .table tbody tr:hover {
    background: #f8fafc;
}

.estateflow-list-view .table tbody td {
    padding: 12px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* Множественный выбор */
.estateflow-list-view .table tbody td:first-child {
    width: 40px;
    text-align: center;
}

.estateflow-bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

.estateflow-bulk-actions.hidden {
    display: none;
}

.estateflow-bulk-actions__count {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

.estateflow-bulk-actions__buttons {
    display: flex;
    gap: 8px;
}

/* Новости/Обновления (опционально) */
/* Фильтры дашборда */
.estateflow-dashboard-filters {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    margin-bottom: 20px;
}

.estateflow-dashboard-filters__row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.estateflow-dashboard-filters__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.estateflow-dashboard-filters__item--presets {
    flex-wrap: wrap;
}

.estateflow-dashboard-filters__label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.estateflow-dashboard-filters__select,
.estateflow-dashboard-filters__date {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    min-width: 150px;
}

.estateflow-dashboard-filters__select:focus,
.estateflow-dashboard-filters__date:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.estateflow-dashboard-filters__preset {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all .15s ease;
}

.estateflow-dashboard-filters__preset:hover {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #eff6ff;
}

.estateflow-dashboard-filters__save {
    font-size: 12px;
    color: #16a34a;
    min-height: 16px;
}

.estateflow-dashboard-filters__save.is-error {
    color: #dc2626;
}

.estateflow-news {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(42, 46, 67, 0.08);
    margin-bottom: 20px;
}

.estateflow-news__item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
}

.estateflow-news__item:last-child {
    border-bottom: none;
}

.estateflow-news__image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f5f9;
}

.estateflow-news__content {
    flex: 1;
}

.estateflow-news__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.estateflow-news__title a {
    color: #3b82f6;
    text-decoration: none;
}

.estateflow-news__title a:hover {
    text-decoration: underline;
}

.estateflow-news__title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estateflow-news__badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ef4444;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.estateflow-news__item--important {
    border-left: 3px solid #ef4444;
    padding-left: 15px;
}

.estateflow-news__description {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.estateflow-news__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.estateflow-news__date {
    font-weight: 500;
}

.estateflow-news__type {
    padding: 2px 6px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 3px;
    font-size: 11px;
}

.estateflow-news__title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estateflow-news__badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ef4444;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.estateflow-news__item--important {
    border-left: 3px solid #ef4444;
    padding-left: 15px;
}

.estateflow-news__title a {
    color: #3b82f6;
    text-decoration: none;
}

.estateflow-news__title a:hover {
    text-decoration: underline;
}

/* ============================================
   БОКОВОЕ МЕНЮ (Sidebar) - адаптация es9.ru
   ============================================ */

.estateflow-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--blue, #1565C0), var(--blue2, #3B6EAA));
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-right: 1px solid rgba(59, 110, 170, 0.45);
}

.estateflow-sidebar.collapsed {
    transform: translateX(-100%);
}

.estateflow-sidebar__header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: flex-end;
}

.estateflow-sidebar__toggle {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    transition: opacity 0.2s;
}

.estateflow-sidebar__toggle:hover {
    opacity: 0.7;
}

.estateflow-sidebar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.estateflow-sidebar__item {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.estateflow-sidebar__item.active {
    background: rgba(255, 255, 255, 0.15);
}

.estateflow-sidebar__item.active > .estateflow-sidebar__link {
    color: #fff;
    border-left: 3px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.05);
}

.estateflow-sidebar__link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #f2f6fb !important;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.estateflow-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.estateflow-sidebar__link i {
    font-size: 18px;
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

.estateflow-sidebar__title {
    flex: 1;
    font-size: 14px;
}

.estateflow-sidebar__arrow {
    font-size: 12px;
    transition: transform 0.2s;
    margin-left: auto;
}

.estateflow-sidebar__item.expanded > .estateflow-sidebar__link > .estateflow-sidebar__arrow {
    transform: rotate(180deg);
}

.estateflow-sidebar__submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(8, 35, 70, 0.6);
    display: none;
}

.estateflow-sidebar__item.expanded > .estateflow-sidebar__submenu {
    display: block;
}

.estateflow-sidebar__subitem {
    margin: 0;
}

.estateflow-sidebar__sublink {
    display: block;
    padding: 10px 15px 10px 51px;
    color: rgba(242, 246, 251, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.estateflow-sidebar__sublink:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    padding-left: 55px;
}

/* ============================================
   ВЕРХНЯЯ СТРОКА (Header) - адаптация es9.ru
   ============================================ */

.estateflow-header {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, var(--blue, #1565C0), var(--blue2, #3B6EAA));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.estateflow-sidebar.collapsed ~ .estateflow-wrapper .estateflow-header {
    left: 0;
}

.estateflow-header__left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.estateflow-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.estateflow-header__logo-subtitle {
    font-size: 12px;
    color: rgba(240, 245, 255, 0.84);
    font-weight: 400;
}

.estateflow-header__link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.estateflow-header__link:hover {
    color: #fff;
}

.estateflow-header__search {
    background: transparent;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    transition: color 0.2s;
}

.estateflow-header__search:hover {
    color: #fff;
}

.estateflow-header__center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.estateflow-header__counters {
    display: flex;
    gap: 30px;
    align-items: center;
}

.estateflow-header__counter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.estateflow-header__counter-label {
    font-size: 13px;
    color: rgba(240, 245, 255, 0.9);
    font-weight: 600;
}

.estateflow-header__counter-item {
    color: rgba(240, 245, 255, 0.88);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    white-space: nowrap;
}

.estateflow-header__counter-item:hover {
    color: #fff;
}

.estateflow-header__counter-item.active {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

.estateflow-header__counter-item strong {
    font-weight: 700;
    color: #fff;
}

.estateflow-header__counter-item.active strong {
    color: #fff;
}

.estateflow-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.estateflow-header__icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.estateflow-header__icon {
    position: relative;
    background: transparent;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    transition: color 0.2s;
    border-radius: 4px;
}

.estateflow-header__icon:hover {
    color: #fff;
    background: #2a2a2a;
}

.estateflow-header__icon--badge {
    padding-right: 24px;
}

.estateflow-header__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

.estateflow-header__tasks {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #2a2a2a;
}

.estateflow-header__tasks-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.estateflow-header__tasks-btn:hover {
    background: #059669;
}

.estateflow-header__tasks-btn strong {
    font-weight: 700;
}

.estateflow-header__profile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #2a2a2a;
}

.estateflow-header__profile-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.estateflow-header__profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.estateflow-header__profile-id {
    font-size: 12px;
    color: #94a3b8;
}

/* Адаптация основного контента под фиксированные header и sidebar */
.estateflow-sidebar.collapsed ~ .estateflow-wrapper {
    margin-left: 0;
}

/* ============================================
   БЫСТРОЕ РЕДАКТИРОВАНИЕ ПОЛЕЙ (Inline Editing)
   ============================================ */

.estateflow-editable {
	position: relative;
	cursor: pointer;
}

.estateflow-editable:hover {
	background: #f0f9ff;
	border-radius: 4px;
}

.estateflow-editable:hover::after {
	content: ' ✏️';
	font-size: 12px;
	opacity: 0.6;
}

.estateflow-field-value {
	display: inline-block;
	padding: 2px 4px;
	min-height: 20px;
}

.estateflow-field-input {
	width: 100%;
	padding: 4px 8px;
	border: 1px solid #3b82f6;
	border-radius: 4px;
	font-size: 14px;
}

.estateflow-field-input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Документы */
.estateflow-docs-list {
	margin-top: 15px;
}

.estateflow-doc-item {
	transition: background 0.2s;
}

.estateflow-doc-item:hover {
	background: #f9fafb;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */

.estateflow-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.estateflow-modal[hidden] {
	display: none !important;
}

.estateflow-modal [hidden] {
	display: none !important;
}

.estateflow-modal-open {
	overflow: hidden;
}

.estateflow-modal__backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	backdrop-filter: blur(6px);
	background: rgba(15, 23, 42, 0.58);
}

.estateflow-modal__content {
	position: relative;
	background: #fff;
	border-radius: 18px;
	border: 1px solid rgba(148, 163, 184, 0.22);
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow: hidden;
	z-index: 1;
}

.estateflow-modal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.18);
	background: linear-gradient(135deg, #f8fbff 0%, #f1f5f9 100%);
}

.estateflow-modal__header h3 {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	color: #0f172a;
}

.estateflow-modal__close {
	background: transparent;
	border: 1px solid transparent;
	font-size: 24px;
	cursor: pointer;
	color: #6b7280;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.estateflow-modal__close:hover {
	background: #e2e8f0;
	color: #111827;
	border-color: rgba(148, 163, 184, 0.35);
}

.estateflow-modal__body {
	padding: 24px;
	background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
}

.estateflow-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 18px;
	border: 1px solid rgba(148, 163, 184, 0.22);
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
	max-width: 820px;
	width: min(92vw, 820px);
	max-height: 90vh;
	overflow: hidden auto;
	z-index: 1;
}

.estateflow-modal__dialog--lg {
	max-width: 1080px;
	width: min(94vw, 1080px);
}

.estateflow-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.estateflow-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 18px;
}

.estateflow-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	color: #334155;
}

.estateflow-form__field--wide,
.estateflow-form__field--full {
	grid-column: 1 / -1;
}

.estateflow-form__label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
}

.estateflow-form input[type="text"],
.estateflow-form input[type="search"],
.estateflow-form input[type="number"],
.estateflow-form input[type="date"],
.estateflow-form select,
.estateflow-form textarea,
.estateflow-call-search .filter-input,
.estateflow-card__row .filter-select {
	width: 100%;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	background: #fff;
	box-sizing: border-box;
	font: inherit;
	color: #0f172a;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.estateflow-form textarea {
	min-height: 112px;
	resize: vertical;
}

.estateflow-form input[type="text"]:focus,
.estateflow-form input[type="search"]:focus,
.estateflow-form input[type="number"]:focus,
.estateflow-form input[type="date"]:focus,
.estateflow-form select:focus,
.estateflow-form textarea:focus,
.estateflow-call-search .filter-input:focus,
.estateflow-card__row .filter-select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.estateflow-form__hint {
	min-height: 18px;
	font-size: 12px;
	font-weight: 400;
	color: #64748b;
}

.estateflow-input-group {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.estateflow-input-group > input,
.estateflow-input-group > select {
	flex: 1 1 auto;
	min-width: 0;
}

.estateflow-input-group > .button {
	min-width: 44px;
	padding: 0 14px;
	border-radius: 12px;
}

.estateflow-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-top: 2px;
}

.estateflow-modal__preview {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-height: 240px;
}

.estateflow-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
	border-radius: 20px;
	border: 1px solid #dbe4f0;
	background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.estateflow-card__row {
	display: grid;
	grid-template-columns: minmax(132px, 172px) minmax(0, 1fr);
	gap: 14px 18px;
	align-items: start;
	padding: 14px 0;
	border-bottom: 1px solid #edf2f7;
}

.estateflow-card__row:last-of-type {
	border-bottom: none;
	padding-bottom: 0;
}

.estateflow-card__row > span:first-child {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
}

.estateflow-card__row > strong,
.estateflow-card__row > div,
.estateflow-card__row > a {
	min-width: 0;
	font-size: 15px;
	color: #0f172a;
}

.estateflow-card__row .button + .button,
.estateflow-card__row .button + .small,
.estateflow-card__row .small + .button {
	margin-left: 8px;
}

.estateflow-card__section {
	padding-top: 4px;
}

.estateflow-card__timeline {
	padding: 18px;
	border-radius: 18px;
	border: 1px solid #dbe4f0;
	background: #f8fbff;
}

.estateflow-card__timeline h4 {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
}

.estateflow-card__timeline ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.estateflow-card__timeline li {
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid #e2e8f0;
	background: #fff;
}

.estateflow-timeline__title {
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
}

.estateflow-timeline__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-top: 6px;
	font-size: 12px;
	color: #64748b;
}

.estateflow-timeline__meta .status {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	background: #e2e8f0;
	color: #334155;
	font-weight: 600;
}

.estateflow-timeline__empty {
	text-align: center;
	color: #94a3b8;
	font-size: 13px;
}

.estateflow-loading,
.estateflow-error {
	padding: 18px 20px;
	border-radius: 16px;
	border: 1px solid #dbe4f0;
	background: #fff;
	font-size: 14px;
}

.estateflow-loading {
	color: #475569;
}

.estateflow-error {
	color: #b91c1c;
	background: #fff5f5;
	border-color: #fecaca;
}

.estateflow-call-search {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 18px;
}

.estateflow-call-search .filter-input {
	flex: 1 1 320px;
}

.estateflow-call-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.estateflow-call-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 16px 18px;
	border: 1px solid #dbe4f0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.estateflow-call-icon {
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #e2e8f0;
	color: #475569;
	font-size: 16px;
}

.estateflow-call-icon.green {
	background: #dcfce7;
	color: #15803d;
}

.estateflow-call-icon.red {
	background: #fee2e2;
	color: #b91c1c;
}

.estateflow-call-info {
	min-width: 0;
}

.estateflow-call-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.estateflow-call-list > .estateflow-empty,
.estateflow-call-list > .estateflow-loading,
.estateflow-call-list > .estateflow-error,
.estateflow-call-list > .estateflow-empty-state__text {
	text-align: center;
	padding: 22px 18px;
	border-radius: 16px;
	border: 1px dashed #cbd5e1;
	background: #fff;
}

.estateflow-call-list .clean {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.estateflow-call-list .clean > li {
	padding: 14px 16px;
	border-radius: 14px;
	border: 1px solid #dbe4f0;
	background: #fff;
}

.estateflow-call-list .table {
	margin: 0;
	border: 1px solid #dbe4f0;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
}

.estateflow-call-list .table thead th {
	background: #f8fafc;
	color: #475569;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.estateflow-call-list .table th,
.estateflow-call-list .table td {
	padding: 12px 14px;
	vertical-align: middle;
}

.estateflow-community-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.estateflow-community-panel__lead {
	margin: 0;
	font-size: 14px;
	color: #475569;
}

.estateflow-community-panel__stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.estateflow-community-panel__metric {
	padding: 16px;
	border-radius: 16px;
	border: 1px solid #dbe4f0;
	background: #fff;
}

.estateflow-community-panel__metric span {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748b;
}

.estateflow-community-panel__metric strong {
	display: block;
	margin-top: 8px;
	font-size: 28px;
	line-height: 1;
	color: #0f172a;
}

.estateflow-community-panel__meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 18px;
}

.estateflow-community-panel__meta-item {
	padding: 14px 16px;
	border-radius: 16px;
	border: 1px solid #dbe4f0;
	background: #fff;
}

.estateflow-community-panel__meta-item span {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748b;
}

.estateflow-community-panel__meta-item strong {
	display: block;
	margin-top: 6px;
	font-size: 16px;
	color: #0f172a;
}

.estateflow-community-panel__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.estateflow-community-panel__notice {
	padding: 16px 18px;
	border-radius: 16px;
	border: 1px dashed #cbd5e1;
	background: #fff;
	color: #475569;
}

.estateflow-community-panel__notice p {
	margin: 0;
}

.estateflow-community-panel__notice p + p {
	margin-top: 8px;
}

.estateflow-match {
	padding: 14px 0;
}

.estateflow-match__info {
	min-width: 0;
}

.estateflow-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.estateflow-pagination__buttons {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.estateflow-owner-workspace {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.estateflow-owner-workspace__header {
	margin-bottom: 0;
}

.estateflow-owner-workspace__frame-wrap {
	border: 1px solid #d8dee9;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.estateflow-owner-workspace__frame {
	display: block;
	width: 100%;
	min-height: 720px;
	border: 0;
	background: #f8fafc;
}

.estateflow-owner-workspace__loader {
	margin: 12px;
}

.estateflow-owner-workspace__fallback {
	margin: 12px;
}

.estateflow-owner-workspace--loading .estateflow-owner-workspace__frame {
	opacity: 0.4;
}

.estateflow-owner-workspace--failed .estateflow-owner-workspace__frame {
	display: none;
}

.estateflow-mortgage-hub {
	margin: 10px 0 14px;
	padding: 12px;
	border: 1px solid #d8dee9;
	border-radius: 10px;
	background: #fff;
}

.estateflow-mortgage-hub__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.estateflow-mortgage-hub__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.estateflow-mortgage-hub__stats,
.estateflow-mortgage-hub__bids,
.estateflow-mortgage-hub__banks,
.estateflow-mortgage-hub__calculator {
	border-top: 1px solid #e6edf5;
	padding-top: 10px;
}

@media (max-width: 1200px) {
	.estateflow-analytics-grid {
		grid-template-columns: 1fr;
	}

	.estateflow-kpi-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.estateflow-funnels {
		grid-template-columns: 1fr;
	}

	.estateflow-ops-grid {
		grid-template-columns: 1fr;
	}

	.estateflow-dashboard-statuses {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

    .estateflow-dashboard-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.estateflow-modal__dialog,
	.estateflow-modal__dialog--lg,
	.estateflow-modal__content {
		width: min(96vw, 96vw);
		max-height: 92vh;
	}

	.estateflow-form__grid,
	.estateflow-card__row,
	.estateflow-community-panel__stats,
	.estateflow-community-panel__meta {
		grid-template-columns: 1fr;
	}

	.estateflow-card__row {
		gap: 8px;
	}

	.estateflow-card__row > span:first-child {
		margin-bottom: 2px;
	}

	.estateflow-call-item {
		grid-template-columns: 1fr;
		justify-items: start;
	}

	.estateflow-call-actions {
		width: 100%;
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.estateflow-modal__header,
	.estateflow-modal__body {
		padding: 18px;
	}

	.estateflow-modal__header h3 {
		font-size: 18px;
	}

	.estateflow-form__actions,
	.estateflow-community-panel__actions,
	.estateflow-call-search {
		flex-direction: column;
		align-items: stretch;
	}

	.estateflow-form__actions > .button,
	.estateflow-community-panel__actions > .button,
	.estateflow-call-search > .button {
		width: 100%;
	}
}

/* Адаптивность */
@media (max-width: 768px) {
    .estateflow-sidebar {
        transform: translateX(-100%);
    }
    
    .estateflow-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .estateflow-wrapper {
        margin-left: 0;
    }
    
    .estateflow-header {
        left: 0;
    }
    
    .estateflow-header__center {
        display: none;
    }
    
    .estateflow-quick-actions {
        grid-template-columns: 1fr;
    }

		.estateflow-kpi-strip {
			grid-template-columns: 1fr;
		}

		.estateflow-funnels__header {
			flex-direction: column;
			align-items: flex-start;
		}

		.estateflow-funnels__hint {
			text-align: left;
		}

		.estateflow-funnels__link {
			grid-template-columns: 1fr;
		}

		.estateflow-funnels__metrics {
			flex-direction: row;
			align-items: center;
			flex-wrap: wrap;
			gap: 8px;
		}

		.estateflow-ops-card__header {
			flex-direction: column;
			align-items: flex-start;
		}

		.estateflow-ops-item {
			grid-template-columns: 1fr;
			align-items: flex-start;
		}

		.estateflow-ops-item__actions {
			justify-content: flex-start;
		}

		.estateflow-attention-panel__header {
			flex-direction: column;
			align-items: flex-start;
		}

		.estateflow-attention-panel__itemlink {
			flex-direction: column;
			align-items: flex-start;
		}

		.estateflow-dashboard-statuses {
			grid-template-columns: 1fr;
		}

        .estateflow-dashboard-columns {
            grid-template-columns: 1fr;
        }

	.estateflow-analytics-kpi {
		grid-template-columns: 1fr;
	}
    
    .estateflow-grid {
        grid-template-columns: 1fr;
    }
    
    .estateflow-stats {
        flex-direction: column;
    }

	.estateflow-pagination {
		flex-direction: column;
		align-items: flex-start;
	}
}
