@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/InterVariable.2bf3d951bf9d.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/InterVariable-Italic.8d1dc86da258.woff2") format("woff2");
}

:root {
    --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --accent: #c74445;
    --accent-hover: #ad3436;
    --accent-strong: #962d2f;
    --accent-soft: #fbeeee;
    --accent-softer: #fff7f7;
    --ink: #211f1c;
    --text: var(--ink);
    --muted: var(--ink);
    --line: #e6e2dc;
    --line-strong: #d7d1c9;
    --surface: #ffffff;
    --surface-muted: #faf9f7;
    --background: #f6f5f2;
    --success: #25794d;
    --success-soft: #eaf6ef;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --warning: #996515;
    --shadow-xs: 0 1px 2px rgba(35, 30, 26, 0.04);
    --shadow-sm: 0 8px 26px rgba(35, 30, 26, 0.06);
    --shadow-md: 0 20px 52px rgba(35, 30, 26, 0.1);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    color: var(--text);
    background: var(--background);
    font-family: var(--font-ui);
    font-optical-sizing: auto;
    font-size: 16px;
    line-height: 1.55;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--background);
}

button,
input,
select,
textarea {
    font: inherit;
}

code,
kbd,
pre,
samp {
    font-family: var(--font-ui);
}

a {
    color: var(--accent-strong);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--accent);
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(199, 68, 69, 0.24);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.icon {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: min(1220px, calc(100% - 48px));
    margin: 0 auto;
}

main.container {
    padding: 12px 0 40px;
}

.has-workspace-sidebar {
    --workspace-sidebar-space: 76px;
    --workspace-content-center-offset: -572px;
}

.has-workspace-sidebar main.container {
    width: min(1220px, calc(100% - var(--workspace-sidebar-space) - 48px));
    margin-right: 0;
    margin-left: max(calc(var(--workspace-sidebar-space) + 24px), calc(50vw + var(--workspace-content-center-offset)));
}

.workspace-sidebar-pinned .has-workspace-sidebar {
    --workspace-sidebar-space: 280px;
    --workspace-content-center-offset: -470px;
}

#main-content:focus {
    outline: none;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(215, 209, 201, 0.8);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 1px 0 rgba(35, 30, 26, 0.02);
    backdrop-filter: blur(16px);
}

.navigation {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 34px;
}

.navigation-brand-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-menu-toggle {
    display: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand-logo {
    display: block;
    width: 196px;
    height: auto;
}

.primary-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    position: relative;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 11px;
    padding: 9px 13px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: var(--surface-muted);
    color: var(--ink);
}

.nav-link.is-active .icon {
    color: var(--accent);
}

.notification-count-badge {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0 6px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu form {
    margin: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid #e8c9bf;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
}

.user-summary {
    min-width: 0;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.user-summary strong,
.user-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-summary strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 720;
}

.user-summary small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.icon-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.icon-button:hover {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--accent-strong);
}

.icon-button .icon {
    width: 19px;
    height: 19px;
}

.context-navigation {
    margin-bottom: 22px;
}

.back-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 9px;
    padding: 6px 9px 6px 5px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.back-link:hover {
    background: var(--surface);
    color: var(--accent-strong);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 8px 0 30px;
}

