:root {
    color-scheme: light;
    --bg: #fbfbfe;
    --surface: #ffffff;
    --surface-soft: #f5f6fb;
    --text: #24252d;
    --muted: #7b7f8c;
    --line: #ececf3;
    --primary: #6c5ce7;
    --primary-dark: #5848cf;
    --primary-soft: #f0edff;
    --tiger: #638fb7;
    --fragranta: #193b54;
    --success: #00a878;
    --warning: #f59f2f;
    --danger: #e6467a;
    --shadow: 0 20px 44px rgba(31, 35, 51, .07);
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    min-width: 1180px;
    background:
        linear-gradient(90deg, #33a8ff 0, #8b5cf6 50%, #ff2abf 100%) top / 100% 3px no-repeat,
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 282px minmax(0, 1fr);
    min-width: 1180px;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .86);
    color: var(--text);
    backdrop-filter: blur(18px);
}

.language-switcher {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 92px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
}

.language-switcher a:hover,
.language-switcher a.is-active {
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: 0 8px 18px rgba(31, 35, 51, .08);
}

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

.brand strong,
.brand small {
    display: block;
}

.brand-stack {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 62px;
    height: 42px;
}

.brand-stack img,
.company-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-stack img {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(31, 35, 51, .12);
}

.brand-stack img:first-child {
    left: 0;
    z-index: 2;
}

.brand-stack img:last-child {
    right: 0;
    z-index: 1;
}

.brand small,
.sidebar-footer > span,
.muted {
    color: var(--muted);
}

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

.nav-list a,
.link-button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    padding: 11px 12px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.nav-list a:hover,
.link-button:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-list a.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 850;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
}

.sidebar-user {
    min-width: 0;
}

.footer-admin-link {
    display: inline-flex;
    width: fit-content;
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.footer-admin-link:hover,
.footer-admin-link.is-active {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.main-content {
    width: min(1480px, 100%);
    padding: 30px 34px;
    transition: opacity .14s ease, transform .14s ease;
    will-change: opacity, transform;
}

body.is-navigating .main-content {
    opacity: .82;
    transform: translateY(2px);
}

@media (prefers-reduced-motion: reduce) {
    .main-content {
        transition: none;
    }

    body.is-navigating .main-content {
        opacity: 1;
        transform: none;
    }
}

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

.page-header h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.detail-header h1 {
    font-size: clamp(28px, 2.8vw, 38px);
}

.page-header p {
    max-width: 780px;
    margin: 10px 0 0;
    color: var(--muted);
}

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

.view-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.view-switch a {
    min-width: 86px;
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 820;
    text-align: center;
}

.view-switch a:hover,
.view-switch a.is-active {
    background: var(--surface);
    color: var(--primary-dark);
    box-shadow: 0 7px 18px rgba(31, 35, 51, .08);
}

.eyebrow {
    margin: 0 0 6px !important;
    color: var(--primary) !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 9px 14px;
    font-weight: 760;
    cursor: pointer;
    white-space: nowrap;
}

.button-primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, #6c5ce7, #8f57ff);
    color: #fff;
}

.button-primary:hover {
    background: linear-gradient(135deg, #5848cf, #7b42ec);
}

.button-muted {
    color: var(--danger);
}

.button-subtle {
    color: var(--muted);
}

.button-subtle:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.button-filter {
    border-color: var(--fragranta);
    background: var(--fragranta);
    color: #fff;
}

.button-filter:hover {
    border-color: #102f43;
    background: #102f43;
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.metric-grid,
.dashboard-grid,
.focus-grid,
.detail-summary,
.detail-work-grid,
.two-column,
.project-grid {
    display: grid;
    gap: 18px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.dashboard-grid,
.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.dashboard-topic-panel {
    margin-bottom: 24px;
}

.dashboard-focus-grid {
    margin-top: 24px;
}

.focus-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    margin-bottom: 18px;
}

.detail-summary {
    grid-template-columns: 1.2fr 1fr 1fr;
    margin-bottom: 18px;
}

.detail-work-grid {
    grid-template-columns: minmax(260px, .9fr) minmax(420px, 1.35fr) minmax(260px, .9fr);
    align-items: start;
    margin-bottom: 18px;
}

.detail-side-stack {
    display: block;
}

.detail-side-stack .file-panel {
    margin-top: 24px;
}

.project-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.project-group-view {
    display: grid;
    gap: 34px;
}

.project-group-section {
    display: grid;
    gap: 14px;
}

.project-group-section + .project-group-section {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.project-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
}

.project-group-header h2 {
    margin: 0;
    font-size: 24px;
}

.project-group-header small {
    color: var(--muted);
    font-weight: 750;
}

.project-group-grid {
    margin-bottom: 0;
}

.panel,
.metric-card,
.project-card,
.auth-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
}

.metric-card {
    display: block;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #fbfbff);
}

.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 38px;
    line-height: 1;
}

.metric-card:hover {
    border-color: #d6d1ff;
    transform: translateY(-1px);
}

.notification-panel {
    margin-bottom: 18px;
}

.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
}

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

.notification-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.notification-row.is-unread {
    border-color: #d8d2ff;
    background: #fbf9ff;
}

.notification-content {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.notification-content:hover strong {
    color: var(--primary);
}

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

.notification-dismiss-form {
    margin: 0;
}

.notification-dismiss-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    font-weight: 850;
    line-height: 1;
}

.notification-dismiss-button:hover {
    border-color: rgba(255, 47, 103, .25);
    background: #fff5f8;
    color: var(--danger);
}

.notification-dismiss-button:disabled {
    cursor: wait;
    opacity: .55;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.company-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow);
}

.company-card strong {
    display: block;
    font-size: 17px;
}

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

.company-card em {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-style: normal;
    font-weight: 900;
}

.metric-success strong {
    color: var(--success);
}

.metric-warning strong {
    color: var(--warning);
}

.metric-danger strong {
    color: var(--danger);
}

.project-cost-metrics {
    margin-bottom: 18px;
}

.project-cost-body .main-content {
    width: 100%;
    max-width: 1640px;
}

.project-list-body .main-content {
    width: 100%;
    max-width: 1680px;
}

