@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

:root {
    --bg: #eef2f7;
    --card: #ffffff;
    --line: #d3dbe7;
    --text: #27374d;
    --muted: #64748b;
    --primary: rgb(101, 119, 153);
    --primary-rgb: 101, 119, 153;
    --primary-hover: #576a91;
    --border-soft: #d3deea;
    --surface-soft: #f3f8fd;
    --surface-card: #fbfdff;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Roboto", sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(520px, 92vw);
    background: var(--card);
    border: 1px solid #e5eff5;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    padding: 26px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-logo img {
    height: 44px;
    width: auto;
}

.auth-card h1 {
    margin: 0;
    font-size: 24px;
}

.auth-subtitle {
    margin: 8px 0 16px;
    color: var(--muted);
}

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

.auth-form label {
    font-size: 14px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    font-size: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--primary);
}

.auth-form button,
.ghost-btn {
    margin-top: 8px;
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.auth-form button:hover,
.ghost-btn:hover {
    background: var(--primary-hover);
}

.auth-error {
    background: #fff3f3;
    color: #8b1f1f;
    border: 1px solid #f3d0d0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #dbe6ef;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

.topbar-left img {
    height: 32px;
    width: auto;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-wrap input {
    width: min(320px, 70vw);
    border: 1px solid #d7e2ec;
    background: #f8fbff;
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    font-size: 14px;
}

.search-wrap input:focus {
    border-color: #8aa5c4;
    background: #fff;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    border: 1px solid #d6e1ed;
    background: #fff;
    color: #324d68;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.user-menu-trigger:hover {
    background: var(--surface-soft);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: grid;
    gap: 6px;
    z-index: 20;
}

.user-menu-panel[hidden] {
    display: none !important;
}

.user-menu-email {
    margin: 0;
    font-size: 12px;
    color: #60758b;
    padding: 4px 6px;
    border-bottom: 1px solid #e7eef7;
}

.user-menu-action {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #fff;
    color: #425a74;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.user-menu-action:hover {
    background: var(--surface-soft);
}

.user-menu-panel form {
    margin: 0;
}

.kanban-main {
    padding: 14px;
    overflow-x: auto;
}

.kanban-board {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: calc(100vh - 96px);
}

.kanban-column {
    width: min(340px, calc(100vw - 36px));
    min-width: 300px;
    background: color-mix(in srgb, var(--column-color, #6f8098) 12%, #ffffff);
    border: 1px solid #d9e1ec;
    border-top: 3px solid var(--column-color, #6f8098);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 122px);
    box-shadow: var(--shadow-sm);
}

.column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px 7px;
    border-bottom: 1px solid #e3e8f0;
    gap: 10px;
}

.column-head-main {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.column-head h2 {
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--column-color, #6f8098);
    flex-shrink: 0;
}

.column-count {
    font-size: 12px;
    color: #485b72;
    background: #e8eef6;
    border-radius: 999px;
    padding: 2px 8px;
}

.task-list {
    padding: 8px;
    overflow-y: auto;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-card {
    background: #fff;
    border: 1px solid #d7e1ec;
    border-radius: 9px;
    padding: 9px;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.task-card:hover {
    border-color: #bccfe1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

.task-card.dragging-snapshot {
    transform: rotate(3deg);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.task-card.dragging {
    opacity: 0.01;
}

.task-priority-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 7px;
    margin-bottom: 6px;
    background: #edf1f7;
    color: #43576f;
}

.task-card.priority-urgent .task-priority-chip {
    background: #ffe9e9;
    color: #a32525;
}

.task-card.priority-high .task-priority-chip {
    background: #ffeede;
    color: #a64b17;
}

.task-card.priority-normal .task-priority-chip {
    background: #fff6de;
    color: #9a6b00;
}

.task-card.priority-low .task-priority-chip {
    background: #eaf6ed;
    color: #2f6b40;
}

.task-card h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
}

.task-card p {
    margin: 7px 0 0;
    color: #4e6177;
    font-size: 13px;
    line-height: 1.35;
}

.task-quick-row {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.task-quick-row--with-cover {
    margin-top: 10px;
}

.task-quick-btn {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #000000;
    padding: 2px 3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    line-height: normal;
    cursor: pointer;
}

.task-quick-btn-readonly {
    cursor: default;
}

.task-quick-btn-tag {
    --tag-color: #6f8098;
    background-color: color-mix(in srgb, var(--tag-color) 14%, transparent);
    color: var(--tag-color);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 500;
}

.task-quick-btn-tag:hover {
    color: var(--tag-color);
}

.task-quick-btn:hover {
    background: #edf4fb;
    color: #36526d;
}

.task-quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}

.task-quick-icon-img {
    width: 12px;
    height: 12px;
    display: block;
}

.task-quick-icon-svg {
    width: 12px;
    height: 12px;
    display: block;
}

.task-quick-value {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 14px;
    line-height: 1.3;
}

.task-quick-priority-value {
    transform: translateY(1px);
    margin-bottom: 2px;
}

.task-quick-priority-value.priority-low {
    color: #2f9e44;
}

.task-quick-priority-value.priority-normal {
    color: #9a6b00;
}

.task-quick-priority-value.priority-high {
    color: #c35a14;
}

.task-quick-priority-value.priority-urgent {
    color: #c62828;
}

.task-card-cover {
    margin-top: 8px;
    margin-bottom: -4px;
    border-radius: 6px;
    overflow: hidden;
    height: 120px;
    background: #f1f5f9;
}

.task-card-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-list.drop-target {
    outline: 2px dashed #547ea9;
    outline-offset: -2px;
    border-radius: 8px;
    background: #edf3fb;
}

.add-task-btn {
    margin: 0 8px 8px;
    border: 1px dashed #b9c8d9;
    color: #496683;
    background: #fbfcff;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.add-task-btn:hover {
    border-color: #92aac3;
    background: #f2f7fe;
}

.empty-state {
    margin: auto;
    width: min(800px, 92vw);
    background: #fff;
    border: 1px solid #e0e8f2;
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.empty-state h1 {
    margin-top: 0;
}

.task-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
}

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

.task-modal {
    width: min(760px, 96vw);
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5eff5;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.task-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #e7eff6;
}

.task-modal-head h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close-btn {
    border: 1px solid var(--line);
    background: #fff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--primary);
}

.modal-close-btn:hover {
    background: #f3f7fc;
}

.task-form {
    padding: 14px 16px 16px;
    display: grid;
    gap: 10px;
}

.task-form label {
    font-size: 13px;
    font-weight: 600;
    color: #4d657f;
}

.task-form input,
.task-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.task-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.45;
    font-family: inherit;
}

.task-description-editor {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: #273f59;
    background: #fff;
    overflow-y: auto;
}

.task-description-editor:empty::before {
    content: attr(data-placeholder);
    color: #90a0b2;
}

.task-description-editor ul,
.task-description-editor ol {
    margin: 0 0 0 20px;
}

.task-description-editor p {
    margin: 0;
}

.description-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.desc-format-btn {
    border: 1px solid var(--border-soft);
    background: #fff;
    color: #425a74;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.desc-format-btn:hover {
    background: var(--surface-soft);
}

#task-description-color {
    width: 34px;
    height: 30px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #fff;
    padding: 2px;
}

.task-form input:focus,
.task-form textarea:focus,
.task-description-editor:focus {
    border-color: var(--primary);
    outline: none;
}

.task-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.task-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.task-delete-btn {
    margin-right: auto;
    border-color: #f4c6ca;
    color: #b42318;
    background: #fff6f7;
}

.task-delete-btn:hover {
    background: #ffe9ec;
}

.task-detail-panel {
    border: 1px solid #dde7f2;
    border-radius: 10px;
    background: #fafcff;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.task-detail-panel h3 {
    margin: 0;
    font-size: 14px;
    color: var(--primary);
}

.option-checklist {
    border-top: 1px solid #e5edf6;
    max-height: 220px;
    overflow: auto;
    padding: 7px;
    display: grid;
    gap: 4px;
}

.option-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    border-radius: 8px;
    font-size: 13px;
    color: #3f5771;
    border: 1px solid transparent;
}

.option-check-item:hover {
    background: #f4f8fc;
    border-color: #e1e9f3;
}

.option-check-item span:last-child {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.option-check-item input[type="checkbox"] {
    margin: 0;
}

.option-label-chip {
    --chip-color: #5e698d;
    width: 10px;
    height: 10px;
    background: var(--chip-color);
    border-radius: 50%;
    border: 1px solid #cad8e8;
    flex-shrink: 0;
}

.muted {
    color: #7d8ea3;
}

.timeline-item {
    position: relative;
    padding: 0;
    min-height: 50px;
}

.timeline-item::before {
    display: none;
}

.timeline-item::after {
    display: none;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 0 0 4px #fbfdff;
    position: relative;
}

.timeline-avatar-compact {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin-top: 4px;
    box-shadow: none;
    z-index: 10;
}

.timeline-content {
    flex: 1;
    min-width: 0;
    min-height: 50px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 4px;
    align-items: start;
    padding-top: 0;
}

.comment-meta {
    font-size: 12px;
    color: #60758a;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.comment-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--primary);
    white-space: pre-wrap;
}

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

.comment-form-compact {
    margin-top: 12px;
}

.comment-form-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.comment-input-wrap-compact {
    flex: 1;
    min-width: 0;
}

.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 9px;
    resize: vertical;
    min-height: 82px;
    font-size: 14px;
    outline: none;
}

.comment-textarea-compact {
    padding-right: 40px;
    min-height: 48px;
    border-radius: 12px;
}

.comment-send-btn {
    position: absolute;
    right: 8px;
    bottom: 12px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.comment-send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.comment-send-btn:disabled {
    background: #a6b9cd;
    cursor: not-allowed;
    opacity: 0.7;
}

.comment-form textarea:focus {
    border-color: #90a7c1;
}

.comment-form .primary-btn {
    justify-self: flex-end;
}

.activity-list {
    display: grid;
    gap: 6px;
    align-content: start;
    grid-auto-rows: max-content;
}

.activity-item {
    padding: 0;
    min-height: 50px;
}

.activity-message {
    margin: 0;
    font-size: 13px;
    color: var(--primary);
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
}

.activity-actor {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.activity-message-gap {
    display: inline-block;
    width: 4px;
}

.activity-msg-part {
    display: inline-block;
    vertical-align: middle;
}

.activity-msg-title,
.activity-msg-subtask {
    font-weight: 600;
}

.activity-msg-subtask {
    margin-left: 4px;
}

.activity-meta-stack {
    grid-column: 2;
    grid-row: 1;
    min-width: 112px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.activity-meta {
    margin: 0;
    font-size: 11px;
    color: #8c9fb3;
    min-width: 0;
    align-self: flex-end;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
    margin-top: 0;
}

.activity-comment-body {
    margin-top: 6px;
    padding: 10px 12px;
    background: #f4f8fd;
    border-radius: 8px;
    border: 1px solid #dbe6f1;
    color: var(--primary);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    flex-basis: 100%;
}

.activity-msg-comment-text {
    display: inline;
}

.activity-attachment-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    transform: translateY(1px);
    margin-left: 4px;
    color: var(--primary);
}

.activity-remove-btn {
    border: 1px solid #d6e1ee;
    background: #fff;
    color: #9a1f1f;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.activity-item.activity-remove-ready .activity-remove-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.activity-remove-btn:hover:not(:disabled) {
    background: #fff3f3;
    border-color: #e8b4b4;
}

.activity-remove-btn:disabled {
    cursor: wait;
}

.activity-item.activity-remove-ready .activity-remove-btn:disabled {
    opacity: 0.6;
}

.activity-tag-chip {
    --tag-color: #6f8098;
    display: inline-flex;
    align-items: center;
    background-color: color-mix(in srgb, var(--tag-color) 14%, transparent);
    color: var(--tag-color);
    border-radius: 999px;
    min-height: 24px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 2px 0 4px;
    vertical-align: middle;
    line-height: 1.1;
    transform: translateY(-2px);
}

.activity-tag-chip svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    flex-shrink: 0;
}

.activity-priority-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e1e9f3;
    background: #fff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    vertical-align: middle;
    margin-left: 4px;
    transform: translateY(-2px);
}

.activity-priority-icon-inline {
    width: 14px;
    height: 14px;
    margin-right: 2px;
    flex-shrink: 0;
}

.activity-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #d3e0ee;
    background: #fff;
    color: var(--primary);
    font-size: 12px;
    line-height: 1.1;
    vertical-align: middle;
    margin-left: 4px;
    transform: translateY(-2px);
}

.activity-person-chip-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.activity-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--primary);
    vertical-align: middle;
    padding-left: 5px;
    padding-right: 5px;
}

.activity-group-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--group-dot-color, #43576f);
    transform: translateY(0);
    margin-bottom: 4px;
}

.activity-group-name {
    display: inline-block;
    transform: translateY(0);
    padding-bottom: 5px;
}

.attachment-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

.attachment-item {
    position: relative;
    border: 1px solid #d6e2ef;
    border-radius: 9px;
    background: #fff;
    padding: 4px;
}

.attachment-preview-btn {
    display: block;
    border: 0;
    background: transparent;
    width: 100%;
    padding: 0;
    cursor: zoom-in;
    border-radius: 8px;
    overflow: hidden;
}

.attachment-list li a {
    color: #2d5f97;
    text-decoration: none;
    font-size: 13px;
    word-break: break-word;
}

.attachment-list li a:hover {
    text-decoration: underline;
}

.attachment-thumb {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: cover;
    background: #eef3f9;
    border-radius: 8px;
}

.attachment-file-tile {
    width: 100%;
    height: 72px;
    border-radius: 8px;
    border: 1px dashed #c6d5e5;
    background: #f4f8fd;
    color: #5a738f;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.attachment-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(9, 18, 32, 0.86);
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
}

.attachment-lightbox[hidden] {
    display: none !important;
}

.attachment-lightbox-image {
    max-width: min(1100px, 92vw);
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    background: #0f172a;
}

.attachment-lightbox-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(0, 0, 0, 0.36);
    color: #fff;
    border-radius: 10px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

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

.settings-group-row {
    border: 1px solid #d9e4ef;
    border-radius: 9px;
    background: #fff;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
}

.settings-group-name {
    font-size: 13px;
    color: #324e68;
    font-weight: 600;
}

.settings-group-color {
    width: 34px;
    height: 30px;
    border: 1px solid var(--border-soft);
    border-radius: 7px;
    background: #fff;
    padding: 2px;
}

.settings-group-actions {
    display: flex;
    gap: 6px;
}

.settings-group-btn {
    border: 1px solid var(--border-soft);
    background: #f8fbff;
    color: #425a74;
    border-radius: 8px;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}

.settings-group-btn:hover {
    background: #edf4fb;
}

.settings-group-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.settings-group-btn-text {
    min-width: 58px;
}

.settings-group-btn-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
}