.page-heading h1 {
    max-width: 820px;
    margin: 4px 0 8px;
    color: var(--ink);
    font-size: clamp(34px, 4.2vw, 52px);
    font-weight: 780;
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.page-description {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.page-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h2 {
    margin: 0 0 18px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

h3 {
    margin-top: 28px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 730;
}

.muted,
small {
    color: var(--muted);
}

.button,
button:not(.tab-button):not(.icon-button):not(.sort-chip):not(.calendar-event):not(.calendar-day-number):not(.calendar-week-day-heading):not(.mini-calendar-day-button):not(.mini-calendar-task):not(.archive-project-button):not(.management-action):not([data-date-preset]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 10px 17px;
    background: var(--accent);
    box-shadow: 0 5px 14px rgba(199, 68, 69, 0.12);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 720;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover,
button:not(.tab-button):not(.icon-button):not(.sort-chip):not(.calendar-event):not(.calendar-day-number):not(.calendar-week-day-heading):not(.mini-calendar-day-button):not(.mini-calendar-task):not(.archive-project-button):not(.management-action):not([data-date-preset]):hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    box-shadow: 0 7px 18px rgba(173, 52, 54, 0.18);
    color: #fff;
}

.button .icon,
button .icon {
    width: 17px;
    height: 17px;
}

.button-quiet,
.button-outline {
    border-color: var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: var(--ink);
}

.button-quiet:hover,
.button-outline:hover {
    border-color: #d9a7a8;
    background: var(--accent-softer);
    box-shadow: var(--shadow-xs);
    color: var(--accent-strong);
}

.button-small {
    min-height: 38px !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.button-wide {
    width: 100%;
}

.quiet-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 7px 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.quiet-link:hover {
    border-color: #d9a7a8;
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Центр внутренних уведомлений */
.notification-toolbar {
    position: sticky;
    z-index: 8;
    top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 11px 14px;
}

.notification-toolbar strong {
    font-size: 15px;
}

.notification-toolbar strong span {
    margin-left: 4px;
    color: var(--muted);
    font-size: 12px;
}

.notification-toolbar form {
    margin: 0;
}

.push-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 12px;
    padding: 12px 14px;
}

.push-settings strong {
    font-size: 13px;
}

.push-settings p {
    margin: 0;
    color: var(--muted);
}

.push-settings-status {
    margin-top: 3px !important;
    font-size: 11px;
    font-weight: 650;
}

.push-settings-status.is-error {
    color: var(--accent-strong);
}

.push-settings-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 9px;
}

.notification-list {
    display: grid;
    gap: 8px;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 13px 14px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.notification-card.is-unread {
    border-color: #e4a9aa;
    background: var(--accent-softer);
}

.notification-card-copy {
    min-width: 0;
}

.notification-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.notification-card h2 {
    margin-bottom: 3px;
    font-size: 16px;
}

.notification-card p {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.4;
}

.notification-card-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.notification-card-actions form {
    margin: 0;
}

.notification-read-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

/* Список проектов */
.project-list-heading {
    margin-bottom: 20px;
}

.workspace-sidebar {
    position: fixed;
    z-index: 19;
    top: 0;
    bottom: 0;
    left: 0;
    width: 76px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 6px 0 20px rgba(35, 30, 26, 0.035);
    backdrop-filter: blur(16px);
    transition: width 170ms ease, box-shadow 170ms ease;
}

.workspace-sidebar:hover,
.workspace-sidebar-pinned .workspace-sidebar {
    width: 280px;
    box-shadow: 12px 0 30px rgba(35, 30, 26, 0.09);
}

.workspace-sidebar-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.workspace-sidebar-brand {
    width: 44px;
    height: 44px;
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: width 150ms ease, flex-basis 150ms ease;
}

.workspace-sidebar-logo {
    width: 196px;
    max-width: none;
    height: auto;
    display: block;
    flex: 0 0 196px;
    transform: translateX(6px);
    transition: transform 150ms ease;
}

.workspace-sidebar:hover .workspace-sidebar-brand,
.workspace-sidebar-pinned .workspace-sidebar-brand {
    width: 196px;
    flex: 1 1 196px;
}

.workspace-sidebar:hover .workspace-sidebar-logo,
.workspace-sidebar-pinned .workspace-sidebar-logo {
    transform: translateX(0);
}

.workspace-sidebar-pin {
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    overflow: hidden;
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 130ms ease, min-width 130ms ease, opacity 130ms ease, background-color 150ms ease, color 150ms ease;
}

.workspace-sidebar:hover .workspace-sidebar-pin,
.workspace-sidebar-pinned .workspace-sidebar-pin {
    width: 40px;
    min-width: 40px;
    flex-basis: 40px;
    opacity: 1;
    pointer-events: auto;
}

.workspace-pin-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex: 0 0 20px;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.workspace-pin-outline {
    -webkit-mask-image: url("../icons/pin-outline.f9ac89e179dd.svg");
    mask-image: url("../icons/pin-outline.f9ac89e179dd.svg");
}

.workspace-pin-filled {
    display: none;
    -webkit-mask-image: url("../icons/pin-filled.c4e1f0845e60.svg");
    mask-image: url("../icons/pin-filled.c4e1f0845e60.svg");
}

.workspace-sidebar-pin[aria-pressed="true"] .workspace-pin-outline {
    display: none;
}

.workspace-sidebar-pin[aria-pressed="true"] .workspace-pin-filled {
    display: block;
}

.workspace-sidebar-pin[aria-pressed="true"] {
    border-color: #e7bfc0;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.workspace-sidebar-close {
    display: none;
}

.workspace-sidebar-scroll {
    min-height: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.workspace-navigation {
    display: grid;
    gap: 3px;
    padding: 8px;
}

.workspace-utility-navigation {
    min-width: 0;
    display: grid;
    gap: 3px;
    margin: 2px 8px 8px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.workspace-nav-link {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 7px 19px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.workspace-nav-group {
    width: 100%;
    min-width: 0;
}

.workspace-sidebar:not(:hover) .workspace-utility-navigation .workspace-nav-link:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 3px rgba(199, 68, 69, 0.24);
}

.workspace-nav-link:hover {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--ink);
}

.workspace-sidebar:hover .workspace-nav-link,
.workspace-sidebar-pinned .workspace-nav-link {
    padding-right: 12px;
    padding-left: 12px;
}

.workspace-nav-link.is-active,
.workspace-nav-link.is-active:hover {
    border-color: #efcfd0;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.workspace-nav-link .icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.workspace-nav-link span {
    opacity: 0;
    transition: opacity 110ms ease;
}

.workspace-sidebar:hover .workspace-nav-link span,
.workspace-sidebar-pinned .workspace-nav-link span,
.workspace-sidebar:hover .workspace-subnav-link span,
.workspace-sidebar-pinned .workspace-subnav-link span {
    opacity: 1;
}

.workspace-notification-badge {
    min-width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    border-radius: 999px;
    padding: 0 6px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.workspace-sidebar:not(:hover) .workspace-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 9px;
}

.workspace-sidebar-pinned .workspace-sidebar .workspace-notification-badge {
    position: static;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    font-size: 11px;
}

.workspace-nav-group summary {
    cursor: pointer;
    list-style: none;
}

.workspace-nav-group summary::-webkit-details-marker {
    display: none;
}

.workspace-nav-group[open] > summary {
    border-color: #efcfd0;
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.workspace-nav-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-left: auto;
    margin-right: 3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0;
    transform: rotate(45deg) translate(-1px, -1px);
    transition: opacity 110ms ease, transform 150ms ease;
}

.workspace-sidebar:hover .workspace-nav-chevron,
.workspace-sidebar-pinned .workspace-nav-chevron {
    opacity: 1;
}

.workspace-nav-group[open] .workspace-nav-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.workspace-subnavigation {
    display: none;
    gap: 2px;
    padding: 3px 0 2px 15px;
}

.workspace-nav-group[open] .workspace-subnavigation {
    display: grid;
}

.workspace-sidebar:not(:hover) .workspace-nav-group[open] .workspace-subnavigation {
    display: none;
}

.workspace-sidebar-pinned .workspace-sidebar .workspace-nav-group[open] .workspace-subnavigation {
    display: grid;
}

.workspace-subnav-link {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    overflow: hidden;
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 680;
    text-decoration: none;
    white-space: nowrap;
}

.workspace-subnav-link:hover {
    background: var(--surface-muted);
    color: var(--ink);
}

.workspace-subnav-link.is-active,
.workspace-subnav-link.is-active:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.workspace-subnav-link .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.workspace-subnav-link span {
    opacity: 0;
    transition: opacity 110ms ease;
}

.workspace-sidebar-user {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid var(--line);
    padding: 10px 17px;
    background: rgba(255, 255, 255, 0.98);
}

.workspace-sidebar:hover .workspace-sidebar-user,
.workspace-sidebar-pinned .workspace-sidebar-user {
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
}

.workspace-user-summary {
    min-width: 0;
    max-width: 0;
    display: flex;
    flex: 0 0 0;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    line-height: 1.25;
    transition: opacity 110ms ease;
}

.workspace-sidebar:hover .workspace-user-summary,
.workspace-sidebar-pinned .workspace-user-summary {
    max-width: none;
    flex: 1;
    opacity: 1;
}

.workspace-user-summary strong,
.workspace-user-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-user-summary strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
}

.workspace-user-summary small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.workspace-sidebar-user form {
    margin: 0;
}

.workspace-sidebar-logout {
    flex: 0 0 42px;
}

.workspace-sidebar-backdrop {
    display: none;
}

.project-list-section {
    animation: content-in 260ms ease both;
}

[data-project-list-content] {
    transition: opacity 140ms ease;
}

[data-project-list-content].is-loading {
    opacity: 0.58;
    pointer-events: none;
}

.project-list-toolbar {
    position: sticky;
    z-index: 12;
    top: 84px;
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px 18px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.project-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-mobile-controls,
.project-mobile-controls-content {
    display: contents;
}

.project-mobile-controls-content {
    display: contents !important;
}

.project-mobile-controls-toggle {
    display: none;
}

.project-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-filter-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.service-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.service-filter-chip {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 9px 14px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 720;
    text-decoration: none;
    white-space: nowrap;
}

.service-filter-chip:hover,
.service-filter-chip:focus-visible {
    border-color: var(--accent);
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.service-filter-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.service-filter-chip.is-active:hover {
    background: var(--accent-hover);
    color: #fff;
}

.project-sort-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

@media (min-width: 761px) {
    .project-sort-row {
        border-top: 0;
    }
}

.project-advanced-filters {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.project-filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 9px;
}

.compact-field {
    min-width: 180px;
    margin: 0;
}

.compact-field label {
    margin-bottom: 4px;
    font-size: 11px;
}

.compact-field select,
.compact-field input {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 13px;
}

.date-range-picker {
    position: relative;
}

.date-range-picker summary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 7px 11px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.date-range-picker summary::-webkit-details-marker {
    display: none;
}

.date-range-picker summary .icon {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.date-range-picker[open] summary {
    border-color: var(--accent);
    background: var(--accent-softer);
}

.date-range-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    width: min(460px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.date-range-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.date-range-quick-actions button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 9px;
    background: var(--surface-muted);
    color: var(--ink);
    box-shadow: none;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.date-range-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field-errors {
    margin: 10px 0;
    color: var(--danger);
    font-size: 13px;
}

.timeline-filter-form {
    margin: 0;
}

.timeline-filter summary.sort-chip {
    min-height: 36px;
    border-color: transparent;
    border-radius: 9px;
    padding: 7px 10px;
    background: transparent;
    font-size: 12px;
}

.timeline-filter[open] summary.sort-chip,
.timeline-filter summary.sort-chip.is-active {
    border-color: #e9bfc0;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.timeline-filter-hint {
    margin: 10px 0;
    font-size: 12px;
}

.project-count,
.sort-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.project-count .icon {
    color: var(--accent);
}

.project-count strong {
    color: var(--ink);
}

.sort-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-search-form {
    display: flex;
    flex: 1 1 420px;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 12px;
    margin: 0 0 0 auto;
}

.project-search-input-wrap {
    min-width: min(100%, 330px);
    display: flex;
    flex: 1 1 330px;
    gap: 7px;
}

.project-search-input-wrap input[type="search"] {
    min-width: 0;
    min-height: 38px;
    flex: 1 1 auto;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
}

.project-search-input-wrap .button {
    min-height: 38px;
}

.project-search-archive-toggle {
    margin: 0;
    white-space: nowrap;
}

.project-search-reset {
    white-space: nowrap;
}

.project-archive-search-label {
    display: inline-flex;
    margin-left: 8px;
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    vertical-align: middle;
}

.sort-label {
    margin-right: 4px;
}

.sort-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 7px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 680;
    text-decoration: none;
    white-space: nowrap;
}

.sort-chip:hover {
    background: var(--surface);
    color: var(--ink);
}

.sort-chip.is-active {
    border-color: #e9bfc0;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.sort-chip-placeholder,
.sort-chip-placeholder:hover {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--muted);
    cursor: default;
}

.project-card-list {
    display: grid;
    gap: 14px;
}

.project-card-compact .project-title {
    overflow-wrap: anywhere;
}

.project-card-compact .project-meta-item {
    min-width: 0;
}

.project-card-compact .project-meta-item strong {
    white-space: normal;
    overflow-wrap: anywhere;
}

.project-card-compact .project-meta-item .status-badge {
    flex-direction: row;
    align-self: flex-start;
    white-space: normal;
}

.project-status-popover {
    width: min(340px, calc(100vw - 56px));
    max-height: calc(100dvh - 180px);
    padding: 10px;
    overflow-y: auto;
}

.project-status-popover label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.project-status-popover input {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.project-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.project-card:hover {
    border-color: #d9cfc7;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.project-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(199, 68, 69, 0.12);
}

.project-card-main {
    padding: 20px 22px 18px;
}

.project-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 28px;
}

.project-title {
    position: static;
    color: var(--ink);
    font-size: 21px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-decoration: none;
}

.project-title:hover {
    color: var(--accent-strong);
}

.stretched-link::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
}

.project-service-summary {
    max-width: 760px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.project-service-label {
    width: 100%;
    color: var(--ink);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.project-service-summary strong {
    color: var(--text);
    font-weight: 680;
}

.project-service-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-service-items span,
.service-group li {
    border: 1px solid #f1d9da;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--accent-softer);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.project-service-items-large {
    gap: 8px;
}

.project-service-items-large span {
    padding: 7px 11px;
    font-size: 13px;
}

.project-card-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-card-status strong {
    min-width: 38px;
    color: var(--ink);
    font-size: 15px;
    text-align: right;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e3dfdb;
    border-radius: 999px;
    padding: 6px 10px;
    background: #f3f2f0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 720;
    white-space: nowrap;
}

.status-badge[data-status="CONTRACT"],
.status-badge[data-status="ADVANCE"],
.status-badge[data-status="FIELD_WORK"],
.status-badge[data-status="OFFICE_WORK"],
.status-badge[data-status="INTERNAL_REVIEW"],
.status-badge[data-status="CLIENT_REVIEW"],
.status-badge[data-status="PAYMENT_UPD"],
.status-badge[data-status="REVIEW"],
.status-badge[data-status="WAITING_CUSTOMER"] {
    border-color: #f1d1d2;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.status-badge[data-status="COMPLETED"] {
    border-color: #cce5d6;
    background: var(--success-soft);
    color: var(--success);
}

.status-badge[data-status="PAUSED"] {
    border-color: #dedede;
    background: #eeeeed;
    color: var(--ink);
}

.status-large {
    padding: 8px 12px;
    font-size: 13px;
}

.progress-track {
    overflow: hidden;
    border-radius: 999px;
    background: #eae7e3;
}

.progress-card {
    height: 6px;
    margin-top: 16px;
}

.progress-large {
    height: 9px;
}

.progress-compact {
    width: 150px;
    height: 6px;
    margin-top: 9px;
}

.progress-fill {
    width: var(--progress);
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--accent);
    transition: width 280ms ease;
}

.progress-track[data-status="COMPLETED"] .progress-fill {
    background: var(--success);
}

.progress-track[data-status="PAUSED"] .progress-fill {
    width: 100%;
    background: #aaa7a3;
}

.project-card-footer {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 13px 22px;
    border-top: 1px solid #efedea;
    background: var(--surface-muted);
}

.project-meta-item {
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.project-meta-item > .icon {
    width: 18px;
    height: 18px;
    color: var(--ink);
}

.project-meta-item span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.project-meta-item small {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.project-meta-item strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-meta-editor {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    overflow-wrap: anywhere;
}

.project-row-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Карточка проекта */
.project-tabs {
    margin-top: 4px;
}

.tab-list {
    position: sticky;
    z-index: 12;
    top: 84px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(250, 249, 247, 0.94);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(12px);
    scrollbar-width: thin;
}

.has-workspace-sidebar .project-list-toolbar,
.has-workspace-sidebar .tab-list {
    top: 12px;
}

.tab-button {
    min-height: 42px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab-button .icon {
    width: 17px;
    height: 17px;
}

.tab-button:hover {
    background: var(--surface);
    color: var(--ink);
}

.tab-button.is-active {
    border-color: var(--line-strong);
    background: var(--surface);
    box-shadow: 0 3px 10px rgba(35, 30, 26, 0.06);
    color: var(--ink);
}

.tab-button.is-active .icon {
    color: var(--accent);
}

.tab-button-customer.is-active {
    border-color: #e7bfc0;
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.tab-button-internal.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.tab-button-internal.is-active .icon {
    color: #fff;
}

.tab-panel {
    animation: content-in 220ms ease both;
}

.tab-panel:focus {
    outline: none;
}

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

.detail-grid-client {
    grid-template-columns: 1fr;
}

.project-history-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-history-list li {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.project-history-list li:first-child {
    padding-top: 0;
}

.project-history-list li:last-child {
    border-bottom: 0;
}

.project-history-list time,
.project-history-list li > span {
    color: var(--muted);
    font-size: 13px;
}

.project-history-more {
    margin-top: 14px;
}

.project-history-more summary {
    width: fit-content;
    list-style: none;
}

.project-history-more summary::-webkit-details-marker {
    display: none;
}

.project-history-more .project-history-list {
    margin-top: 14px;
}

.card {
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.card-title-line > .icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.card-title-line h2 {
    margin: 0;
}

dl {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 0 18px;
    margin: 0;
}

dt,
dd {
    padding: 10px 0;
    border-bottom: 1px solid #f0eeeb;
}

dt:nth-last-of-type(1),
dd:nth-last-of-type(1) {
    border-bottom: 0;
}

dt {
    color: var(--muted);
    font-size: 13px;
}

dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-weight: 620;
}

.project-status-card {
    overflow: hidden;
    background: linear-gradient(135deg, #fff 0%, #fff 65%, #fff7f7 100%);
}

.archive-project-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
}

.archive-project-button:disabled {
    border-color: var(--line);
    background: var(--surface-muted);
    box-shadow: none;
    color: var(--muted);
    cursor: not-allowed;
    opacity: 1;
}

.archive-project-button.is-ready {
    border-color: var(--success);
    background: var(--success);
    box-shadow: 0 8px 18px rgba(39, 128, 80, 0.2);
    color: #fff;
}

.archive-project-button.is-ready:hover {
    border-color: #206d45;
    background: #206d45;
    box-shadow: 0 10px 20px rgba(39, 128, 80, 0.24);
    color: #fff;
    transform: translateY(-1px);
}

.archive-state {
    margin: 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.project-status-calendar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project-status-calendar-grid.is-client {
    grid-template-columns: 1fr;
}

.project-status-calendar-grid > .card {
    min-width: 0;
}

.project-mini-calendar {
    overflow: hidden;
}

.mini-calendar-header,
.mini-calendar-navigation,
.project-task-heading,
.project-task-title-line,
.project-task-admin-actions {
    display: flex;
    align-items: center;
}

.mini-calendar-header,
.project-task-heading {
    justify-content: space-between;
    gap: 14px;
}

.mini-calendar-header .card-title-line {
    margin-bottom: 0;
}

.mini-calendar-navigation {
    gap: 4px;
}

.mini-calendar-title {
    display: block;
    margin: 14px 0 10px;
    text-transform: capitalize;
}

.mini-calendar-status,
.mini-calendar-hint {
    font-size: 12px;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
}

.mini-calendar-weekday {
    padding: 5px 2px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
}

.mini-calendar-day {
    min-width: 0;
    min-height: 58px;
    padding: 3px;
    background: var(--surface);
}

.mini-calendar-day.is-outside {
    background: var(--surface-muted);
    color: var(--ink);
}

.mini-calendar-day-button,
.mini-calendar-task {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.mini-calendar-task.is-event {
    border-left: 2px solid #416788;
    background: #edf4f8;
    color: #31526e;
}

.mini-calendar-task.is-task {
    border-left: 2px solid var(--success);
    background: var(--success-soft);
    color: #195c39;
}

.mini-calendar-day-button {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 750;
}

.mini-calendar-day.is-today .mini-calendar-day-button {
    background: var(--accent);
    color: #fff;
}

.mini-calendar-task {
    width: 100%;
    display: block;
    overflow: hidden;
    margin-top: 2px;
    border-radius: 4px;
    padding: 2px 3px;
    background: var(--accent-softer);
    color: var(--accent-strong);
    font-size: 8px;
    font-weight: 700;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-calendar-task.is-completed {
    background: var(--success-soft);
    color: var(--success);
    text-decoration: line-through;
}

.mini-calendar-day small {
    display: block;
    margin-top: 2px;
    font-size: 8px;
    text-align: center;
}

.mini-calendar-hint {
    margin: 10px 0 0;
}

.project-task-list {
    display: grid;
    gap: 12px;
}

.project-task-list > .card {
    margin-bottom: 0;
}

.project-task-card.is-completed {
    border-color: #b9d9c6;
    background: linear-gradient(135deg, #fff 0%, var(--success-soft) 140%);
}

.project-task-title-line {
    flex-wrap: wrap;
    gap: 8px;
}

.project-task-title-line h2 {
    margin: 0;
}

.task-kind,
.task-state {
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
}

.task-state.is-completed {
    background: var(--success-soft);
    color: var(--success);
}

.task-dates {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.task-dates span {
    display: inline-flex;
    margin-left: 7px;
    border-radius: 999px;
    padding: 2px 7px;
    background: var(--surface-muted);
    font-size: 10px;
    font-weight: 720;
}

.task-dates .task-calendar-state {
    background: var(--success-soft);
    color: var(--success);
}

.task-description {
    margin-top: 14px;
}

.task-assignee-list {
    display: grid;
    gap: 7px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.task-assignee-list li,
.task-assignee-list form,
.task-assignee-list label {
    display: flex;
    align-items: center;
}

.task-assignee-list li,
.task-assignee-list form {
    justify-content: space-between;
    gap: 12px;
}

.task-assignee-list li {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 10px;
    background: var(--surface-muted);
}

.task-assignee-list form {
    width: 100%;
}

.task-assignee-list label {
    gap: 9px;
    font-size: 13px;
    font-weight: 650;
}

.task-assignee-list li.is-completed label span {
    color: var(--muted);
    text-decoration: line-through;
}

.task-assignee-list li.is-completed {
    border-color: #b9d9c6;
    background: var(--success-soft);
}

.task-assignee-list form.is-enhanced > button {
    display: none;
}

.project-task-admin-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.project-task-editor {
    position: relative;
}

.project-task-editor summary {
    list-style: none;
    cursor: pointer;
}

.project-task-editor summary::-webkit-details-marker {
    display: none;
}

.project-task-editor[open] {
    width: 100%;
}

.project-task-editor[open] summary {
    margin-bottom: 14px;
}

.project-task-editor form {
    border-radius: 12px;
    padding: 16px;
    background: var(--surface-muted);
}

.task-participants-field .employee-choice-grid {
    max-height: 220px;
    overflow-y: auto;
}

.task-schedule-options {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.task-schedule-fields {
    display: grid;
    gap: 12px;
    border-left: 3px solid #efc5c6;
    padding: 12px 0 2px 14px;
}

.status-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.status-card-header .card-title-line {
    margin-bottom: 10px;
}

.status-progress-value {
    color: var(--ink);
    font-size: 24px;
    font-weight: 760;
    letter-spacing: -0.03em;
}

.status-update-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.inline-form .field {
    min-width: 260px;
}

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

.service-group {
    padding: 18px;
    border: 1px solid #ece9e5;
    border-radius: 13px;
    background: var(--surface-muted);
}

.service-group h3 {
    margin: 0 0 12px;
    font-size: 14px;
}

.service-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.empty-inline-state,
.future-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 30px 22px;
    border: 1px dashed var(--line-strong);
    border-radius: 13px;
    background: var(--surface-muted);
    color: var(--muted);
    text-align: center;
}

.empty-inline-state strong,
.future-upload strong {
    color: var(--ink);
}

.future-upload-icon,
.empty-state-icon,
.success-state-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
}

.future-upload-icon {
    margin-bottom: 7px;
}

.future-upload-icon .icon,
.empty-state-icon .icon,
.success-state-icon .icon {
    width: 23px;
    height: 23px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.section-heading h2,
.section-heading p,
.section-heading .card-title-line {
    margin-bottom: 0;
}

.coming-soon {
    flex: 0 0 auto;
    border: 1px solid #e1ddd8;
    border-radius: 999px;
    padding: 6px 10px;
    background: #f2f1ef;
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Чаты */
.chat-channel {
    overflow: hidden;
    padding: 0;
}

.chat-channel-customer {
    border-top: 3px solid var(--accent);
}

.chat-channel-internal {
    border-top: 3px solid var(--ink);
}

.global-chat-layout {
    height: calc(100dvh - 52px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    align-items: stretch;
    gap: 18px;
}

.global-chat-layout .chat-channel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.global-chat-layout .chat-message-list {
    min-height: 0;
    flex: 1;
    max-height: none;
}

.global-chat-layout .global-chat-members {
    min-height: 0;
    overflow-y: auto;
}

.global-chat-members ul {
    display: grid;
    gap: 4px;
    max-height: 580px;
    overflow: auto;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.global-chat-members li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 2px;
    font-size: 13px;
    font-weight: 620;
    overflow-wrap: anywhere;
}

.member-presence {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--success);
}

.interactive-calendar {
    padding: 0;
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.calendar-navigation,
.calendar-view-switch {
    display: flex;
    align-items: center;
    gap: 7px;
}

.calendar-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-view-switch .sort-chip {
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.calendar-navigation h2 {
    margin: 0 0 0 8px;
    font-size: 24px;
    text-transform: capitalize;
}

.calendar-loading {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* Доска предложений */
.suggestion-board-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: 18px;
}

.suggestion-compose-card {
    position: sticky;
    top: 12px;
}

.suggestion-submit {
    width: 100%;
    margin-top: 16px;
}

.suggestion-count {
    min-width: 34px;
    border-radius: 999px;
    padding: 7px 11px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.suggestion-card {
    animation: content-in 220ms ease both;
}

.suggestion-card.is-completed {
    border-color: #b9ddc9;
    background: #f3fbf6;
}

.suggestion-card.is-completed .suggestion-card-body {
    color: #587063;
}

.suggestion-completion-form,
.suggestion-clear-form {
    margin: 12px 0 0;
}

.suggestion-clear-form {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.suggestion-completed-label {
    display: inline-flex;
    margin-top: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    background: #e2f4e9;
    color: #287d50;
    font-size: 12px;
    font-weight: 800;
}

.database-placeholder-card {
    min-height: 260px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.database-placeholder-card h2 {
    margin: 0;
}

/* Клиентская база */

.client-directory-table {
    --client-columns: minmax(180px, 1.25fr) minmax(130px, 0.85fr) minmax(180px, 1fr) minmax(72px, 0.42fr) minmax(125px, 0.65fr);
    overflow: auto;
    border-radius: 15px;
    padding: 0;
    background: #fff;
    box-shadow: 0 8px 26px rgba(35, 30, 26, 0.045);
}

.client-directory-table-head,
.client-directory-card {
    display: grid;
    grid-template-columns: var(--client-columns);
    align-items: center;
    gap: 16px;
}

.client-directory-table-head {
    min-width: 840px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    background: #faf9f7;
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.client-directory-card {
    position: relative;
    min-width: 840px;
    border-bottom: 1px solid var(--line);
    padding: 14px;
    background: #fff;
    transition: background-color 150ms ease;
}

.client-directory-card:last-of-type {
    border-bottom: 0;
}

.client-directory-card:hover {
    background: var(--accent-softer);
}

.client-directory-card-link {
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: inherit;
}

.client-directory-card-link:focus-visible {
    outline: 3px solid rgba(199, 68, 69, 0.24);
    outline-offset: 2px;
}

.client-directory-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.client-directory-heading strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.regular-client-star {
    color: #c28a24;
}

.client-directory-value {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-directory-empty {
    border: 0;
    box-shadow: none;
}

.client-detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
}

.client-project-list {
    display: grid;
    gap: 8px;
}

.client-project-list a {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--ink);
    text-decoration: none;
}

.client-project-list a:hover {
    border-color: #e5babb;
    background: var(--accent-softer);
}

.client-project-list span {
    color: var(--muted);
    font-size: 12px;
}

.client-edit-card {
    max-width: 760px;
}

.client-edit-card .button {
    margin-top: 14px;
}

.suggestion-card-meta,
.suggestion-author {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.suggestion-card-meta {
    justify-content: space-between;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}

.suggestion-card-body {
    margin: 18px 0;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.suggestion-author .icon {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.suggestion-author strong {
    color: var(--ink);
}

.suggestion-empty-state {
    padding: 42px 24px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--line);
}

.calendar-weekday {
    padding: 10px 12px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.calendar-day {
    min-height: 112px;
    padding: 12px;
    background: var(--surface);
}

.interactive-calendar-day {
    min-width: 0;
    min-height: 82px;
    padding: 7px;
}

.calendar-day-number,
.calendar-week-day-heading {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
}

.calendar-day-number {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    padding: 0;
    font-size: 13px;
    font-weight: 720;
}

.calendar-day-number:hover,
.calendar-week-day-heading:hover {
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.calendar-day.is-today .calendar-day-number {
    background: var(--accent);
    color: #fff;
}

.calendar-day-events,
.calendar-week-events {
    display: grid;
    gap: 4px;
    margin-top: 5px;
}

.calendar-event {
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 5px 6px;
    background: var(--accent-softer);
    box-shadow: none;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 720;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.calendar-event:hover {
    background: #f5dddc;
}

.calendar-event-deadline {
    border-left-color: #9b2c2c;
}

.calendar-event-meeting {
    border-left-color: #416788;
    background: #edf4f8;
    color: #31526e;
}

.calendar-event-internal {
    border-left-color: #71685f;
    background: #f1efed;
    color: var(--ink);
}

.calendar-event-task {
    border-left-color: var(--success);
    background: var(--success-soft);
    color: #195c39;
}

.calendar-event-task.is-completed {
    opacity: 0.68;
    text-decoration: line-through;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid var(--line);
    background: var(--line);
    gap: 1px;
}

.calendar-week-day {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    min-width: 0;
    min-height: 88px;
    padding: 0;
    background: var(--surface);
}

.calendar-week-day.is-today {
    background: var(--accent-softer);
}

.calendar-week-day-heading {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    gap: 3px;
    border-right: 1px solid var(--line);
    border-radius: 0;
    padding: 12px;
}

.calendar-week-day .calendar-week-events {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    align-content: center;
    align-items: start;
    min-width: 0;
    gap: 8px;
    margin: 0;
    padding: 12px;
}

.calendar-week-events .calendar-event { display: block; min-height: 44px; padding: 8px 10px; font-size: 13px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.calendar-week-event-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

.calendar-week-day-heading span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-week-day-heading strong {
    font-size: 20px;
}

.calendar-week-empty {
    padding: 0;
    font-size: 12px;
    text-align: left;
}

.crm-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-md);
}

.crm-dialog::backdrop {
    background: rgba(23, 21, 20, 0.46);
    backdrop-filter: blur(3px);
}

.calendar-event-form {
    display: grid;
    gap: 10px;
}

.calendar-event-form .dialog-heading {
    margin-bottom: 4px;
}

.calendar-event-form .form-row,
.calendar-event-form .dialog-actions {
    margin-bottom: 0;
}

.calendar-event-form .dialog-actions {
    margin-top: 4px;
}

.calendar-event-description-input {
    height: 68px;
    min-height: 68px;
    max-height: 110px;
}

.calendar-reminder-field {
    margin-top: 2px;
}

.dialog-heading,
.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.dialog-heading {
    margin-bottom: 20px;
}

.dialog-heading h2 {
    margin: 3px 0 0;
}

.dialog-actions {
    justify-content: flex-end;
    margin-top: 20px;
}

.form-errors {
    margin-bottom: 14px;
    border: 1px solid #e9b4b4;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff2f2;
    color: var(--danger);
    font-size: 13px;
}

.calendar-participants-field .employee-choice-grid {
    max-height: 145px;
    overflow-y: auto;
}

.calendar-event-details {
    grid-template-columns: 130px minmax(0, 1fr);
}

.calendar-event-description {
    margin-top: 18px;
    border-radius: 10px;
    padding: 14px;
    background: var(--surface-muted);
    color: var(--muted);
}

.calendar-day.is-outside {
    background: var(--surface-muted);
    color: var(--ink);
}

.calendar-day time {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 720;
}

.calendar-day.is-today {
    background: var(--accent-softer);
}

.calendar-day.is-today time {
    background: var(--accent);
    color: #fff;
}

.calendar-note {
    margin: 0;
    padding: 16px 24px;
    color: var(--muted);
    font-size: 13px;
}

.chat-channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
}

.chat-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.chat-channel-internal .chat-title-icon {
    background: #efefee;
    color: var(--ink);
}

.chat-title-icon .icon {
    width: 18px;
    height: 18px;
}

.chat-channel-header h2 {
    margin: 1px 0 0;
}

.chat-channel-label {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.chat-channel-customer .chat-channel-label {
    color: var(--accent-strong);
}

.chat-visibility-notice {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    border: 1px solid #e1ddd8;
    border-radius: 999px;
    padding: 7px 11px;
    background: #f3f2f0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.chat-channel-customer .chat-visibility-notice {
    border-color: #efd0d1;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.chat-message-list {
    max-height: 540px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 14px;
    background: #f8f7f5;
    list-style: none;
    scrollbar-color: #ccc6bf transparent;
    scrollbar-width: thin;
}

.chat-message {
    width: min(74%, 680px);
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 5px 14px 14px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.chat-message.is-own {
    align-self: flex-end;
    border-radius: 14px 5px 14px 14px;
}

.chat-channel-customer .chat-message.is-own {
    border-color: #ecc5c6;
    background: var(--accent-softer);
}

.chat-channel-internal .chat-message.is-own {
    border-color: #d9d6d2;
    background: #f0efed;
}

.chat-channel-global .chat-message.is-own {
    border-color: #edc5c5;
    background: var(--accent-softer);
}

.chat-members-panel {
    display: grid;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.chat-members-panel strong {
    color: var(--ink);
    font-size: 14px;
}

.chat-members-panel p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.chat-members-panel form {
    display: grid;
    justify-items: start;
    gap: 12px;
}

.chat-members-panel div.employee-choice-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chat-members-panel div.employee-choice-grid label {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.chat-members-panel div.employee-choice-grid label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-softer);
    color: var(--accent-strong);
}

.chat-members-panel div.employee-choice-grid input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
}

.chat-access-note {
    margin: 0;
    padding: 24px;
    color: var(--muted);
}

.chat-message-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 3px;
    font-size: 10px;
}

.chat-message-meta strong {
    color: var(--ink);
}

.chat-message-meta time {
    flex: 0 0 auto;
    color: var(--muted);
}

.chat-message-body {
    overflow-wrap: anywhere;
    white-space: pre-line;
    font-size: 13px;
    line-height: 1.4;
}

.chat-empty-message {
    padding: 38px 20px;
    color: var(--muted);
    text-align: center;
}

.chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px 12px;
    padding: 11px 14px 13px;
    border-top: 1px solid var(--line);
}

.chat-compose .field {
    min-width: 0;
}

.chat-compose textarea {
    height: 44px;
    min-height: 44px;
    max-height: 144px;
    resize: none;
}

.chat-compose-error:not([hidden]) {
    grid-column: 1 / -1;
    margin: 0 0 12px;
    color: #8f1c13;
}

.chat-compose > button {
    min-height: 44px;
    margin: 0;
}

.chat-channel-internal .chat-compose > button {
    border-color: var(--ink);
    background: var(--ink);
    box-shadow: none;
}

.chat-channel-internal .chat-compose > button:hover {
    border-color: #000;
    background: #000;
}

.chat-confirmation {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 8px 10px;
    margin-top: 11px;
    padding: 12px 13px;
    border: 1px solid #ebbbbd;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.chat-confirmation input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.chat-confirmation label {
    font-size: 13px;
    font-weight: 700;
}

.chat-confirmation .errorlist {
    grid-column: 1 / -1;
    margin: 0;
}

/* Доступ клиентов и файлы */
.client-access-card {
    border-color: #e4c9ca;
    background: #fffdfd;
}

.client-access-badge {
    border-color: #efd0d1;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.magic-link-result {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #b9d9c6;
    border-radius: 13px;
    background: var(--success-soft);
}

.magic-link-result strong {
    color: #195c39;
}

.magic-link-result p {
    margin: 6px 0 14px;
}

.copy-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.copy-link-row input {
    background: rgba(255, 255, 255, 0.76);
    font-family: var(--font-ui);
    font-size: 12px;
}

.client-invitation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.client-access-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.client-access-columns h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
}

.client-access-columns h3 .icon {
    color: var(--accent);
}

.plain-list,
.link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.plain-list > li,
.link-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 10px 0;
    border-bottom: 1px solid #ece9e5;
}

.plain-list > li:last-child,
.link-list li:last-child {
    border-bottom: 0;
}

.plain-list strong,
.plain-list small,
.link-list small {
    display: block;
}

.plain-list form,
.link-list form {
    flex: 0 0 auto;
}

.cloud-link-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
}

/* Формы */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 720;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    padding: 9px 12px;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 0;
    border-radius: 5px;
    padding: 0;
    accent-color: var(--accent);
    box-shadow: none;
}

div.employee-choice-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

div.employee-choice-grid > div {
    min-width: 0;
}

div.employee-choice-grid label {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 10px;
    background: var(--surface-muted);
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

div.employee-choice-grid label:has(input:checked) {
    border-color: #e6afb1;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.compact-checkbox-row {
    width: fit-content;
    max-width: 100%;
    min-height: 36px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 10px;
    background: var(--surface-muted);
    color: var(--ink);
    font-size: 13px;
    font-weight: 680;
    cursor: pointer;
}

.compact-checkbox-row:has(input:checked) {
    border-color: #e6afb1;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #bbb4ac;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(199, 68, 69, 0.13);
}

input[readonly] {
    color: var(--ink);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 16px;
}

.secondary,
button.secondary {
    border-color: #e6b5b7;
    background: var(--surface);
    box-shadow: none;
    color: var(--danger);
}

.secondary:hover,
button.secondary:hover {
    border-color: var(--danger);
    background: var(--danger-soft);
    box-shadow: none;
    color: var(--danger);
}

.form-error,
.errorlist {
    color: var(--danger);
}

.errorlist {
    margin: 4px 0;
    padding-left: 18px;
    font-size: 13px;
}

/* Вход и состояния */
.auth-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(199, 68, 69, 0.08), transparent 28%),
        radial-gradient(circle at 88% 90%, rgba(23, 23, 22, 0.05), transparent 28%),
        var(--background);
}

.auth-page main.container {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding-top: 40px;
    padding-bottom: 40px;
}

.login-card {
    width: min(458px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-md);
    animation: login-in 320ms ease both;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.login-brand-logo {
    display: block;
    width: min(250px, 100%);
    height: auto;
}

.login-brand h1 {
    margin: 0;
    color: var(--ink);
    font-size: 28px;
    font-weight: 770;
    letter-spacing: -0.035em;
}

.login-intro {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-card .field {
    margin-bottom: 15px;
}

.login-alternative {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.login-alternative-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 680;
    text-decoration: none;
}

.email-sent-state {
    text-align: center;
}

.email-sent-state .success-state-icon {
    margin: 0 auto 14px;
    background: var(--success-soft);
    color: var(--success);
}

.email-sent-state h2,
.magic-login-card h2 {
    margin-top: 18px;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.message {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #b9d9c6;
    border-radius: 12px;
    background: var(--success-soft);
    color: #195c39;
    font-size: 14px;
    font-weight: 620;
    animation: message-in 220ms ease both;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 58px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    text-align: center;
}

.empty-state-icon {
    margin-bottom: 16px;
}

.empty-state h1,
.empty-state h2 {
    margin: 4px 0 8px;
    color: var(--ink);
}

.empty-state h1 {
    font-size: 32px;
    letter-spacing: -0.035em;
}

.empty-state p:not(.eyebrow) {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
}

.error-state {
    margin-top: 7vh;
}

.error-state .button {
    margin-top: 22px;
}

.preserve-lines {
    overflow-wrap: anywhere;
}

.nowrap {
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

@keyframes content-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes login-in {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes message-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .navigation {
        gap: 18px;
    }

    .user-summary {
        display: none;
    }

    .global-chat-layout {
        height: auto;
        grid-template-columns: 1fr;
    }

    .global-chat-layout .chat-channel {
        height: calc(100dvh - 52px);
    }

    .global-chat-layout .global-chat-members {
        max-height: none;
        overflow: visible;
    }

    .suggestion-board-layout {
        grid-template-columns: 1fr;
    }

    .suggestion-compose-card {
        position: static;
    }

    .global-chat-members ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-card-footer {
        flex-wrap: wrap;
        gap: 15px 24px;
    }

    .project-row-actions {
        width: auto;
    }
}

@media (max-width: 760px) {
    body {
        overflow-x: hidden;
    }

    .container {
        width: min(100% - 28px, 1220px);
    }

    main.container,
    .has-workspace-sidebar main.container {
        width: min(100% - 28px, 1220px);
        margin-right: auto;
        margin-left: auto;
        padding-top: 60px;
        padding-bottom: 48px;
    }

    .global-chat-layout .chat-channel {
        height: calc(100dvh - 108px);
    }

    .chat-compose {
        grid-template-columns: 1fr;
    }

    .chat-compose > button {
        width: 100%;
    }

    .workspace-menu-toggle {
        display: inline-grid;
        position: fixed;
        z-index: 48;
        top: 12px;
        left: 14px;
        border-color: var(--line);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: var(--shadow-sm);
        backdrop-filter: blur(12px);
    }

    .workspace-sidebar,
    .workspace-sidebar:hover,
    .workspace-sidebar-pinned .workspace-sidebar {
        z-index: 51;
        top: 0;
        width: min(88vw, 320px);
        transform: translateX(-102%);
        box-shadow: 16px 0 40px rgba(35, 30, 26, 0.18);
        transition: transform 180ms ease;
    }

    .workspace-sidebar-open .workspace-sidebar {
        transform: translateX(0);
    }

    .workspace-sidebar-header {
        min-height: 72px;
        gap: 8px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .workspace-sidebar-brand,
    .workspace-sidebar:hover .workspace-sidebar-brand,
    .workspace-sidebar-pinned .workspace-sidebar-brand {
        width: 196px;
        flex: 1 1 196px;
    }

    .workspace-sidebar-logo,
    .workspace-sidebar:hover .workspace-sidebar-logo,
    .workspace-sidebar-pinned .workspace-sidebar-logo {
        transform: translateX(0);
    }

    .workspace-sidebar .workspace-nav-link span,
    .workspace-sidebar .workspace-subnav-link span {
        max-width: none;
        flex: 1;
        opacity: 1;
    }

    .workspace-sidebar-pin {
        display: none;
    }

    .workspace-sidebar-close {
        display: inline-grid;
        margin-left: auto;
    }

    .workspace-navigation {
        padding: 8px;
    }

    .workspace-utility-navigation {
        margin-right: 8px;
        margin-left: 8px;
    }

    .workspace-sidebar .workspace-nav-link,
    .workspace-sidebar:hover .workspace-nav-link,
    .workspace-sidebar-pinned .workspace-nav-link {
        min-height: 44px;
        padding: 7px 12px;
    }

    .workspace-nav-chevron {
        opacity: 1;
    }

    .workspace-sidebar-open .workspace-sidebar .workspace-nav-group[open] .workspace-subnavigation {
        display: grid;
    }

    .workspace-sidebar-open .workspace-sidebar:not(:hover) .workspace-notification-badge {
        position: static;
        min-width: 21px;
        height: 21px;
        padding: 0 6px;
        font-size: 11px;
    }

    .workspace-sidebar-user {
        gap: 8px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .workspace-user-summary,
    .workspace-sidebar:hover .workspace-user-summary,
    .workspace-sidebar-pinned .workspace-user-summary {
        max-width: none;
        flex: 1;
        opacity: 1;
    }

    .workspace-sidebar-backdrop {
        position: fixed;
        z-index: 50;
        inset: 0;
        display: block;
        background: rgba(23, 23, 22, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .workspace-sidebar-open .workspace-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .workspace-sidebar-open body {
        overflow: hidden;
    }

    .navigation {
        min-height: 64px;
        grid-template-columns: auto 1fr auto;
        gap: 10px;
    }

    .primary-navigation .nav-link span {
        display: none;
    }

    .brand-logo {
        width: 150px;
    }

    .primary-navigation {
        justify-content: flex-end;
    }

    .nav-link {
        width: 40px;
        min-height: 40px;
        justify-content: center;
        padding: 0;
    }

    .notification-count-badge {
        position: absolute;
        top: -5px;
        right: -5px;
    }

    .notification-card {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 13px 14px;
    }

    .push-settings {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 14px;
    }

    .push-settings-actions .button {
        flex: 1 1 auto;
    }

    .notification-card-actions {
        flex-wrap: wrap;
    }

    .user-avatar {
        display: none;
    }

    .project-search-form,
    .project-search-input-wrap {
        width: 100%;
        flex-basis: 100%;
    }

    .project-search-input-wrap {
        min-width: 0;
    }

    .client-detail-layout {
        grid-template-columns: 1fr;
    }

    .client-directory-table-head {
        display: none;
    }

    .client-directory-card {
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 14px;
    }

    .client-directory-heading {
        grid-column: 1 / -1;
    }

    .client-directory-value {
        display: grid;
        gap: 3px;
        white-space: normal;
    }

    .client-directory-value::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 750;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 24px;
    }

    .page-heading h1 {
        font-size: clamp(32px, 11vw, 44px);
    }

    .page-heading .button {
        align-self: flex-start;
    }

    .project-list-toolbar {
        top: 72px;
        padding: 12px;
    }

    .has-workspace-sidebar .project-list-toolbar {
        top: 56px;
    }

    .notification-toolbar {
        top: 56px;
    }

    .project-filter-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .project-count {
        min-width: 0;
        line-height: 1.3;
    }

    .project-filter-actions {
        min-width: 0;
    }

    .project-mobile-controls {
        min-width: 0;
        display: block;
    }

    .project-mobile-controls-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
        border-top: 1px solid var(--line);
        padding: 10px 2px 0;
        color: var(--ink);
        font-size: 13px;
        font-weight: 750;
        cursor: pointer;
        list-style: none;
    }

    .project-mobile-controls-toggle::-webkit-details-marker {
        display: none;
    }

    .project-mobile-controls-toggle .icon {
        color: var(--accent);
    }

    .project-mobile-controls-state {
        margin-left: auto;
        border-radius: 999px;
        padding: 3px 7px;
        background: var(--accent-soft);
        color: var(--accent-strong);
        font-size: 10px;
        font-weight: 800;
    }

    .project-mobile-controls-chevron {
        display: inline-flex;
        margin-left: auto;
        transition: transform 160ms ease;
    }

    .project-mobile-controls-state + .project-mobile-controls-chevron {
        margin-left: 0;
    }

    .project-mobile-controls[open] .project-mobile-controls-chevron {
        transform: rotate(180deg);
    }

    .project-mobile-controls-content {
        min-width: 0;
        display: grid !important;
        gap: 10px;
        padding-top: 10px;
    }

    .project-mobile-controls:not([open]) > .project-mobile-controls-content {
        display: none !important;
    }

    .service-filter-chip {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .sort-toolbar {
        flex-wrap: wrap;
    }

    .project-filter-fields,
    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .compact-field,
    .date-range-picker,
    .date-range-picker summary,
    .project-filter-fields > .button {
        width: 100%;
    }

    .timeline-filter-form,
    .project-status-calendar-grid {
        width: 100%;
    }

    .project-status-calendar-grid {
        grid-template-columns: 1fr;
    }

    .date-range-popover {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-shadow: var(--shadow-xs);
    }

    .calendar-navigation {
        flex-wrap: wrap;
    }

    .calendar-navigation h2 {
        width: 100%;
        margin: 6px 0 0;
    }

    .calendar-view-switch {
        align-self: flex-start;
    }

    .calendar-toolbar-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .calendar-surface {
        overflow-x: auto;
    }

    .interactive-calendar { padding: 0; }
    .interactive-calendar .calendar-navigation h2 { font-size: 18px; }

    .interactive-month-grid {
        min-width: 700px;
    }

    .calendar-week-day { grid-template-columns: 64px minmax(0, 1fr); min-height: 76px; }
    .calendar-week-day-heading { min-height: 76px; padding: 8px 4px; }
    .calendar-week-day .calendar-week-events { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 6px; }

    .crm-dialog {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        overflow-x: hidden;
        padding: 18px;
    }

    .calendar-event-form,
    .calendar-event-form .field,
    .calendar-datetime-row,
    .calendar-datetime-row > .field,
    .task-schedule-fields,
    .task-schedule-fields .form-row,
    .task-schedule-fields .field {
        min-width: 0;
        max-width: 100%;
    }

    .calendar-datetime-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .calendar-event-form input[type="datetime-local"],
    .task-schedule-fields input[type="datetime-local"] {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        display: block;
        font-size: 16px;
    }

    .task-schedule-fields {
        width: 100%;
        padding-left: 10px;
    }

    .dialog-actions {
        min-width: 0;
        flex-wrap: wrap;
    }

    .dialog-actions .button {
        min-width: 0;
        flex: 1 1 auto;
    }

    input,
    select,
    textarea {
        min-width: 0;
        max-width: 100%;
        font-size: 16px;
    }

    .project-task-admin-actions {
        justify-content: stretch;
    }

    .project-task-admin-actions > *,
    .project-task-admin-actions .button {
        width: 100%;
    }

    .chat-members-panel div.employee-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 78px;
        padding: 6px;
    }

    .project-card-main {
        padding: 18px;
    }

    .project-card-heading {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .project-card-status {
        justify-content: space-between;
    }

    .project-card-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 15px 18px;
    }

    .project-row-actions {
        width: 100%;
        margin-left: 0;
    }

    .project-row-actions .button {
        width: 100%;
    }

    .tab-list {
        top: 72px;
        margin-right: -5px;
        margin-left: -5px;
    }

    .has-workspace-sidebar .tab-list {
        top: 56px;
    }

    .tab-button {
        min-height: 44px;
    }

    .detail-grid,
    .service-grid,
    .client-access-columns,
    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 0;
    }

    dt {
        padding-bottom: 2px;
        border-bottom: 0;
    }

    dd {
        padding-top: 2px;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form .field {
        min-width: 0;
    }

    .chat-channel-header,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .chat-message {
        width: 90%;
    }

    .copy-link-row {
        grid-template-columns: 1fr;
    }

    .copy-link-row .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .client-directory-card {
        grid-template-columns: 1fr;
    }

    .client-directory-heading {
        grid-column: auto;
    }

    .project-filter-label {
        display: none;
    }

    .project-filter-actions .button {
        gap: 6px;
        padding-right: 10px !important;
        padding-left: 10px !important;
    }

    .project-list-toolbar {
        top: 66px;
    }

    .has-workspace-sidebar .project-list-toolbar {
        top: 56px;
    }

    .chat-members-panel div.employee-choice-grid,
    .global-chat-members ul,
    div.employee-choice-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: 56px;
        padding: 3px;
    }

    .date-range-fields {
        grid-template-columns: 1fr;
    }

    .calendar-day time {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .brand-logo {
        width: 100px;
    }

    .navigation,
    .navigation-brand-group {
        gap: 6px;
    }

    .card,
    .login-card {
        border-radius: 14px;
    }

    .login-card {
        padding: 26px 20px;
    }

    .project-title {
        font-size: 19px;
    }

    .tab-list {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .chat-message-list,
    .chat-compose,
    .chat-channel-header {
        padding-right: 17px;
        padding-left: 17px;
    }

    .chat-visibility-notice {
        white-space: normal;
    }

    .client-invitation-actions .button,
    .client-invitation-actions button {
        width: 100%;
    }

    .dialog-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .dialog-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