.project-cost-page {
    width: 100%;
}

.project-cost-panel {
    margin-bottom: 18px;
}

.cost-table-wrap {
    overflow-x: visible;
}

.cost-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.cost-table th,
.cost-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.cost-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.cost-table td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.cost-col-project-id {
    width: 8%;
}

.cost-col-project {
    width: 14%;
}

.cost-col-status {
    width: 8%;
}

.cost-col-hours {
    width: 10%;
}

.cost-col-created {
    width: 8%;
}

.cost-col-forecast {
    width: 15%;
}

.cost-col-planned {
    width: 8%;
}

.cost-col-completed {
    width: 12%;
}

.cost-col-duration {
    width: 8%;
}

.cost-col-deviation {
    width: 8%;
}

.cost-nowrap {
    white-space: nowrap;
}

.cost-project-link {
    color: var(--text);
    font-weight: 400;
}

.cost-project-id {
    color: var(--muted);
    font-weight: 400;
}

.cost-project-link:hover {
    color: var(--primary);
}

.cost-delay {
    color: var(--danger);
    font-weight: 900;
}

.cost-early {
    color: #008f6b;
    font-weight: 900;
}

.cost-on-time {
    color: var(--muted);
    font-weight: 900;
}

.cost-period-filter {
    align-items: flex-end;
    margin-bottom: 18px;
}

.cost-period-filter label {
    display: grid;
    flex: 0 0 140px;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.cost-period-filter .button-filter {
    flex: 0 0 160px;
    min-height: 42px;
    align-self: flex-end;
    padding: 10px 14px;
}

.cost-booking-table th,
.cost-booking-table td {
    white-space: nowrap;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-header h2,
.panel h2 {
    margin: 0;
    font-size: 18px;
}

.spacer {
    margin-top: 24px;
}

.status-bars,
.owner-list,
.activity-list,
.project-step-list,
.file-list,
.module-list {
    display: grid;
    gap: 12px;
}

.project-step-list {
    margin-top: 1em;
}

.status-row,
.owner-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 12px;
}

.owner-row {
    grid-template-columns: minmax(0, 1fr) auto;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.owner-link {
    min-width: 0;
    border-radius: 8px;
}

.owner-link:hover .user-chip {
    color: var(--primary-dark);
}

.project-step-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
}

.project-step-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.project-step-title {
    min-width: 0;
}

.project-step-item.is-done .project-step-title {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.user-list {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.agency-list {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.user-list-compact {
    gap: 8px;
}

.agency-list-compact {
    gap: 8px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    color: var(--text);
    font-weight: 760;
}

.agency-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    color: var(--text);
    font-weight: 760;
}

.user-chip-compact {
    gap: 7px;
    font-size: 13px;
}

.agency-chip-compact {
    gap: 7px;
    font-size: 13px;
}

.user-chip-muted {
    color: var(--muted);
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--surface-soft);
    box-shadow: 0 5px 14px rgba(31, 35, 51, .12);
    color: var(--primary-dark);
    object-fit: cover;
    font-size: 12px;
    font-weight: 900;
}

.user-chip-compact .user-avatar {
    width: 36px;
    height: 36px;
}

.agency-avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 10px;
    background: var(--surface-soft);
    box-shadow: 0 5px 14px rgba(31, 35, 51, .12);
    color: var(--primary-dark);
    object-fit: cover;
    font-size: 12px;
    font-weight: 900;
}

.agency-chip-compact .agency-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.bar-track,
.progress-line {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-soft);
}

.progress-line.large {
    height: 14px;
}

.bar-fill,
.progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #7E57E9;
}

.status-bars .bar-fill {
    background: #7E57E9 !important;
}

.status-idea {
    background: #6b7280 !important;
}

.status-planned {
    background: #3877E2 !important;
}

.status-development {
    background: #22c55e !important;
}

.status-testing {
    background: #c2418f !important;
}

.status-paused {
    background: #b45309 !important;
}

.status-done {
    background: #047857 !important;
}

.project-table-panel {
    padding: 0;
    overflow: hidden;
    background: #f4f5f9;
}

.project-table-wrap {
    overflow-x: auto;
    width: 100%;
    background: #f4f5f9;
}

.project-table {
    width: max(100%, 1500px);
    min-width: 1500px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.project-table-col-id {
    width: 6%;
}

.project-table-col-project {
    width: 24%;
}

.project-table-col-participants {
    width: 12%;
}

.project-table-col-company-area {
    width: 17%;
}

.project-table-col-group {
    width: 11%;
}

.project-table-col-state {
    width: 12%;
}

.project-table-col-progress-period {
    width: 18%;
}

.project-table th,
.project-table td {
    border-bottom: 1px solid var(--line);
    padding: 15px 12px;
    text-align: left;
    vertical-align: top;
    min-width: 0;
    overflow-wrap: anywhere;
}

.project-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.25;
    text-transform: uppercase;
    background: #f4f5f9;
    white-space: nowrap;
}

.project-table tbody tr:hover {
    background: #fbfaff;
}

.project-table .badge,
.project-table .status-pill,
.project-table .topic-pill,
.project-table .project-group-pill,
.project-table .company-pill {
    max-width: 100%;
    min-height: 24px;
    padding: 5px 10px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
}

.project-table .status-pill,
.project-table .badge {
    justify-content: center;
}

.project-table .company-pill,
.project-table .topic-pill,
.project-table .project-group-pill {
    margin-bottom: 0;
}

.project-table .project-group-pill {
    white-space: normal;
}

.project-table-badge-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 10px;
    row-gap: 9px;
}

.project-table-state-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.project-table-participants {
    display: grid;
    gap: 9px;
}

.project-table .user-list,
.project-table .agency-list {
    display: grid;
    justify-items: start;
    gap: 7px;
}

.project-table .user-chip-compact,
.project-table .agency-chip-compact {
    max-width: 100%;
    gap: 6px;
    font-size: 12px;
    line-height: 1.2;
}

.project-table .user-chip-compact .user-avatar,
.project-table .agency-chip-compact .agency-avatar {
    width: 30px;
    height: 30px;
}