.task-card-quick-menu {
    position: fixed;
    min-width: 220px;
    max-width: min(320px, 92vw);
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
    padding: 8px;
    z-index: 60;
}

.task-card-quick-menu[hidden] {
    display: none !important;
}

.task-quick-menu-loading {
    font-size: 12px;
    color: #6a7f95;
    padding: 6px 4px;
}

.task-quick-menu-section {
    display: grid;
    gap: 6px;
}

.task-quick-menu-title {
    font-size: 12px;
    font-weight: 700;
    color: #415b76;
}

.task-quick-menu-options {
    display: grid;
    gap: 4px;
    max-height: 200px;
    overflow: auto;
}

.task-quick-menu-option {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #425b75;
    padding: 4px 2px;
}

.task-quick-menu-option input[type="checkbox"] {
    margin: 0;
}

.task-quick-menu-dot {
    --dot-color: #5e698d;
    width: 10px;
    height: 10px;
    background: var(--dot-color);
    border-radius: 50%;
    border: 1px solid #ccd8e6;
    flex-shrink: 0;
}

.task-quick-menu-priority-btn {
    border: 1px solid var(--border-soft);
    background: #f8fbff;
    color: #415b75;
    border-radius: 8px;
    font-size: 12px;
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
}

.task-quick-menu-priority-btn.is-active {
    border-color: #8ca8c4;
    background: #eaf3fd;
}