.project-row-critical {
    animation: none;
}

.project-row-critical > td {
    animation: project-row-critical-cell-pulse 5s ease-in-out infinite;
}

.project-row-critical > td:first-child {
    box-shadow: inset 3px 0 0 rgba(255, 128, 151, .42);
}

@keyframes project-row-critical-cell-pulse {
    0%,
    8% {
        background-color: rgba(255, 128, 151, .12);
    }

    4% {
        background-color: rgba(255, 128, 151, .18);
    }

    16% {
        background-color: transparent;
    }

    100% {
        background-color: transparent;
    }
}

.project-table-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    color: var(--text);
}

.project-table-title strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.project-table-title small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.42;
}

.table-project-id {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7f8fc;
    color: #6f7785;
    font-weight: 800;
    line-height: 1;
}

.table-progress {
    display: grid;
    gap: 6px;
    min-width: 160px;
}

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

.project-table-dates {
    display: block;
    width: fit-content;
    border-radius: 8px;
    padding: 5px 8px;
    line-height: 1.45;
}

.project-table-dates.is-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.project-table-time-estimate {
    display: inline-flex;
    width: fit-content;
    margin-top: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.35;
}

.project-table-progress-period {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.time-estimate-badge {
    border: 1px solid #d8d2ff;
    background: #f4f0ff;
    color: var(--primary-dark);
}

.gantt-panel {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line);
}

.gantt-header h2 {
    margin: 0 0 5px;
}

.gantt-header p {
    margin: 0;
    color: var(--muted);
}

.gantt-controls {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.gantt-scale-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.gantt-scale-switch a {
    min-width: 88px;
    border-radius: 6px;
    padding: 7px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.gantt-scale-switch a:hover,
.gantt-scale-switch a.is-active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 7px 18px rgba(31, 35, 51, .08);
}

.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    justify-content: flex-end;
    gap: 8px;
    max-width: 420px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.gantt-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gantt-legend i {
    display: inline-block;
    width: 22px;
    height: 8px;
    border-radius: 999px;
}

.gantt-legend-project {
    background: rgba(126, 87, 233, .35);
}

.gantt-legend-module {
    background: rgba(20, 95, 130, .24);
}

.gantt-legend-progress {
    background: #7E57E9;
}

.gantt-legend-today {
    width: 2px !important;
    height: 16px !important;
    background: #ff3b64;
}

.gantt-grid {
    position: relative;
    display: grid;
    gap: 0;
    min-width: 1460px;
    overflow: visible;
}

.gantt-grid-head,
.gantt-row {
    display: grid;
    grid-template-columns: 390px minmax(760px, 1fr) 190px;
}

.gantt-grid-head {
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    background: #fbfcff;
}

.gantt-sidebar-head {
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 14px 18px 14px 22px;
    border-right: 1px solid var(--line);
}

.gantt-sidebar-head small {
    color: var(--muted);
    font-size: 12px;
}

.gantt-timeline-head,
.gantt-timeline-cell {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(226, 232, 240, .45) 0,
            rgba(226, 232, 240, .45) 1px,
            transparent 1px,
            transparent 20%
        );
}

.gantt-timeline-head {
    border-right: 1px solid var(--line);
}

.gantt-axis-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(148, 163, 184, .45);
}

.gantt-axis-tick span {
    position: absolute;
    top: 13px;
    left: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.gantt-today-marker-label {
    position: absolute;
    top: 34px;
    transform: translateX(-50%);
    border-radius: 999px;
    padding: 2px 7px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.gantt-today-line {
    display: none;
}

.gantt-today-cell-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255, 59, 100, .62);
    z-index: 4;
    pointer-events: none;
}

.gantt-row {
    align-items: center;
    min-height: 92px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    position: relative;
}

summary.gantt-row {
    cursor: pointer;
    list-style: none;
}

summary.gantt-row::-webkit-details-marker {
    display: none;
}

.gantt-row:hover {
    background: #fbfaff;
}

.gantt-project-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 12px 18px 12px 22px;
    border-bottom: 1px solid var(--line);
    background: #f4f5f8;
    cursor: pointer;
    list-style: none;
}

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

.gantt-project-summary:hover {
    background: #eef0f4;
}

.gantt-project-summary-main,
.gantt-project-summary-meta {
    display: flex;
    align-items: center;
    min-width: 0;
}

.gantt-project-summary-main {
    flex-wrap: wrap;
    gap: 8px;
}

.gantt-project-summary-main strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.gantt-project-summary-meta {
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.gantt-project-summary-meta small {
    color: var(--primary-dark);
}

.gantt-project-content {
    display: block;
}

.gantt-project-block.is-risk .gantt-project-row {
    background: #f4f5f8;
}

.gantt-project-block.is-risk .gantt-project-summary {
    background: #f4f5f8;
}

.gantt-project-row {
    min-height: 126px;
    background: #f4f5f8;
}

.gantt-module-row {
    min-height: 76px;
    background: #fff;
}

.gantt-module-empty {
    background: #fff;
    color: var(--muted);
}

.gantt-label {
    display: grid;
    align-content: center;
    gap: 8px;
    min-width: 0;
    height: 100%;
    padding: 16px 18px 16px 22px;
    border-right: 1px solid var(--line);
}

.gantt-label strong {
    min-width: 0;
    line-height: 1.25;
}

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

.gantt-label-top,
.gantt-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 7px;
}

.gantt-toggle-indicator {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid var(--primary-dark);
    transition: transform .16s ease;
}

.gantt-project-block[open] .gantt-toggle-indicator {
    transform: rotate(90deg);
}

.gantt-project-link {
    width: fit-content;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
}

.gantt-project-link:hover {
    text-decoration: underline;
}

.gantt-badges .badge,
.gantt-badges .status-pill,
.gantt-badges .topic-pill,
.gantt-badges .project-group-pill,
.gantt-badges .company-pill {
    min-height: 22px;
    padding: 4px 9px;
    font-size: 11px;
    white-space: nowrap;
}

.gantt-badges .project-group-pill {
    white-space: normal;
}

.gantt-module-list .gantt-label {
    padding-left: 52px;
}