.primary-btn,
.secondary-btn {
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}

.primary-btn {
    background: var(--primary);
    color: #ffffff;
    border: 0;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.primary-btn:disabled {
    background: #a6b9cd;
    cursor: not-allowed;
}

.secondary-btn {
    border: 1px solid #c9d8e7;
    background: #fff;
    color: var(--primary);
}

.secondary-btn:hover {
    background: var(--surface-soft);
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.task-comment-attach-btn-compact {
    padding: 4px 8px;
    font-size: 12px;
}

.task-modal.task-modal-clickup {
    width: 94vw;
    height: min(88vh, 860px);
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-modal-clickup .task-modal-head {
    padding: 8px 10px 0;
    border-bottom: 0;
    justify-content: flex-end;
}

.task-header-title-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 24px;
    font-weight: 700;
    color: #24384f;
    outline: none;
    background: #fff;
}

.task-header-title-input:focus {
    border-color: var(--primary);
}

.task-form.task-form-clickup {
    padding: 4px 16px 16px;
    display: grid;
    gap: 12px;
}

.task-properties-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.task-prop-item {
    display: grid;
    gap: 6px;
}

.task-prop-item > label {
    font-size: 12px;
    font-weight: 700;
    color: #546d86;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.task-prop-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-prop-icon {
    width: 12px;
    height: 12px;
    display: block;
    opacity: 0.75;
}

.task-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.task-inline-dropdown {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.task-inline-dropdown summary {
    list-style: none;
    cursor: pointer;
    padding: 9px 10px;
    font-size: 14px;
    color: #334d67;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.task-inline-dropdown summary::-webkit-details-marker {
    display: none;
}

.task-inline-dropdown summary::after {
    content: "▾";
    margin-left: auto;
    color: #73869b;
}

.task-inline-dropdown[open] {
    border-color: var(--primary);
}

.task-inline-dropdown .option-checklist {
    position: absolute;
    left: -1px;
    right: -1px;
    top: calc(100% + 4px);
    z-index: 8;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-x: hidden;
}

.task-summary-dot {
    --dot-color: #6f8098;
    width: 10px;
    height: 10px;
    background: var(--dot-color);
    border-radius: 999px;
    border: 1px solid #c9d7e8;
    flex-shrink: 0;
}

.task-summary-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-summary-empty {
    color: #60758b;
}

.task-single-option-btn {
    width: 100%;
    border: 1px solid transparent;
    background: #fff;
    color: #334d67;
    border-radius: 8px;
    padding: 8px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.task-single-option-btn:hover {
    background: var(--surface-soft);
}

.task-single-option-btn.is-active {
    border-color: #b8cade;
    background: #edf5fe;
}

.task-multi-option-btn {
    justify-content: flex-start;
}

.task-option-checkbox-wrap {
    width: 16px;
    min-width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-option-checkbox {
    margin: 0;
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.task-priority-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.task-priority-icon--sm {
    width: 12px;
    height: 12px;
}

.task-priority-icon.priority-none { color: #000000; fill: transparent; opacity: 1; }
.task-priority-icon.priority-low { color: #2f9e44; fill: #2f9e44; }
.task-priority-icon.priority-normal { color: #e0a100; fill: #e0a100; }
.task-priority-icon.priority-high { color: #ea6a2a; fill: #ea6a2a; }
.task-priority-icon.priority-urgent { color: #d93025; fill: #d93025; }

.task-quick-row .task-priority-icon.priority-none {
    color: #000000;
    opacity: 1;
}

.task-modal-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 0;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

.task-main-pane,
.task-side-pane {
    min-height: 0;
}

.task-main-pane {
    display: grid;
    gap: 12px;
    padding-right: 10px;
    overflow-y: auto;
    align-content: start;
}

.task-side-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 1px solid #e6edf6;
    background: #fbfdff;
    padding: 10px 12px;
    overflow: hidden;
}

.task-side-pane .task-detail-panel {
    border: 0;
    border-bottom: 1px solid #e6edf6;
    border-radius: 0;
    background: transparent;
    padding: 0 0 12px;
    flex-shrink: 1;
}

.task-side-pane .task-detail-panel:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.task-side-pane .task-detail-panel h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5c728a;
    flex-shrink: 0;
}

.activity-rail-panel {
    flex: 4;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-rail-panel .activity-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.task-main-pane .task-description-editor {
    min-height: 100px;
}

.subtasks-panel, .attachments-panel {
    margin: 0 16px 16px;
}

.subtasks-panel {
    display: grid;
    gap: 8px;
}

.subtasks-list {
    display: grid;
    gap: 6px;
}

.subtask-item {
    border: 1px solid #dbe6f1;
    border-radius: 9px;
    background: #fff;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.subtask-item.is-done .subtask-title-input {
    text-decoration: line-through;
    color: #7c8fa5;
}

.subtask-toggle-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.subtask-title-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 6px 7px;
    font-size: 13px;
    background: #fff;
    outline: none;
}

.subtask-title-input:focus {
    border-color: #90a7c1;
    background: #f8fbff;
}

.subtask-remove-btn {
    border: 1px solid #d6e2ef;
    background: #fff;
    color: #6b7f95;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.subtask-remove-btn:hover {
    border-color: #c2d4e7;
    background: #f2f7fd;
    color: #3f5e7d;
}

.task-option-checkmark {
    width: 14px;
    min-width: 14px;
    text-align: center;
    color: #2e5f91;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    display: inline-block;
    visibility: hidden;
}

.task-single-option-btn.is-active .task-option-checkmark,
.task-multi-option-btn.is-active .task-option-checkmark {
    visibility: visible;
}

.assignee-option-btn span:last-child,
.label-option-btn span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-remove-btn {
    position: absolute;
    right: -5px;
    top: -5px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid #ccd8e5;
    background: #fff;
    color: #556f89;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.attachment-remove-btn:hover {
    background: var(--surface-soft);
    color: #2f4f70;
}

.subtask-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.subtask-form input[type="text"] {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    background: #fff;
}

.subtask-form input[type="text"]:focus {
    border-color: var(--primary);
}

.confirm-modal {
    width: min(360px, 90vw);
}

.confirm-modal-body {
    padding: 10px 12px 12px;
    display: grid;
    gap: 10px;
}

.confirm-modal-body p {
    margin: 0;
    font-size: 14px;
    color: var(--primary);
}

.confirm-modal-body p[hidden] {
    display: none !important;
}

.confirm-modal.confirm-modal-compact .confirm-modal-body {
    padding-top: 8px;
    gap: 8px;
}

.settings-modal {
    width: min(900px, 96vw);
}

.settings-modal-body {
    padding: 14px 16px 16px;
    display: grid;
    gap: 14px;
}

.settings-section {
    border: 1px solid #d9e4ef;
    border-radius: 10px;
    background: #fbfdff;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.settings-section h3 {
    margin: 0;
    font-size: 15px;
    color: var(--primary);
}

.settings-entity-list {
    display: grid;
    gap: 7px;
}

.settings-entity-row {
    border: 1px solid #d9e4ef;
    border-radius: 9px;
    background: #fff;
    padding: 8px;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 8px;
    align-items: center;
}

.settings-entity-chip {
    --chip-color: #5e698d;
    width: 11px;
    height: 11px;
    background: var(--chip-color);
    border-radius: 50%;
    border: 1px solid #ccd8e6;
}

.settings-entity-name {
    font-size: 13px;
    color: #324e68;
    font-weight: 600;
}

.settings-entity-meta {
    font-size: 12px;
    color: #5b748d;
}

.settings-entity-state {
    font-size: 11px;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid #d0dde9;
}

.settings-entity-state.is-active {
    color: #22553a;
    background: #eaf6ef;
    border-color: #c6e3cf;
}

.settings-entity-state.is-inactive {
    color: #6f7f91;
    background: #f3f6fa;
    border-color: #dde5ee;
}

.settings-entity-btn {
    border: 1px solid var(--border-soft);
    background: #fff;
    color: #425a74;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.settings-entity-btn:hover {
    background: var(--surface-soft);
}

.settings-inline-form {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 8px;
    align-items: center;
}

.settings-inline-form-spaced {
    margin-top: 12px;
}

.settings-inline-form input[type="text"],
.settings-inline-form input[type="email"],
.settings-inline-form input[type="password"] {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.settings-inline-form input[type="text"]:focus,
.settings-inline-form input[type="email"]:focus,
.settings-inline-form input[type="password"]:focus {
    border-color: var(--primary);
}

.settings-inline-form input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #fff;
    padding: 3px;
}

.settings-user-form {
    grid-template-columns: 1fr 1fr 1fr auto auto auto;
}

.settings-user-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #49627d;
    padding: 0 4px;
}

@media (max-width: 768px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-wrap input {
        width: 100%;
    }

    .task-form-row {
        grid-template-columns: 1fr;
    }

    .settings-group-row {
        grid-template-columns: 1fr auto;
    }

    .settings-group-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }

    .task-properties-grid {
        grid-template-columns: 1fr 1fr;
    }

    .task-modal-layout {
        grid-template-columns: 1fr;
    }

    .task-main-pane {
        padding-right: 0;
    }

    .task-side-pane {
        display: none;
    }

    .subtask-form {
        grid-template-columns: 1fr;
    }

    .settings-entity-row {
        grid-template-columns: auto 1fr auto;
    }

    .settings-entity-meta,
    .settings-entity-state {
        grid-column: span 3;
    }

    .settings-inline-form,
    .settings-user-form {
        grid-template-columns: 1fr;
    }
}