.gantt-module-prefix {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gantt-timeline-cell {
    height: 100%;
    border-right: 1px solid var(--line);
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(226, 232, 240, .95);
}

.gantt-bar {
    position: absolute;
    top: 50%;
    min-width: 24px;
    height: 30px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(126, 87, 233, .18);
    box-shadow: inset 0 0 0 1px rgba(126, 87, 233, .22);
    overflow: hidden;
}

.gantt-project-bar {
    height: 34px;
}

.gantt-module-bar {
    height: 24px;
    background: rgba(20, 95, 130, .16);
    box-shadow: inset 0 0 0 1px rgba(20, 95, 130, .18);
}

.gantt-progress {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #7E57E9;
}

.gantt-module-bar .gantt-progress {
    background: #145f82;
}

.gantt-bar-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(15, 23, 42, .22);
}

.gantt-meta {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 7px;
    height: 100%;
    padding: 14px 16px;
    color: var(--muted);
    font-size: 12px;
}

.gantt-meta strong {
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
}

.gantt-meta small {
    font-size: 13px;
}

.gantt-meta > span {
    white-space: nowrap;
}

.gantt-meta .late {
    border-radius: 999px;
    padding: 3px 7px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
}

.gantt-scale-day .gantt-grid-head {
    min-height: 72px;
}

.gantt-scale-day .gantt-axis-tick span {
    top: 14px;
    left: 7px;
    font-size: 11px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    transition: transform .15s ease, border-color .15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: #d6d1ff;
}

.project-card-time-critical {
    border-color: rgba(255, 59, 100, .45);
    box-shadow: 0 18px 42px rgba(255, 59, 100, .12);
    animation: project-time-critical-vibration 5s ease-in-out infinite;
    will-change: translate;
}

@keyframes project-time-critical-vibration {
    0%,
    100% {
        translate: 0 0;
    }

    2% {
        translate: -3px 0;
    }

    4% {
        translate: 3px 0;
    }

    6% {
        translate: -2px 0;
    }

    8% {
        translate: 2px 0;
    }

    10% {
        translate: 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-card-time-critical {
        animation: none;
    }
}

.project-card-compact {
    box-shadow: none;
    margin-bottom: 10px;
}

.project-card-compact .project-card-top {
    display: grid;
}

.project-card-compact .badge {
    justify-self: start;
}

.project-card-compact .priority-badge {
    justify-self: end;
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.project-title-wrap,
.detail-title-row,
.roadmap-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.project-card:not(.project-card-compact) .project-title-wrap {
    align-items: flex-start;
}

.project-card:not(.project-card-compact) .project-title-wrap > .company-logo {
    align-self: flex-start;
}

.project-card h3 {
    margin: 0;
    font-size: 17px;
}

.project-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.project-meta,
.project-card-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.project-meta .user-list {
    max-width: 100%;
}

.project-card-bottom {
    justify-content: flex-start;
    margin-top: -8px;
}

.project-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 5px;
    justify-items: start;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
}

.project-card-id {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7f8fc;
    color: #6f7785;
    font-weight: 700;
    line-height: 1;
}

.project-card-dates {
    display: inline-block;
    border-radius: 6px;
    padding: 2px 6px;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
}

.project-card-dates.is-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.project-detail-id,
.roadmap-project-id {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.project-detail-id {
    margin: 8px 0 0;
}

.badge,
.status-pill,
.blocked-dot,
.topic-pill,
.project-group-pill,
.company-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill {
    color: #fff;
}

.project-group-pill {
    border: 1px solid #d8d2ff;
    background: #f4f0ff;
    color: var(--primary-dark);
    justify-content: center;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.roadmap-priority-rank {
    font-weight: 850;
}

.priority-label-inline {
    display: inline-block;
    line-height: 1;
}

.project-card .priority-badge {
    justify-content: center;
    align-self: start;
    flex: 0 0 52px;
    width: 52px;
    min-width: 52px;
    min-height: 164px;
    padding: 8px 4px;
    text-align: center;
    white-space: normal;
}

.project-card:not(.project-card-compact) .priority-badge.priority-critical {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.08;
}

.project-card-compact .priority-badge {
    flex-basis: auto;
    width: 68px;
    min-width: 68px;
    min-height: 26px;
    padding: 4px 10px;
}

.project-card-compact .priority-badge.priority-critical {
    justify-self: start !important;
    align-self: start;
    width: auto;
    min-width: 96px;
    min-height: 30px;
    padding: 5px 12px;
    white-space: nowrap;
}

.company-logo {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 5px;
    box-shadow: 0 8px 20px rgba(31, 35, 51, .08);
}

.company-logo-large {
    width: 58px;
    height: 58px;
    border-radius: 16px;
}

.company-logo-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.company-logo.company-fragranta,
.company-card.fragranta .company-logo {
    background: var(--fragranta);
}

.company-pill {
    border: 1px solid #dfe5f1;
    background: #f7f9fd;
    color: #3d4656;
}

.company-pill.company-tiger {
    border-color: #b9d1e5;
    background: #edf6fd;
    color: #3d6f99;
}

.company-pill.company-fragranta {
    border-color: #c8d7e2;
    background: #eef5f8;
    color: var(--fragranta);
}

.topic-pill {
    border: 1px solid var(--topic-color);
    background: #fff;
    color: var(--topic-color);
}

.priority-low {
    background: #eef0f4;
    color: #4b5563;
}

.priority-medium {
    background: #fff3bf;
    color: #7a5200;
}

.priority-high {
    background: #ffe0bd;
    color: #92400e;
}

.priority-critical,
.blocked-dot {
    background: #fee2e2;
    color: #991b1b;
}

.archive-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid #c9ced8;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.decision-row,
.activity-row {
    display: grid;
    gap: 3px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

#project-activity-list {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

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

.file-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.file-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f0ecff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
}

.file-icon-image {
    display: block;
    border: 1px solid var(--line);
    background: #fff;
    object-fit: contain;
    padding: 3px;
}

.file-main {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.file-title {
    display: inline-block;
    max-width: 100%;
    color: var(--text);
    font-weight: 850;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.file-title:hover {
    color: var(--primary);
}

.file-main small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.file-main p {
    margin: 6px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.file-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    grid-column: 2;
}

.decision-row em {
    color: var(--warning);
    font-style: normal;
    font-weight: 800;
}

.no-link {
    border-bottom: 1px solid var(--line);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter-bar input[type="search"] {
    flex: 0 0 220px;
}

.filter-bar select {
    flex: 1 1 150px;
}

.filter-bar .topic-filter {
    flex: 0 0 210px;
    min-width: 210px;
}

.filter-bar .button-reset-filter {
    flex: 0 0 210px;
    min-width: 210px;
}

.filter-bar .owner-filter {
    flex-basis: 210px;
    min-width: 210px;
}


.project-result-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    margin: 2px 0 16px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.project-result-count strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}
.filter-bar .sort-filter {
    flex: 0 0 220px;
    min-width: 220px;
}

input,
select,
textarea,
.form-control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.module-description-field {
    min-height: 118px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.inline-check input {
    width: auto;
}

.detail-header .action-row,
.action-row,
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.detail-progress span:first-child {
    display: block;
    margin-bottom: 12px;
    font-size: 34px;
    font-weight: 900;
}

.manual-progress-form {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.manual-progress-form label {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
}

.manual-progress-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px;
    gap: 12px;
    align-items: center;
}

.manual-progress-controls input[type="range"] {
    --manual-progress-position: 0%;
    width: 100%;
    height: 18px;
    appearance: none;
    accent-color: #afafaf;
    background: transparent;
    cursor: pointer;
}

.manual-progress-controls input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        #898989 0%,
        #898989 var(--manual-progress-position),
        #e6e6e6 var(--manual-progress-position),
        #e6e6e6 100%
    );
}

.manual-progress-controls input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -6px;
    appearance: none;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #afafaf;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.manual-progress-controls input[type="range"]::-moz-range-track {
    height: 6px;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    background: #e6e6e6;
}

.manual-progress-controls input[type="range"]::-moz-range-progress {
    height: 6px;
    border: 1px solid #898989;
    border-radius: 999px;
    background: #898989;
}

.manual-progress-controls input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #afafaf;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.manual-progress-number {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.manual-progress-number input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 0;
    font-weight: 900;
    text-align: right;
    background: transparent;
}

.manual-progress-number input:focus {
    outline: 0;
}

.manual-progress-number span {
    font-weight: 800;
    color: var(--muted);
}

.manual-progress-form small {
    color: var(--muted);
    line-height: 1.45;
}

.manual-progress-form.is-disabled {
    opacity: .62;
}

.manual-progress-form.is-disabled input {
    cursor: not-allowed;
}

.detail-meta {
    margin-top: 14px;
}

.detail-owner-row {
    margin-top: 14px;
}

.module-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto minmax(160px, .7fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}

.module-row p {
    margin: 4px 0;
    color: var(--muted);
}

.module-progress {
    display: grid;
    gap: 5px;
}

.module-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.module-panel .module-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.module-description-toggle {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.module-description-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.module-description-text {
    max-height: calc(1.5em * 3);
    overflow: hidden;
}

.module-description-check:checked + .module-description-text {
    max-height: none;
}

.module-description-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.module-description-trigger::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid var(--text);
    transition: transform .16s ease;
}

.module-description-check:checked ~ .module-description-trigger::before {
    transform: rotate(90deg);
}

.module-description-trigger:hover {
    text-decoration: underline;
}

.module-description-trigger .hide-text {
    display: none;
}

.module-description-check:checked ~ .module-description-trigger .show-text {
    display: none;
}

.module-description-check:checked ~ .module-description-trigger .hide-text {
    display: inline;
}

.module-panel .module-progress,
.module-panel .module-actions {
    grid-column: 1 / -1;
}

.module-effort {
    display: inline-flex;
    width: fit-content;
    margin: 8px 0 10px;
    border: 1px solid #d8d2ff;
    border-radius: 999px;
    background: #f4f0ff;
    color: var(--primary-dark);
    padding: 4px 9px;
    font-weight: 800;
}

.module-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.module-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 4px 9px 4px 4px;
}

.module-role-chip > small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.module-role-lead {
    border-color: #d8d2ff;
    background: #fbf9ff;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.timeline-item time,
.timeline-item p,
.module-row small,
.form-field small {
    color: var(--muted);
}

.timeline-item p {
    margin: 6px 0 0;
}

.inline-editor {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.inline-editor summary {
    cursor: pointer;
    font-weight: 800;
}

.stack-form,
.form-panel form {
    display: grid;
    gap: 16px;
}

.form-panel {
    max-width: 900px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    font-weight: 800;
}

.check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    padding: 0;
    list-style: none;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    font-weight: 600;
    cursor: pointer;
}

.check-list label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: 0 8px 18px rgba(126, 87, 233, .12);
}

.check-list input[type="radio"],
.check-list input[type="checkbox"] {
    flex-shrink: 0;
}

.single-user-choice-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.todo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.todo-create-panel {
    position: static;
}

.todo-create-panel .stack-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 18px;
    align-items: start;
    margin-top: 24px;
}

.todo-create-panel .form-field {
    min-width: 0;
}

.todo-create-panel .form-field-title,
.todo-create-panel .form-field-description {
    grid-column: span 2;
}

.todo-create-panel .form-field-title {
    grid-column: 1 / 3;
}

.todo-create-panel .form-field-description {
    grid-column: 3 / 5;
}

.todo-create-panel .form-field-responsible_user {
    grid-column: 1 / 3;
}

.todo-create-panel .form-field-status {
    grid-column: 3 / 4;
}

.todo-create-panel .form-field-priority {
    grid-column: 4 / 5;
}

.todo-create-panel .form-field-responsible_user,
.todo-create-panel .form-field-status,
.todo-create-panel .form-field-priority {
    align-self: start;
    gap: 10px;
}

.todo-create-panel .form-field-responsible_user .single-user-choice-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.todo-create-panel .form-field-responsible_user > small {
    display: block;
    margin-top: 2px;
    line-height: 1.35;
}

.todo-create-panel .form-field-responsible_user .single-user-choice-list label {
    min-height: 64px;
    height: 64px;
}

.todo-create-panel .form-field-responsible_user .single-user-choice-list label:has(input:checked) {
    box-shadow: none;
}

.todo-create-panel .form-field-status select,
.todo-create-panel .form-field-priority select {
    height: 64px;
}

.todo-create-panel .form-field-title {
    align-self: start;
}

.todo-create-panel .form-field-description textarea {
    min-height: 118px;
    resize: vertical;
}

.todo-create-panel .button-primary {
    grid-column: 1 / -1;
}

.todo-create-attachment {
    grid-column: 1 / -1;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: #fbfcff;
    padding: 10px 12px;
}

.todo-create-attachment summary,
.todo-attachment-upload summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.todo-create-attachment summary::before,
.todo-attachment-upload summary::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid currentColor;
}

.todo-create-attachment[open] summary::before,
.todo-attachment-upload[open] summary::before {
    transform: rotate(90deg);
}

.todo-create-attachment summary::-webkit-details-marker,
.todo-attachment-upload summary::-webkit-details-marker {
    display: none;
}

.todo-create-attachment summary::marker,
.todo-attachment-upload summary::marker {
    content: "";
}

.todo-create-attachment-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.todo-create-attachment-fields .form-field-description {
    grid-column: span 3;
}

.todo-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    overflow-x: visible;
    padding-bottom: 0;
}

.todo-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: visible;
}

.todo-column-header {
    position: sticky;
    top: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    background: #fbfcff;
}

.todo-column-header h2 {
    margin: 0;
    font-size: 15px;
}

.todo-column-header strong {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    min-height: 28px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.todo-dropzone {
    display: grid;
    align-content: start;
    gap: 12px;
    flex: 1 1 auto;
    min-height: max(180px, 65vh);
    padding: 12px;
}

.todo-dropzone.is-drag-over {
    background: #f6f3ff;
}

.todo-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(31, 35, 51, .06);
    min-width: 0;
    overflow-wrap: anywhere;
}

.todo-card.todo-priority-low {
    border-color: #e4e7ed;
    background: #f8f9fb;
}

.todo-card.todo-priority-medium {
    border-color: #f5e58a;
    background: #fffde8;
}

.todo-card.todo-priority-high {
    border-color: #f0bf78;
    background: #fff0dd;
}

.todo-card.todo-priority-critical {
    border-color: #fecaca;
    background: #fff1f2;
}

.todo-card[draggable="true"] {
    cursor: grab;
}

.todo-card.is-dragging {
    opacity: .55;
}

.todo-card.is-overdue {
    border-color: #fecaca;
    background: #fffafa;
}

.todo-done-summary {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.todo-done-summary h3 {
    min-width: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
}

.todo-done-toggle {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    padding: 6px 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.todo-column-done .todo-card {
    gap: 10px;
    padding: 10px 12px;
}

.todo-column-done .todo-done-summary {
    display: flex;
}

.todo-column-done .todo-card:not(.is-expanded) > :not(.todo-done-summary) {
    display: none;
}

.todo-column-done .todo-card.is-expanded > h3 {
    display: none;
}

.todo-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.todo-card-top > .badge {
    margin-left: auto;
    white-space: nowrap;
}

.todo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.todo-status-move {
    display: grid;
    flex: 1 1 150px;
    gap: 6px;
    min-width: 0;
}

.todo-status-move label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.todo-status-move select {
    min-height: 38px;
    padding: 7px 34px 7px 10px;
    font-size: 13px;
    font-weight: 750;
}

.todo-action-buttons {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

.todo-action-buttons form {
    margin: 0;
}

.todo-created-meta {
    display: grid;
    justify-items: start;
    flex: 1 1 92px;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.todo-created-meta .user-chip {
    justify-content: flex-start;
}

.mention-highlight {
    color: var(--primary-dark);
    font-weight: 900;
}

.todo-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.todo-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.todo-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.todo-meta-grid > span {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px;
    min-width: 0;
}

.todo-meta-grid small,
.todo-card-top small,
.todo-comment small {
    color: var(--muted);
}

.todo-attachments {
    display: grid;
    gap: 10px;
}

.todo-attachment-upload {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.todo-attachment-upload-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

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

.todo-attachment-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfbff;
    padding: 9px;
    min-width: 0;
}

.todo-attachment-preview {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
}

.todo-attachment-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.todo-attachment-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.todo-attachment-meta a {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.todo-attachment-meta small,
.todo-attachment-meta p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.todo-attachment-row form {
    margin: 0;
}

.todo-comments {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.todo-comment {
    display: grid;
    gap: 3px;
}

.todo-comment-form {
    display: grid;
    gap: 8px;
}

.todo-comment-form textarea {
    min-height: 76px;
    resize: vertical;
}

.todo-empty {
    margin: 0;
    color: var(--muted);
}

.mention-suggestions {
    position: absolute;
    z-index: 50;
    display: none;
    min-width: 220px;
    max-width: 320px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(31, 35, 51, .16);
    overflow: hidden;
}

.mention-suggestions.is-visible {
    display: grid;
}

.mention-suggestion {
    border: 0;
    background: #fff;
    padding: 9px 12px;
    color: var(--text);
    font: inherit;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.mention-suggestion:hover,
.mention-suggestion.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.user-choice-list label {
    justify-content: flex-start;
}

.agency-choice-list label {
    justify-content: flex-start;
}

.check-list input {
    width: auto;
}

.user-choice-list input[type="checkbox"],
.agency-choice-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.user-choice-list label {
    cursor: pointer;
}

.agency-choice-list label {
    cursor: pointer;
}

.user-choice-list label:has(input:checked),
.agency-choice-list label:has(input:checked) {
    border-color: #cfc7ff;
    background: var(--primary-soft);
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--danger);
}

.field-error {
    color: var(--danger) !important;
    font-weight: 700;
}

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

.message {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
}

.message-success {
    border-color: #b8dfcd;
    background: #effaf5;
}

.message-error {
    border-color: #f0b7b7;
    background: #fff1f1;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 32px;
    text-align: center;
}

.topic-summary-grid,
.topic-grid {
    display: grid;
    gap: 14px;
}

.topic-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.topic-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.topic-summary,
.topic-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.topic-summary {
    display: grid;
    gap: 6px;
    padding: 14px;
}

.topic-summary strong {
    font-size: 28px;
}

.section-heading {
    margin: 26px 0 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
}

.user-admin-panel {
    margin-bottom: 22px;
}

.user-admin-list {
    display: grid;
    gap: 10px;
}

.user-admin-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(420px, 2fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.user-admin-row.is-inactive {
    background: #fafafa;
}

.user-admin-main,
.user-admin-roles,
.form-user-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.user-admin-main {
    display: grid;
}

.user-admin-main small,
.form-user-preview span {
    color: var(--muted);
}

.form-user-preview {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
}

.topic-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.agency-card .action-row {
    margin-top: 4px;
    flex-wrap: wrap;
}

.topic-card-header,
.membership-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.topic-members,
.membership-list {
    display: grid;
    gap: 8px;
}

.topic-members span {
    color: var(--muted);
    font-size: 13px;
}

.topic-member-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.membership-row {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.membership-row small,
.date-pair small {
    display: block;
    color: var(--muted);
}

.date-pair {
    display: grid;
    gap: 2px;
    margin-top: 10px;
}

.roadmap-filter {
    max-width: 520px;
}

.project-timeline-panel {
    margin-top: 0;
}

.roadmap-panel {
    overflow-x: auto;
}

.roadmap-scale,
.roadmap-row {
    display: grid;
    grid-template-columns: 260px minmax(360px, 1fr) 150px;
    gap: 18px;
    align-items: center;
}

.roadmap-scale {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
}

.roadmap-scale span:nth-child(2) {
    text-align: center;
}

.roadmap-scale span:nth-child(3) {
    text-align: right;
}

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

.roadmap-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.roadmap-label {
    display: grid;
    gap: 4px;
}

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

.roadmap-track {
    position: relative;
    height: 32px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.roadmap-bar {
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    max-width: 100%;
    border-radius: 999px;
    background: #7E57E9 !important;
    color: #fff;
}

.roadmap-progress-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 3px rgba(31, 35, 51, .32);
}

.roadmap-bar[style="width: 0%;"] + .roadmap-progress-label {
    color: var(--muted);
    text-shadow: none;
}

.roadmap-state {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.brainstorm-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.brainstorm-create-panel {
    position: sticky;
    top: 24px;
}

.brainstorm-form,
.brainstorm-comment-form,
.brainstorm-board {
    display: grid;
    gap: 16px;
}

.brainstorm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brainstorm-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    padding: 7px 11px;
    font-weight: 800;
}

.brainstorm-tab strong {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
}

.brainstorm-tab:hover,
.brainstorm-tab.is-active {
    border-color: rgba(126, 87, 233, .35);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.brainstorm-card {
    display: grid;
    gap: 16px;
}

.brainstorm-card-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.brainstorm-card-header h2 {
    margin: 8px 0 0;
    font-size: 22px;
    line-height: 1.22;
}

.brainstorm-card-tools {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.brainstorm-meta,
.brainstorm-comment-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.brainstorm-description,
.brainstorm-comment p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.brainstorm-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 850;
}

.brainstorm-status-open {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.brainstorm-status-archived {
    background: #f0f1f5;
    color: #5e6270;
}

.brainstorm-status-rejected {
    background: #fff1f6;
    color: #b91c52;
}

.brainstorm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brainstorm-header-actions {
    justify-content: flex-end;
}

.brainstorm-header-actions form {
    margin: 0;
}

.brainstorm-attachments + .brainstorm-actions {
    display: none;
}

.brainstorm-attachments {
    display: grid;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.brainstorm-attachment-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
}

.brainstorm-attachment-header h3 {
    margin: 0;
    font-size: 16px;
}

.brainstorm-attachment-list {
    display: grid;
    gap: 18px;
    margin-top: 8px;
}

.brainstorm-attachment-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    background: #fbfbff;
}

.brainstorm-attachment-preview {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
}

.brainstorm-image-preview {
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 96px;
    height: 96px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.brainstorm-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brainstorm-file-preview-icon {
    display: block;
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    padding: 6px;
}

.brainstorm-attachment-meta {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.brainstorm-attachment-meta small,
.brainstorm-attachment-meta p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.brainstorm-attachment-meta small {
    display: block;
    color: var(--muted);
}

.brainstorm-attachment-meta p {
    margin: 0;
    color: var(--muted);
}

.brainstorm-attachment-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
}

.brainstorm-attachment-actions form {
    display: inline-flex !important;
    margin: 0;
}

.brainstorm-attachment-actions .button {
    width: auto;
}

.brainstorm-attachment-upload {
    display: contents;
}

.brainstorm-attachment-upload[open] {
    display: contents;
}

.brainstorm-upload-trigger {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    justify-self: end;
    align-self: start;
    width: fit-content;
    max-width: max-content;
    min-height: 38px;
    margin-left: auto;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-dark);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 820;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 8px 18px rgba(126, 87, 233, .12);
    user-select: none;
}

.brainstorm-upload-trigger::before {
    content: "";
    width: 0;
    height: 0;
    margin-right: 8px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid currentColor;
}

.brainstorm-attachment-upload[open] .brainstorm-upload-trigger::before {
    transform: rotate(90deg);
}

.brainstorm-upload-trigger:hover {
    background: var(--primary-soft);
}

.brainstorm-upload-trigger::-webkit-details-marker {
    display: none;
}

.brainstorm-upload-trigger::marker {
    content: "";
}

.brainstorm-upload-form {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.brainstorm-comments {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.brainstorm-comments h3 {
    margin: 0;
    font-size: 16px;
}

.brainstorm-comment {
    display: grid;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.brainstorm-comment:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.brainstorm-comment p {
    margin: 0;
}

.brainstorm-comment-form {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.brainstorm-comment-form label {
    font-weight: 800;
}

.late {
    color: var(--danger) !important;
    font-weight: 800;
}

.auth-shell {
    position: relative;
    display: grid;
    min-width: 1180px;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(108, 92, 231, .16), transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(51, 168, 255, .16), transparent 26%),
        var(--bg);
}

.language-switcher-auth {
    position: absolute;
    top: 24px;
    left: 24px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 28px;
}

.brand-auth {
    margin-bottom: 24px;
}

.auth-card h1 {
    margin: 0 0 18px;
}

/* Clarification cases */
.clarification-metrics {
    grid-template-columns: 1.35fr repeat(3, minmax(180px, 1fr));
    margin-bottom: 20px;
}

.clarification-total-card strong {
    color: var(--danger);
}

.clarification-create-panel,
.clarification-list-panel,
.clarification-edit-panel {
    margin-bottom: 20px;
}

.clarification-create-panel .panel-header p,
.clarification-list-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.clarification-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.clarification-form-grid .form-field-title,
.clarification-form-grid .form-field-complaint_reasons {
    grid-column: span 2;
}

.clarification-form-grid .form-field-description {
    grid-column: 1 / -1;
}

.clarification-form-grid .form-field-next_step {
    grid-column: span 2;
}

.clarification-form-grid .clarification-submit {
    grid-column: 1 / -1;
}

.clarification-reason-dropdown {
    width: 100%;
}

.clarification-reason-dropdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-weight: 750;
    list-style: none;
}

.clarification-reason-dropdown summary::-webkit-details-marker {
    display: none;
}

.clarification-reason-dropdown summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .15s ease;
}

.clarification-reason-dropdown[open] summary::after {
    transform: rotate(225deg);
}

.reason-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.reason-choice-list li {
    list-style: none;
}

.reason-choice-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-weight: 750;
}

.reason-choice-list input:checked + span {
    color: var(--primary);
}
.rich-text-source {
    display: none !important;
}

.rich-text-editor {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.rich-text-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.rich-text-button {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.rich-text-button:hover,
.rich-text-button:focus-visible {
    border-color: rgba(126, 87, 233, .42);
    color: var(--primary-dark);
    outline: none;
}

.rich-text-input {
    min-height: 172px;
    padding: 13px 14px;
    color: var(--text);
    line-height: 1.55;
    outline: none;
    overflow-wrap: anywhere;
}

.rich-text-input:focus {
    box-shadow: inset 0 0 0 2px rgba(126, 87, 233, .18);
}

.rich-text-input:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.rich-text-input p,
.rich-text-input div,
.clarification-rich-text p,
.clarification-rich-text div {
    margin: 0 0 9px;
}

.rich-text-input p:last-child,
.rich-text-input div:last-child,
.clarification-rich-text p:last-child,
.clarification-rich-text div:last-child {
    margin-bottom: 0;
}

.clarification-list-header {
    align-items: start;
    gap: 18px;
}

.clarification-tabs {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.clarification-tabs .button {
    gap: 8px;
}

.clarification-tabs .button span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    min-height: 22px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.clarification-tabs .button.is-active {
    border-color: rgba(126, 87, 233, .35);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.clarification-table-wrap {
    overflow: visible;
}

.clarification-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}

.clarification-table th,
.clarification-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.clarification-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .02em;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
}

.clarification-table th:nth-child(1) { width: 84px; }
.clarification-table th:nth-child(2) { width: 112px; }
.clarification-table th:nth-child(3) { width: 122px; }
.clarification-table th:nth-child(4) { width: 145px; }
.clarification-table th:nth-child(5) { width: 160px; }
.clarification-table th:nth-child(6) { width: 120px; }
.clarification-table th:nth-child(8) { width: 145px; }
.clarification-table th:nth-child(9) { width: 150px; }

.clarification-table th:nth-child(2),
.clarification-table td:nth-child(2) {
    white-space: nowrap;
}

.clarification-tracking-form {
    display: grid;
    gap: 7px;
}

.clarification-tracking-form input {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.clarification-tracking-form input:focus {
    outline: 2px solid rgba(126, 87, 233, .18);
    border-color: rgba(126, 87, 233, .45);
}

.clarification-tracking-form input.has-error {
    border-color: rgba(255, 77, 109, .72);
    box-shadow: 0 0 0 3px rgba(255, 77, 109, .12);
}

.clarification-tracking-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.clarification-tracking-save {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
}

.clarification-tracking-links {
    display: grid;
    gap: 4px;
    margin-top: 2px;
}

.clarification-tracking-link {
    display: inline-block;
    max-width: 100%;
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clarification-tracking-link:hover {
    color: var(--primary-dark);
}

.clarification-tracking-status {
    color: var(--muted);
    font-size: 11px;
}

.clarification-tracking-status[data-state="saved"] {
    color: #087350;
}

.clarification-tracking-status[data-state="error"] {
    color: var(--danger);
}

.is-hidden {
    display: none !important;
}

.clarification-rich-text {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.45;
}

.clarification-rich-text strong,
.clarification-rich-text b {
    color: var(--text);
    font-weight: 850;
}

.complaint-reason-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.complaint-reason-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.15;
    white-space: normal;
}

.complaint-reason-damaged-goods {
    background: #ffe2e8;
    color: #a31435;
}

.complaint-reason-missing-goods {
    background: #fff0cf;
    color: #8a5600;
}

.complaint-reason-missing-delivery {
    background: #ece7ff;
    color: #5e3bd6;
}

.complaint-reason-old-goods {
    background: #efe6da;
    color: #744813;
}

.complaint-reason-decoded-goods {
    background: #dff4ff;
    color: #075d7f;
}

.complaint-reason-other-note {
    background: #edf0f5;
    color: #566070;
}

.clarification-row-open {
    background: rgba(255, 252, 245, .7);
}

.clarification-row-resolved {
    background: rgba(245, 247, 251, .65);
}

.clarification-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.clarification-status-open {
    background: #fff3cd;
    color: #815a00;
}

.clarification-status-resolved {
    background: #dff7ee;
    color: #087350;
}

.clarification-actions {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.clarification-actions form {
    margin: 0;
}

.clarification-empty {
    color: var(--muted);
    text-align: center;
}
.nav-divider {
    height: 1px;
    margin: 8px 10px;
    background: var(--line);
}
