:root {
    --tf-font-body: 'DM Sans', sans-serif;
    --tf-font-heading: 'Bricolage Grotesque', sans-serif;
    --tf-primary: #4f63ff;
    --tf-primary-dark: #3f52ec;
    --tf-primary-soft: #eef0ff;
    --tf-primary-border: rgba(79, 99, 255, 0.18);
    --tf-accent: #00cfff;
    --tf-success: #00c97a;
    --tf-warning: #d97706;
    --tf-danger: #ef4444;
    --tf-ink: #1a1d2e;
    --tf-muted: #6b7280;
    --tf-border: #e6ecf5;
    --tf-border-strong: #d7dfed;
    --tf-surface: #ffffff;
    --tf-surface-soft: #f8fbff;
    --tf-sidebar: #162033;
    --tf-sidebar-soft: #1e2b44;
    --tf-sidebar-text: #d9e4ff;
    --tf-sidebar-active: linear-gradient(135deg, #4f63ff, #7384ff);
    --tf-shadow-sm: 0 10px 24px rgba(79, 99, 255, 0.08);
    --tf-shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
    --tf-shadow-lg: 0 28px 70px rgba(79, 99, 255, 0.18);
    --bs-primary: var(--tf-primary);
}

.tfd-card-description figure,
.tfd-card-description img {
    display: none;
}

.tfd-card-description {
    max-height: 88px;
    overflow: hidden;
}

.tfd-assign-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid #e6ebf5;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8faff, #ffffff);
}

.tfd-assign-form:has(.js-assign-department) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.tfd-assign-field {
    min-width: 0;
    margin: 0;
}

.tfd-assign-field span {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}

.tfd-assign-field .form-select {
    min-height: 34px;
    border-radius: 10px;
    border-color: #dbe4f0;
    font-size: 12px;
    box-shadow: none;
}

.tfd-assign-submit {
    width: 36px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #4f63ff, #818cf8);
    box-shadow: 0 8px 18px rgba(79, 99, 255, .24);
}

.tfd-assign-submit:hover {
    transform: translateY(-1px);
}

.tfd-exp-actions .tfd-btn-primary,
.tfd-exp-actions .tfd-btn-ghost {
    min-height: 34px;
    padding: 7px 11px;
}

@media (max-width: 575px) {
    .tfd-assign-form,
    .tfd-assign-form:has(.js-assign-department) {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .tfd-assign-field:has(.js-assign-department) {
        grid-column: 1 / -1;
    }
}

/* Task comments */
.task-comments-body {
    background: #fff;
}

.jira-comment-editor {
    color: #172b4d;
}

.jira-editor-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #172b4d;
}

.jira-editor-shell {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.jira-editor-tabs {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border-bottom: 1px solid #d0d7de;
}

.jira-editor-tabs span {
    padding: 12px 22px;
    font-weight: 700;
    color: #5e6c84;
}

.jira-editor-tabs .active {
    background: #fff;
    color: #172b4d;
    border-right: 1px solid #d0d7de;
}

.jira-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 10px 18px;
    color: #6b778c;
    border-bottom: 1px solid #edf0f4;
    font-size: 17px;
}

.jira-editor-input {
    width: 100%;
    min-height: 60px;
    height: 20px;
    border: 0;
    resize: vertical;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #172b4d;
    background: #fff;
    outline: none;
}

.jira-editor-input:focus {
    box-shadow: inset 0 0 0 2px #0c66e4;
}

.jira-editor-shell .ck.ck-toolbar {
    border: 0;
    border-bottom: 1px solid #edf0f4;
    background: #f7f8fa;
}

.jira-editor-shell .ck.ck-editor__main > .ck-editor__editable,
.jira-inline-editor .ck.ck-editor__main > .ck-editor__editable {
    /* min-height: 130px; */
    border: 0;
    color: #172b4d;
    box-shadow: none;
}

.jira-inline-editor .ck.ck-toolbar {
    border: 0;
    border-bottom: 1px solid #edf0f4;
    background: #f7f8fa;
}

.jira-inline-editor .ck.ck-editor__main > .ck-editor__editable {
    min-height: 92px;
}

.jira-editor-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid #edf0f4;
    color: #44546f;
    font-size: 13px;
    font-weight: 700;
}

.jira-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px 12px;
}

.jira-file-preview:empty {
    display: none;
}

.jira-file-preview-item {
    display: flex;
    flex-direction: column;
    width: 138px;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}

.jira-file-preview-item img {
    width: 100%;
    height: 86px;
    object-fit: cover;
    display: block;
}

.jira-file-preview-item span {
    display: block;
    padding: 6px 8px;
    color: #172b4d;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jira-file-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    cursor: pointer;
    color: #0c66e4;
    font-weight: 800;
}

.jira-comment-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.jira-comment-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
}

.jira-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #deebff;
    color: #0747a6;
    font-size: 15px;
    font-weight: 900;
}

.jira-comment-content {
    min-width: 0;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.jira-comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #44546f;
    font-size: 13px;
    margin-bottom: 9px;
}

.jira-comment-meta strong {
    color: #172b4d;
    font-size: 14px;
}

.jira-comment-meta span {
    margin-left: 8px;
    color: #6b778c;
}

.jira-comment-meta time {
    white-space: nowrap;
}

.jira-comment-text {
    color: #172b4d;
    font-size: 14px;
    line-height: 1.65;
}

.jira-comment-text p,
.jira-comment-text ul,
.jira-comment-text ol,
.jira-comment-text blockquote,
.jira-comment-text pre {
    margin-bottom: 10px;
}

.jira-comment-text :last-child {
    margin-bottom: 0;
}

.jira-comment-text blockquote {
    border-left: 3px solid #dfe1e6;
    color: #44546f;
    padding-left: 12px;
}

.jira-comment-text code {
    background: #f4f5f7;
    border-radius: 4px;
    padding: 2px 5px;
}

.jira-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.jira-attachment-card {
    display: flex;
    flex-direction: column;
    width: 156px;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    overflow: hidden;
    color: #172b4d;
    text-decoration: none;
    background: #fafbfc;
}

.jira-attachment-card img {
    width: 100%;
    height: 98px;
    object-fit: cover;
    display: block;
}

.jira-attachment-card span {
    display: block;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jira-comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    color: #6b778c;
    font-size: 12px;
}

.jira-action-btn {
    border: 0;
    background: transparent;
    color: #0c66e4;
    font-weight: 800;
    padding: 0;
    cursor: pointer;
}

.jira-inline-editor {
    margin-top: 12px;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    overflow: hidden;
}

.jira-inline-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
}

.jira-replies {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    padding-left: 18px;
    border-left: 2px solid #dfe1e6;
}

.jira-reply-card {
    grid-template-columns: 34px minmax(0, 1fr);
}

.jira-reply-card .jira-comment-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
    background: #e3fcef;
    color: #006644;
}

@media (max-width: 575.98px) {
    .jira-comment-card {
        grid-template-columns: 1fr;
    }

    .jira-comment-avatar {
        display: none;
    }

    .jira-comment-meta {
        flex-direction: column;
        gap: 3px;
    }

    .jira-replies {
        padding-left: 10px;
    }
}

/* Unified comments UI for dashboard modal and task view */
body .tfd-msec-warn,
body .ts-section.ts-section-warn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body .tfd-msec-warn .tfd-msec-label,
body .ts-section.ts-section-warn .ts-section-header {
    min-height: 46px;
    padding: 13px 20px;
    background: #fffdf5;
    border-bottom: 1px solid #e5e7eb;
    color: #9a3412;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

body .tfd-msec-count,
body .ts-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    margin-left: 4px;
    border-radius: 999px;
    background: #fde68a;
    color: #9a3412;
    font-size: 11px;
    font-weight: 800;
}

body .tfd-msec-warn .tfd-msec-body,
body .ts-section.ts-section-warn .ts-section-body {
    padding: 18px 20px 20px;
    background: #fff;
}

body .task-comments-body .jira-comment-editor {
    margin-bottom: 28px;
}

body .task-comments-body .jira-editor-shell,
body .task-comments-body .jira-inline-editor {
    border: 1px solid #dfe7f1;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}

body .task-comments-body .jira-editor-input {
    min-height: 68px;
    height: auto;
    padding: 14px 15px;
    color: #111827;
    font-size: 13px;
    line-height: 1.6;
}

body .task-comments-body .jira-editor-input::placeholder {
    color: #94a3b8;
}

body .task-comments-body .jira-editor-shell .ck.ck-toolbar,
body .task-comments-body .jira-inline-editor .ck.ck-toolbar {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #fbfcff;
}

body .task-comments-body .jira-editor-shell .ck.ck-editor__main > .ck-editor__editable,
body .task-comments-body .jira-inline-editor .ck.ck-editor__main > .ck-editor__editable {
    min-height: 70px;
    padding: 13px 15px;
    border: 0;
    box-shadow: none;
}

body .task-comments-body .jira-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-top: 1px solid #eef2f7;
    background: #fbfcff;
    color: #8a97ab;
    font-size: 12px;
    font-weight: 500;
}

body .task-comments-body .jira-file-trigger {
    color: #475569;
    font-weight: 600;
}

body .task-comments-body .ts-btn-primary {
    min-height: 30px;
    padding: 7px 17px;
    border-radius: 6px;
    background: #4f63ff;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: none;
}

body .task-comments-body .jira-comment-list {
    gap: 0;
}

body .task-comments-body .jira-comment-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 11px;
    padding: 16px 0;
    border-top: 1px solid #edf2f7;
}

body .task-comments-body .jira-comment-list > .jira-comment-card:first-child {
    border-top: 0;
    padding-top: 4px;
}

body .task-comments-body .jira-comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #4f63ff;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

body .task-comments-body .jira-comment-card:nth-of-type(2n) > .jira-comment-avatar {
    background: #f59e0b;
}

body .task-comments-body .jira-comment-card:nth-of-type(3n) > .jira-comment-avatar {
    background: #8b5cf6;
}

body .task-comments-body .jira-comment-content {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body .task-comments-body .jira-comment-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 12px;
}

body .task-comments-body .jira-comment-meta strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

body .task-comments-body .jira-comment-meta span {
    color: #94a3b8;
    font-size: 11px;
}

body .task-comments-body .jira-comment-meta time {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

body .task-comments-body .jira-comment-text {
    color: #020617;
    font-size: 13px;
    line-height: 1.65;
}

body .task-comments-body .jira-comment-actions {
    gap: 14px;
    margin-top: 9px;
    color: #94a3b8;
    font-size: 12px;
}

body .task-comments-body .jira-action-btn {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

body .task-comments-body .jira-action-btn.text-danger,
body .task-comments-body .text-danger.jira-action-btn {
    color: #ef4444 !important;
}

body .task-comments-body .jira-replies {
    gap: 0;
    margin-top: 14px;
    padding-left: 16px;
    border-left: 1px solid #dfe7f1;
}

body .task-comments-body .jira-reply-card {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 12px 0 0;
    margin: 0;
    border-top: 0;
}

body .task-comments-body .jira-reply-card .jira-comment-avatar {
    width: 24px;
    height: 24px;
    background: #10b981;
    font-size: 10px;
}

body .task-comments-body .jira-attachments,
body .task-comments-body .jira-file-preview {
    gap: 10px;
    margin-top: 10px;
}

body .task-comments-body .jira-attachment-card,
body .task-comments-body .jira-file-preview-item {
    display: flex;
    flex-direction: column;
    width: 132px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

body .task-comments-body .jira-attachment-card img,
body .task-comments-body .jira-file-preview-item img {
    width: 100%;
    height: 78px;
    object-fit: cover;
}

body .task-comments-body .jira-attachment-card span,
body .task-comments-body .jira-file-preview-item span {
    display: block;
    padding: 6px 8px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    body .task-comments-body .jira-comment-card {
        grid-template-columns: 1fr;
    }

    body .task-comments-body .jira-comment-avatar {
        display: none;
    }

    body .task-comments-body .jira-comment-meta {
        flex-direction: column;
        gap: 2px;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    font-family: var(--tf-font-body);
    color: var(--tf-ink);
    background: linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
}

body {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-name,
.admin-surface-title,
.admin-table-title,
.tf-stat-num,
.tf-board-title h3,
.uf-title,
.rf-title,
.brand-lockup-title {
    font-family: var(--tf-font-heading);
    letter-spacing: -0.03em;
}

a {
    color: var(--tf-primary);
    text-decoration: none;
}

a:hover {
    color: var(--tf-primary-dark);
}

.d-none {
    display: none !important;
}

.app-content {
    background:
        radial-gradient(circle at top right, rgba(79, 99, 255, 0.07), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #f2f7fb 100%);
    min-height: calc(100vh - 7rem);
}

.app-header.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(79, 99, 255, 0.08);
}

.app-header .nav-link,
.app-content-header h3,
.breadcrumb-item,
.breadcrumb-item a {
    color: var(--tf-ink);
}

.app-sidebar {
    background:
        radial-gradient(circle at top left, rgba(79, 99, 255, 0.2), transparent 30%),
        linear-gradient(180deg, var(--tf-sidebar) 0%, #11192a 100%) !important;
    color: var(--tf-sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    padding: 1.35rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-ico {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tf-primary), #7b8aff);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 12px 30px rgba(79, 99, 255, 0.34);
}

.brand-lockup {
    display: grid;
    gap: 0.15rem;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #707288;
}

.brand-name b {
    color: #6d7bff;
}

.brand-sub {
    font-size: 14px;
    color: rgba(72, 78, 94, 0.72);
    font-weight: 600;
}

.sidebar-menu .nav-header {
    margin-top: 1rem;
    color: rgba(217, 228, 255, 0.5);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.sidebar-menu .nav-link {
    margin: 0.18rem 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    color: rgba(217, 228, 255, 0.86);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-menu .nav-link.active {
    background: var(--tf-sidebar-active);
    color: #fff;
    box-shadow: 0 10px 24px rgba(79, 99, 255, 0.22);
}

.sidebar-menu .nav-link .nav-icon {
    color: currentColor;
}

/* Mini sidebar: icon-only close state + module name on icon hover */
body.sidebar-mini.sidebar-collapse .app-sidebar,
body.sidebar-mini.sidebar-collapse .app-sidebar:hover {
    min-width: 4.75rem;
    max-width: 4.75rem;
    overflow: visible;
    z-index: 1040;
}

body.sidebar-mini.sidebar-collapse .sidebar-brand {
    padding: 1rem 0.65rem;
}

body.sidebar-mini.sidebar-collapse .brand {
    justify-content: center;
    gap: 0;
}

body.sidebar-mini.sidebar-collapse .brand-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 1.1rem;
}

body.sidebar-mini.sidebar-collapse .brand-lockup,
body.sidebar-mini.sidebar-collapse .app-sidebar:hover .brand-lockup {
    width: 0;
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

body.sidebar-mini.sidebar-collapse .sidebar-wrapper,
body.sidebar-mini.sidebar-collapse .sidebar-wrapper nav,
body.sidebar-mini.sidebar-collapse .sidebar-menu,
body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-item {
    overflow: visible;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link,
body.sidebar-mini.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-link {
    position: relative;
    width: 3.55rem;
    min-height: 3.25rem;
    margin: 0.22rem auto;
    padding: 0;
    justify-content: center;
    border-radius: 1rem;
    transform: none;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link .nav-icon,
body.sidebar-mini.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-link .nav-icon {
    width: auto;
    margin: 0;
    font-size: 1.16rem;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link p,
body.sidebar-mini.sidebar-collapse .app-sidebar:hover .sidebar-menu .nav-link p {
    display: inline-block;
    width: 0;
    max-width: 0;
    padding-left: 0;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link::after {
    content: attr(data-menu-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    z-index: 1100;
    transform: translateY(-50%) translateX(-6px);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: 0.52rem 0.72rem;
    border-radius: 0.78rem;
    background: #111827;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link::before {
    content: '';
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    z-index: 1101;
    transform: translateY(-50%) translateX(-6px);
    opacity: 0;
    pointer-events: none;
    border: 7px solid transparent;
    border-right-color: #111827;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link:hover::after,
body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link:hover::before,
body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link:focus::after,
body.sidebar-mini.sidebar-collapse .sidebar-menu .nav-link:focus::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

body:not(.sidebar-collapse) .sidebar-menu .nav-link::before,
body:not(.sidebar-collapse) .sidebar-menu .nav-link::after {
    display: none;
}

.alert {
    border: 1px solid transparent;
    border-radius: 1rem;
    box-shadow: var(--tf-shadow-sm);
}

.alert-success {
    background: #f0fdf8;
    color: #15803d;
    border-color: #bbf7d0;
}

.btn {
    border-radius: 0.95rem;
    font-weight: 700;
    font-family: var(--tf-font-body);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.admin-btn-primary,
.uf-btn-primary,
.rf-btn-primary,
.btn-s {
    background: linear-gradient(135deg, var(--tf-primary), #6d7bff) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(79, 99, 255, 0.28);
    font-weight: 600;
    border-radius: 8px;
    padding: 0 20px;
}

.btn-primary:hover,
.admin-btn-primary:hover,
.uf-btn-primary:hover,
.rf-btn-primary:hover,
.btn-s:hover {
    box-shadow: 0 14px 32px rgba(79, 99, 255, 0.36);
}

.btn-outline-primary {
    color: var(--tf-primary);
    border-color: rgba(79, 99, 255, 0.3);
    background: #fff;
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--tf-primary);
    border-color: var(--tf-primary);
}

.btn-outline-secondary {
    color: #536178;
    border-color: #d7dfed;
    background: #fff;
}

.btn-outline-secondary:hover {
    color: var(--tf-ink);
    background: #f4f7fb;
    border-color: #bac7db;
}

.btn-outline-danger {
    color: var(--tf-danger);
    border-color: rgba(239, 68, 68, 0.28);
    background: #fff;
}

.btn-outline-danger:hover {
    color: #fff;
    background: var(--tf-danger);
    border-color: var(--tf-danger);
}

.btn-sm {
    padding: 0.52rem 0.9rem;
    border-radius: 0.8rem;
}

.form-control,
.form-select,
.admin-input,
.admin-select,
.admin-textarea,
.uf-input,
.rf-input {
    width: 100%;
    border: 1.5px solid var(--tf-border-strong);
    border-radius: 1rem;
    background: #f8fbff;
    color: var(--tf-ink);
    font-family: var(--tf-font-body);
    min-height: 52px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control,
.form-select,
.admin-input,
.admin-select {
    padding: 0.85rem 1rem;
}

.admin-textarea {
    /* min-height: 128px; */
    padding: 0.95rem 1rem;
    resize: vertical;
}

.form-control:focus,
.form-select:focus,
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus,
.uf-input:focus,
.rf-input:focus,
.tf-filter-select:focus {
    background: #fff;
    border-color: rgba(79, 99, 255, 0.48);
    box-shadow: 0 0 0 0.2rem rgba(79, 99, 255, 0.12);
    outline: 0;
}

.table {
    --bs-table-bg: transparent;
}

.admin-table-card,
.admin-surface,
.uf-shell,
.rf-shell,
.tf-stat,
.tf-col,
.tf-modal-content {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(79, 99, 255, 0.1);
    box-shadow: var(--tf-shadow-md);
}

.admin-page-shell {
    display: grid;
    gap: 1.5rem;
}

.admin-surface,
.admin-table-card,
.uf-shell,
.rf-shell {
    border-radius: 1.6rem;
    overflow: hidden;
}

.admin-surface-header,
.admin-table-header,
.uf-header,
.rf-header {
    padding: 1.5rem 1.65rem;
    border-bottom: 1px solid var(--tf-border);
    background: linear-gradient(135deg, #f6f8ff 0%, #ffffff 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-surface-title,
.admin-table-title,
.uf-title,
.rf-title {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--tf-ink);
}

.admin-surface-subtitle,
.admin-table-subtitle,
.uf-subtitle,
.rf-subtitle {
    margin: 0.35rem 0 0;
    color: var(--tf-muted);
    font-size: 0.92rem;
}

.admin-surface-body,
.uf-body,
.rf-body {
    padding: 1.5rem 1.65rem 1.7rem;
}

.admin-form-grid {
    display: grid;
    gap: 1.2rem;
}

.admin-form-row {
    display: grid;
    /* grid-template-columns: repeat(12, minmax(0, 1fr)); */
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.admin-col-3 {
    grid-column: span 3;
}

.admin-col-4 {
    grid-column: span 4;
}

.admin-col-6 {
    grid-column: span 6;
}

.admin-col-8 {
    grid-column: span 8;
}

.admin-col-12 {
    grid-column: span 12;
}

.admin-field-label,
.uf-label,
.rf-label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-field-label.required::after,
.uf-label.required::after,
.rf-label.required::after {
    content: " *";
    color: var(--tf-danger);
}

.admin-helper,
.uf-hint,
.rf-hint {
    color: #94a3b8;
    font-size: 0.82rem;
}

.admin-actions,
.uf-actions,
.rf-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--tf-border);
}

.admin-btn-secondary,
.uf-btn-ghost,
.rf-btn-ghost {
    padding: 0.82rem 1.2rem;
}

.admin-data-table {
    margin-bottom: 0;
}

.admin-data-table thead th {
    padding: 1rem 1.15rem;
    background: #f8fbff;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--tf-border);
    white-space: nowrap;
}

.admin-data-table tbody td {
    /* padding: 1rem 1.15rem; */
    vertical-align: middle;
    border-color: #eef3f8;
}

.admin-data-table tbody tr:hover {
    background: #fbfdff;
}

.badge,
.admin-badge-soft {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.48rem 0.8rem;
}

.login-screen {
    overflow: hidden;
}

.login-screen .page {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eceffe 0%, #f3f6ff 45%, #e6faf4 100%);
    overflow: hidden;
}

.login-screen .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.login-screen .b1 {
    width: 700px;
    height: 700px;
    background: rgba(79, 99, 255, 0.1);
    top: -200px;
    left: -150px;
}

.login-screen .b2 {
    width: 550px;
    height: 550px;
    background: rgba(0, 207, 255, 0.09);
    bottom: -120px;
    right: -100px;
}

.login-screen .b3 {
    width: 400px;
    height: 400px;
    background: rgba(0, 201, 122, 0.08);
    top: 25%;
    right: 10%;
}

.login-screen .dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(79, 99, 255, 0.1) 1.2px, transparent 1.2px);
    background-size: 28px 28px;
    pointer-events: none;
}

@keyframes tf-float {

    0%,
    100% {
        transform: translateY(0) rotate(var(--r, 0deg));
    }

    50% {
        transform: translateY(-12px) rotate(var(--r2, 0deg));
    }
}

.login-screen .pill,
.login-screen .sbadge,
.login-screen .pcard,
.login-screen .emo {
    position: absolute;
    pointer-events: none;
    animation: tf-float ease-in-out infinite;
}

.login-screen .pill {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(79, 99, 255, 0.13);
    border-radius: 999px;
    padding: 9px 16px 9px 9px;
    color: var(--tf-ink);
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: var(--tf-shadow-sm);
    --r: -1deg;
    --r2: 1.5deg;
}

.login-screen .pill-ico,
.login-screen .pill-ck {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-screen .pill-ck {
    border: 2px solid;
    border-radius: 8px;
    font-size: 10px;
}

.login-screen .p1 {
    top: 9%;
    left: 5%;
    animation-duration: 6.5s;
}

.login-screen .p2 {
    top: 20%;
    right: 6%;
    animation-duration: 7.5s;
    animation-delay: 1s;
}

.login-screen .p3 {
    top: 52%;
    left: 2%;
    animation-duration: 8s;
    animation-delay: 2s;
}

.login-screen .p4 {
    bottom: 18%;
    left: 9%;
    animation-duration: 7s;
    animation-delay: .5s;
}

.login-screen .p5 {
    bottom: 22%;
    right: 5%;
    animation-duration: 6s;
    animation-delay: 1.8s;
}

.login-screen .p6 {
    top: 36%;
    right: 4%;
    animation-duration: 9s;
    animation-delay: 3s;
}

.login-screen .sbadge,
.login-screen .pcard {
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(79, 99, 255, 0.12);
    box-shadow: var(--tf-shadow-sm);
}

.login-screen .sbadge {
    border-radius: 20px;
    padding: 14px 20px;
    --r: -2deg;
    --r2: 1deg;
}

.login-screen .sb-val {
    font-family: var(--tf-font-heading);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.login-screen .sb-lbl,
.login-screen .pinfo {
    color: var(--tf-muted);
    font-size: 11px;
}

.login-screen .sb1 {
    top: 14%;
    left: 20%;
    animation-duration: 8s;
    animation-delay: .8s;
}

.login-screen .sb2 {
    bottom: 18%;
    right: 20%;
    animation-duration: 7.5s;
    animation-delay: 2.2s;
}

.login-screen .pcard {
    width: 195px;
    border-radius: 16px;
    padding: 14px 18px;
    --r: 1deg;
    --r2: -1deg;
}

.login-screen .pct {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.login-screen .pct-name {
    font-size: 11.5px;
    font-weight: 700;
}

.login-screen .pct-num {
    font-family: var(--tf-font-heading);
    font-size: 13px;
    font-weight: 800;
}

.login-screen .pbar {
    height: 5px;
    border-radius: 999px;
    background: #eef0ff;
    overflow: hidden;
    margin-bottom: 7px;
}

.login-screen .pfill {
    height: 100%;
    border-radius: inherit;
}

.login-screen .pc1 {
    top: 28%;
    left: 5%;
    animation-duration: 9s;
    animation-delay: 1s;
}

.login-screen .pc2 {
    bottom: 26%;
    right: 5%;
    animation-duration: 8.5s;
    animation-delay: 2.8s;
}

.login-screen .emo {
    filter: drop-shadow(0 4px 10px rgba(79, 99, 255, 0.15));
    opacity: 0.65;
}

.login-screen .e1 {
    top: 4%;
    right: 22%;
    font-size: 30px;
    animation-duration: 7s;
}

.login-screen .e2 {
    bottom: 7%;
    left: 22%;
    font-size: 30px;
    animation-duration: 8s;
    animation-delay: 2s;
}

.login-screen .e3 {
    top: 45%;
    left: 17%;
    font-size: 22px;
    animation-duration: 6.5s;
    animation-delay: 3.5s;
    opacity: 0.45;
}

.login-screen .card {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 420px;
    padding: 46px 42px 42px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(79, 99, 255, 0.13);
    border-radius: 30px;
    backdrop-filter: blur(22px) saturate(1.6);
    box-shadow: var(--tf-shadow-lg);
}

.login-screen .brand {
    justify-content: center;
    /* text-align: center; */
    margin-bottom: 32px;
}

.login-screen .brand-copy {
    display: grid;
    gap: 0.3rem;
}

.login-screen .ale {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    margin-bottom: 18px;
    border-radius: 12px;
    font-size: 13px;
}

.login-screen .ale-s {
    color: #16a34a;
    background: #f0fdf8;
    border: 1px solid #bbf7d0;
}

.login-screen .ale-e {
    color: #dc2626;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.login-screen .fg {
    margin-bottom: 15px;
}

.login-screen .fl {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.login-screen .iw {
    position: relative;
}

.login-screen .ii,
.login-screen .ir {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.login-screen .ii {
    left: 14px;
}

.login-screen .ir {
    right: 14px;
    cursor: pointer;
}

.login-screen .fi {
    width: 100%;
    padding: 13px 42px 13px 43px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f8faff;
    font-size: 14px;
    color: var(--tf-ink);
}

.login-screen .frow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.login-screen .ckw {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-screen .ckb {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 10px;
}

.login-screen .ckb.on {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: #fff;
}

.login-screen .ckl {
    font-size: 13px;
    color: var(--tf-muted);
}

.login-screen .fla {
    font-size: 13px;
    font-weight: 700;
}

.login-screen .btn-s {
    width: 100%;
    padding: 14.5px;
    border: 0;
    position: relative;
    overflow: hidden;
}

.login-screen .trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
}

.login-screen .tr {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--tf-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.tf-dashboard {
    font-family: var(--tf-font-body);
}

.tf-stat {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tf-stat:hover,
.tf-col:hover {
    transform: translateY(-2px);
}

.tf-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
}

.s-blue::before {
    background: linear-gradient(90deg, #4f63ff, #7b8aff);
}

.s-green::before {
    background: linear-gradient(90deg, #00c97a, #00e5a0);
}

.s-yellow::before {
    background: linear-gradient(90deg, #d97706, #ffc84a);
}

.s-red::before {
    background: linear-gradient(90deg, #ef4444, #ff7b7b);
}

.tf-stat-body {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 14px;
}

.tf-stat-num {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.tf-stat-label,
.tf-task-preview,
.tf-detail-label,
.tf-section-label,
.tf-modal-sub,
.tf-filter-stats {
    color: var(--tf-muted);
}

.tf-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.s-blue .tf-stat-num,
.s-blue .tf-stat-icon {
    color: #4f63ff;
    background: #eef0ff;
}

.s-green .tf-stat-num,
.s-green .tf-stat-icon {
    color: #00c97a;
    background: #edfdf5;
}

.s-yellow .tf-stat-num,
.s-yellow .tf-stat-icon {
    color: #d97706;
    background: #fffbeb;
}

.s-red .tf-stat-num,
.s-red .tf-stat-icon {
    color: #ef4444;
    background: #fff1f2;
}

.tf-stat-bar {
    height: 4px;
    margin: 0 22px 14px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.tf-stat-fill {
    height: 100%;
}

.s-blue .tf-stat-fill {
    background: linear-gradient(90deg, #4f63ff, #7b8aff);
}

.s-green .tf-stat-fill {
    background: linear-gradient(90deg, #00c97a, #00e5a0);
}

.s-yellow .tf-stat-fill {
    background: linear-gradient(90deg, #d97706, #ffc84a);
}

.s-red .tf-stat-fill {
    background: linear-gradient(90deg, #ef4444, #ff7b7b);
}

.tf-stat-foot {
    padding: 10px 22px 16px;
    border-top: 1px solid #f3f4f6;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tf-muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

.tf-board-header,
.tf-board-title,
.tf-filter-bar,
.tf-filter-item,
.tf-expanded-pills,
.tf-expanded-actions,
.tf-modal-hd,
.tf-modal-hd-left,
.tf-modal-banner,
.tf-modal-ft {
    display: flex;
    align-items: center;
}

.tf-board-header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.tf-board-title {
    gap: 14px;
}

.tf-board-title-icon,
.uf-header-icon,
.rf-header-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tf-primary), #7b8aff);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 99, 255, 0.28);
}

.tf-btn-outline,
.tf-btn-primary,
.tf-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.8rem 1.1rem;
    border-radius: 0.95rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.tf-btn-outline,
.tf-btn-secondary {
    background: #fff;
    border-color: var(--tf-border-strong);
    color: #334155;
}

.tf-btn-primary {
    background: linear-gradient(135deg, var(--tf-primary), #6f7fff);
    color: #fff;
}

.tf-filter-section {
    margin-bottom: 1.4rem;
}

.tf-filter-bar {
    gap: 1rem;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(79, 99, 255, 0.1);
    border-radius: 1.25rem;
    box-shadow: var(--tf-shadow-sm);
}

.tf-filter-item {
    gap: 10px;
    min-width: 180px;
    padding: 0 16px;
    background: #f8faff;
    border: 1.5px solid #e8ecff;
    border-radius: 999px;
}

.tf-filter-item i,
.tf-filter-reset-btn,
.tf-filter-stats {
    color: var(--tf-primary);
}

.tf-filter-select {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 10px 8px 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--tf-ink);
}

.tf-filter-date-wrap {
    position: relative;
}

.tf-filter-date-btn {
    min-height: 42px;
    padding: 0 15px;
    border: 1.5px solid #e8ecff;
    border-radius: 999px;
    background: #f8faff;
    color: var(--tf-ink);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
}

.tf-filter-date-btn:hover,
.tf-filter-date-btn:focus {
    border-color: rgba(79, 99, 255, .35);
    color: var(--tf-primary);
    outline: none;
}

.tf-filter-date-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 80;
    min-width: 245px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}

.tf-date-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: #334155;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.tf-date-option:hover,
.tf-date-option.active {
    background: #eef0ff;
    color: var(--tf-primary);
}

.tf-custom-date-panel {
    display: grid;
    gap: 9px;
    margin-top: 8px;
    padding: 10px;
    border-top: 1px solid #edf2f7;
}

.tf-custom-date-panel label {
    display: grid;
    gap: 5px;
    margin: 0;
}

.tf-custom-date-panel span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.tf-date-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    padding: 7px 10px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.tf-date-input:focus {
    border-color: var(--tf-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 99, 255, .12);
}

.tf-filter-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1.5px solid rgba(79, 99, 255, 0.25);
    border-radius: 999px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
}

.tf-filter-stats {
    margin-top: 12px;
    display: inline-flex;
    gap: 8px;
    padding: 6px 16px;
    background: #eef0ff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* 
/* ═══════════════════════════════════════════════════════════
   TASKFLOW DASHBOARD — Professional Designer-level Theme
   Font   : DM Sans (body) + Bricolage Grotesque (headings)
   Primary: #4f63ff · Green: #059669 · Amber: #d97706
═══════════════════════════════════════════════════════════ */
.tfd {
    font-family: 'DM Sans', sans-serif;
}

/* ── Stat Cards ── */
.tfd-stat {
    background: #fff;
    border-radius: 18px;
    overflow: visible;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
    position: relative;
    transition: transform .2s, box-shadow .2s;
    animation: tfd-up .5s cubic-bezier(.22, 1, .36, 1) both;
}

.tfd-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .09);
    z-index: 50;
}

.tfd-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 18px 18px 0 0;
}

.s-indigo::before {
    background: linear-gradient(90deg, #4f63ff, #818cf8);
}

.s-green::before {
    background: linear-gradient(90deg, #059669, #34d399);
}

.s-amber::before {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

.s-red::before {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.tfd-stat-body {
    padding: 20px 20px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tfd-stat-num {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.tfd-stat-lbl {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #3167b2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tfd-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tfd-info-icon {
    color: #64748b;
    font-size: 13px;
    cursor: help;
}

.tfd-info-pop {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    z-index: 999;
    min-width: 190px;
    transform: translateX(-50%) translateY(-4px);
    opacity: 0;
    pointer-events: none;
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    transition: opacity .16s, transform .16s;
}

.tfd-info-pop::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #0f172a;
}

.tfd-info-pop strong,
.tfd-info-pop span {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.tfd-info-pop strong {
    color: #fff;
    margin-bottom: 5px;
}

.tfd-info-wrap:hover .tfd-info-pop {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.s-indigo .tfd-stat-num {
    color: #4f63ff;
}

.s-green .tfd-stat-num {
    color: #059669;
}

.s-amber .tfd-stat-num {
    color: #d97706;
}

.s-red .tfd-stat-num {
    color: #dc2626;
}

.tfd-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.s-indigo .tfd-stat-icon {
    background: #eef0ff;
    color: #4f63ff;
}

.s-green .tfd-stat-icon {
    background: #ecfdf5;
    color: #059669;
}

.s-amber .tfd-stat-icon {
    background: #fffbeb;
    color: #d97706;
}

.s-red .tfd-stat-icon {
    background: #fef2f2;
    color: #dc2626;
}

.tfd-stat-foot {
    padding: 10px 20px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tfd-stat-foot i {
    font-size: 12px;
}

.s-indigo .tfd-stat-foot i {
    color: #4f63ff;
}

.s-green .tfd-stat-foot i {
    color: #059669;
}

.s-amber .tfd-stat-foot i {
    color: #d97706;
}

.s-red .tfd-stat-foot i {
    color: #dc2626;
}

.col-sm-6:nth-child(1) .tfd-stat {
    animation-delay: .04s
}

.col-sm-6:nth-child(2) .tfd-stat {
    animation-delay: .10s
}

.col-sm-6:nth-child(3) .tfd-stat {
    animation-delay: .16s
}

.col-sm-6:nth-child(4) .tfd-stat {
    animation-delay: .22s
}

/* ── Board Header ── */
.tfd-board-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.tfd-board-hd-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tfd-board-hd-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #4f63ff, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 99, 255, .28);
}

.tfd-board-hd-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.3px;
    margin: 0 0 2px;
}

.tfd-board-hd-sub {
    font-size: 14px;
    color: #334155;
    margin: 0;
    font-weight: 400;
}

.tfd-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 9px;
    background: #fff;
    color: #4f63ff;
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid rgba(79, 99, 255, .25);
    text-decoration: none;
    transition: all .15s;
}

.tfd-btn-outline:hover {
    background: #eef0ff;
    border-color: #4f63ff;
    color: #4f63ff;
}

/* ── Board grid ── */
.tfd-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

@media(max-width:1200px) {
    .tfd-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:640px) {
    .tfd-board {
        grid-template-columns: 1fr;
    }
}

/* ── Column ── */
.tfd-col {
    background: #fafbff;
    border: 1px solid #e8ecf5;
    border-radius: 20px;
    animation: tfd-up .6s cubic-bezier(.22, 1, .36, 1) both;
}

.tfd-col:nth-child(1) {
    animation-delay: .06s
}

.tfd-col:nth-child(2) {
    animation-delay: .12s
}

.tfd-col:nth-child(3) {
    animation-delay: .18s
}

.tfd-col:nth-child(4) {
    animation-delay: .24s
}

.tfd-col-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 2px solid var(--acc);
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, #f4f6ff, #eef0ff);
}

.tfd-col-hd-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.tfd-col-hd-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tfd-col-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 20%, transparent);
    flex-shrink: 0;
}

.tfd-col-name {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: .1px;
}

.tfd-col-badge {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .07);
    color: #1e293b;
}

.tfd-col-toggle {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--acc);
    background: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--c);
    cursor: pointer;
    transition: all .2s;
}

.tfd-col-toggle:hover {
    background: #fff;
}

.tfd-col-toggle.collapsed i {
    transform: rotate(-90deg);
}

i {
    transition: transform .25s ease;
}

.tfd-col-body {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 56px;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.tfd-col-body.is-drop-target {
    background: linear-gradient(180deg, rgba(79, 99, 255, .06), rgba(79, 99, 255, .02));
    box-shadow: inset 0 0 0 2px rgba(79, 99, 255, .22);
    border-radius: 0 0 20px 20px;
}

/* ── Task Card ── */
.tfd-card {
    background: #fff;
    border: 1px solid #e8ecf5;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 4px 12px rgba(79, 99, 255, .05);
    transition: box-shadow .2s ease, border-color .2s ease;
    animation: tfd-up .45s ease both;
    cursor: pointer;
    position: relative;
}

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

.tfd-card:hover {
    box-shadow: 0 4px 20px rgba(79, 99, 255, .12);
    border-color: rgba(79, 99, 255, .22);
}

.tfd-card.is-dragging {
    opacity: .62;
    transform: rotate(1deg) scale(.98);
    box-shadow: 0 16px 32px rgba(79, 99, 255, .18);
    cursor: grabbing;
}

.tfd-card.is-open {
    border-color: rgba(79, 99, 255, .30);
    box-shadow: 0 4px 24px rgba(79, 99, 255, .14);
}

/* Card top row */
.tfd-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
}

.tfd-card-project {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #4f63ff;
    background: #eef0ff;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* max-width: 140px; */
}

.tfd-card-project i {
    font-size: 11px;
    flex-shrink: 0;
}

.tfd-priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    background: color-mix(in srgb, var(--pc) 12%, white);
    color: var(--pc);
    border: 1px solid color-mix(in srgb, var(--pc) 25%, white);
}

.tfd-priority i {
    font-size: 9px;
}

.tfd-expand-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid #e8ecf5;
    background: #f8faff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
}

.tfd-expand-btn:hover {
    background: #eef0ff;
    color: #4f63ff;
    border-color: #c7d2fe;
}

.tfd-expand-btn.active {
    background: #eef0ff;
    color: #4f63ff;
    border-color: #c7d2fe;
}

.tfd-expand-btn.active i::before {
    content: "\f2ea";
}

/* dash-lg */

/* Card content */
.tfd-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 5px;
}

.tfd-card-preview {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 12px;
}

/* Meta chips — single row, truncated name, tooltip on hover */
.tfd-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.tfd-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    background: #f8faff;
    border: 1px solid #e8ecf5;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    flex-shrink: 1;
}

.tfd-meta-chip i {
    font-size: 11px;
    color: #4f63ff;
    flex-shrink: 0;
}

/* Assignee chip truncates, date chip stays full */
.tfd-meta-chip.chip-assignee {
    max-width: 130px;
}

.tfd-meta-chip.chip-assignee .tfd-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.tfd-meta-chip.chip-date,
.tfd-meta-chip.chip-img {
    flex-shrink: 0;
}

/* Tooltip on assignee chip hover */
.tfd-meta-chip.chip-assignee {
    position: relative;
    cursor: default;
}

.tfd-meta-chip.chip-assignee::after {
    content: attr(data-full);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.tfd-meta-chip.chip-assignee::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
}

.tfd-meta-chip.chip-assignee:hover::after,
.tfd-meta-chip.chip-assignee:hover::before {
    opacity: 1;
}

/* ── Expanded section ── */
.tfd-expanded {
    margin-top: 12px;
}

.tfd-exp-inner {
    padding-top: 12px;
    border-top: 1.5px dashed #e2e8f0;
    animation: tfd-up .2s ease;
}

.tfd-exp-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tfd-exp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid;
}

.tfd-ep-status {
    background: #eef0ff;
    color: #4f63ff;
    border-color: #c7d2fe;
}

.tfd-ep-by {
    background: #f0fdf4;
    color: #059669;
    border-color: #a7f3d0;
}

.tfd-ep-img {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}

.tfd-exp-box {
    background: #f8faff;
    border: 1px solid #e8ecf5;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.tfd-exp-box-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.tfd-exp-box-label {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tfd-exp-box-warn .tfd-exp-box-label {
    color: #d97706;
}

.tfd-exp-box-label i {
    font-size: 12px;
    color: #4f63ff;
}

.tfd-exp-box-warn .tfd-exp-box-label i {
    color: #d97706;
}

.tfd-exp-box-val {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
}

.task-rich-content figure,
.task-rich-content .image,
.ck-content figure.image {
    margin: 12px 0;
}

.task-rich-content img,
.ck-content img {
    display: block;
    width: min(100%, 520px);
    max-width: min(100%, 520px);
    max-height: 360px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}

.task-rich-content img {
    cursor: zoom-in;
    transition: transform .18s ease, box-shadow .18s ease;
}

.task-rich-content img:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}

.task-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, .86);
    backdrop-filter: blur(8px);
}

.task-image-lightbox.is-open {
    display: flex;
}

.task-image-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

.task-image-lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.task-image-lightbox-close i {
    font-size: 20px;
}

@media (max-width: 767px) {
    .task-rich-content img,
    .ck-content img {
        max-width: 100%;
        max-height: 280px;
    }
}

.tfd-exp-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
}

/* ── Buttons ── */
.tfd-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f63ff, #818cf8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 99, 255, .28);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
}

.tfd-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 99, 255, .38);
    color: #fff;
}

/* card-expanded compact variant */
.tfd-exp-actions .tfd-btn-primary {
    padding: 7px 14px;
    font-size: 12px;
}

.tfd-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.tfd-btn-ghost:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tfd-exp-actions .tfd-btn-ghost {
    padding: 7px 13px;
    font-size: 12px;
}

/* Dropdown */
.tfd-dropdown {
    border-radius: 14px !important;
    min-width: 160px;
    overflow: hidden;
}

.tfd-dd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border-radius: 8px;
    transition: background .12s;
}

.tfd-dd-item:hover,
.tfd-dd-item.active {
    background: #eef0ff !important;
    color: #4f63ff !important;
}

/* Empty */
.tfd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 28px 14px;
    background: #fff;
    border: 1.5px dashed #e2e8f0;
    border-radius: 14px;
    color: #94a3b8;
    text-align: center;
}

.tfd-empty i {
    font-size: 24px;
    opacity: .5;
}

.tfd-empty span {
    font-size: 12.5px;
    font-weight: 500;
}

/* ═══════════════════════════════
   MODAL
═══════════════════════════════ */
.tfd-modal-wrap {
    font-family: 'DM Sans', sans-serif;
}

.tfd-modal-wrap .modal-dialog {
    max-width: 820px;
}

.tfd-modal {
    border: 0 !important;
    border-radius: 22px !important;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .18), 0 4px 16px rgba(0, 0, 0, .08) !important;
}

/* Modal header */
.tfd-mhd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 30px 22px;
    background: linear-gradient(135deg, #f8faff, #fff);
    border-bottom: 1px solid #e8ecf5;
}

.tfd-mhd-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.tfd-mhd-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4f63ff, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 99, 255, .28);
}

.tfd-modal-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.3px;
    margin: 0 0 5px;
    line-height: 1.25;
}

.tfd-modal-sub {
    font-size: 12.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tfd-modal-dot {
    color: #cbd5e1;
}

.tfd-modal-slug {
    font-size: 11.5px;
    background: #eef0ff;
    color: #4f63ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-style: normal;
}

.tfd-mclose {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}

.tfd-mclose:hover {
    background: #eef0ff;
    color: #4f63ff;
    border-color: #c7d2fe;
}

/* Modal body */
.tfd-mbody {
    padding: 26px 30px;
    overflow-y: auto;
    max-height: 65vh;
}

/* Banner */
.tfd-mbanner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tfd-mbadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 12.5px;
    font-weight: 700;
}

/* Info grid — 3 columns */
.tfd-minfo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media(max-width:640px) {
    .tfd-minfo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:420px) {
    .tfd-minfo-grid {
        grid-template-columns: 1fr;
    }
}

.tfd-minfo {
    background: #f8faff;
    border: 1px solid #e8ecf5;
    border-radius: 13px;
    padding: 14px 16px;
    transition: border-color .2s;
}

.tfd-minfo:hover {
    border-color: rgba(79, 99, 255, .2);
}

.tfd-minfo-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
    margin-bottom: 7px;
}

.tfd-minfo-label i {
    font-size: 12px;
    color: #4f63ff;
}

.tfd-minfo-val {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
}

.tfd-overdue {
    color: #dc2626 !important;
}

.tfd-overdue-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 5px;
}

/* Sections */
.tfd-msection {
    background: #f8faff;
    border: 1px solid #e8ecf5;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.tfd-msec-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.tfd-msec-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #4f63ff;
    background: linear-gradient(135deg, #f0f4ff, #eef0ff);
    border-bottom: 1px solid #e8ecf5;
}

.tfd-msec-warn .tfd-msec-label {
    color: #d97706;
    background: linear-gradient(135deg, #fffde7, #fffbeb);
    border-color: #fde68a;
}

.tfd-msec-label i {
    font-size: 13px;
}

.tfd-msec-count {
    background: #eef0ff;
    color: #4f63ff;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
}

.tfd-msec-body {
    padding: 14px 16px;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.7;
}

/* Screenshots */
.tfd-screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
}

.tfd-ss-link {
    position: relative;
    display: block;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid #e8ecf5;
}

.tfd-ss-img {
    width: 130px;
    height: 96px;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}

.tfd-ss-link:hover .tfd-ss-img {
    transform: scale(1.06);
}

.tfd-ss-ov {
    position: absolute;
    inset: 0;
    background: rgba(79, 99, 255, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
}

.tfd-ss-link:hover .tfd-ss-ov {
    opacity: 1;
}

/* Modal footer */
.tfd-mfoot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 30px 22px;
    border-top: 1px solid #e8ecf5;
    background: linear-gradient(135deg, #fff, #f8faff);
}

/* ── Animation ── */
@keyframes tfd-up {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.uf-shell,
.rf-shell {
    font-family: var(--tf-font-body);
}

.uf-header-left,
.rf-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.uf-section,
.rf-section {
    display: grid;
    gap: 1rem;
}

.uf-section-label,
.rf-section-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #eef0ff;
    color: var(--tf-primary);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.uf-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.uf-row-split {
    grid-template-columns: minmax(0, 1fr) 260px;
}

.uf-field,
.rf-field {
    display: grid;
    gap: 0.4rem;
}

.uf-input-wrap,
.rf-input-wrap {
    position: relative;
}

.uf-input-icon,
.rf-input-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #9ca3af;
}

.uf-input,
.rf-input {
    padding: 12px 42px 12px 40px;
}

.uf-input-eye {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
}

.uf-error,
.rf-error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--tf-danger);
    font-size: 0.8rem;
    font-weight: 600;
}

.uf-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
    gap: 0.75rem;
}

.uf-role-tile,
.rf-module-card,
.uf-status-card,
.rf-status-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 1rem;
    background: #f8faff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.uf-role-tile {
    overflow: hidden;
    cursor: pointer;
}

.uf-role-check,
.uf-status-input,
.rf-status-input,
.rf-perm-input {
    display: none;
}

.uf-role-content {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
}

.uf-role-check-box,
.rf-perm-check-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid #6d7bff;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    flex-shrink: 0;
}

.uf-role-tile:has(.uf-role-check:checked),
.rf-perm-row:has(.rf-perm-input:checked),
.uf-status-toggle:has(.uf-status-input:checked) .uf-status-card,
.rf-status-toggle:has(.rf-status-input:checked) .rf-status-card {
    background: linear-gradient(135deg, #f0f2ff, #eef0ff);
    border-color: rgba(79, 99, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(79, 99, 255, 0.1);
}

.uf-role-tile:has(.uf-role-check:checked) .uf-role-check-box,
.rf-perm-row:has(.rf-perm-input:checked) .rf-perm-check-box {
    background: var(--tf-primary);
    border-color: var(--tf-primary);
    color: #fff;
}

.uf-status-card,
.rf-status-card {
    padding: 16px;
}

.uf-status-indicator,
.rf-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #64748b;
}

.uf-status-dot,
.rf-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d1d5db;
}

.uf-status-toggle:has(.uf-status-input:checked) .uf-status-dot,
.rf-status-toggle:has(.rf-status-input:checked) .rf-status-dot {
    background: var(--tf-success);
    box-shadow: 0 0 8px rgba(0, 201, 122, 0.45);
}

.uf-switch-track,
.rf-switch-track {
    width: 44px;
    height: 24px;
    margin-top: 0.8rem;
    border-radius: 999px;
    position: relative;
    background: #e5e7eb;
}

.uf-switch-thumb,
.rf-switch-thumb {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 3px;
    left: 3px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.uf-status-toggle:has(.uf-status-input:checked) .uf-switch-thumb,
.rf-status-toggle:has(.rf-status-input:checked) .rf-switch-thumb {
    transform: translateX(20px);
}

.rf-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr auto;
    gap: 1rem;
}

.rf-perm-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.rf-perm-btn,
.rf-module-all-btn {
    border: 0;
    background: transparent;
    color: var(--tf-primary);
    font-weight: 700;
}

.rf-modules-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.rf-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 11px;
    border-bottom: 1px solid #eef0ff;
}

.rf-module-name {
    font-size: 0.82rem;
    font-weight: 800;
}

.rf-perm-list {
    display: grid;
    gap: 0.2rem;
    padding: 10px 14px 12px;
}

.rf-perm-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 9px 10px;
    border-radius: 0.85rem;
    cursor: pointer;
}

.rf-empty-perms {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    padding: 36px 20px;
    border: 1.5px dashed #e8ecff;
    border-radius: 1rem;
    background: #fafbff;
    color: #9ca3af;
    text-align: center;
}

.chat-app-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.chat-sidebar-card,
.chat-main-card {
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(79, 99, 255, 0.1);
    box-shadow: var(--tf-shadow-md);
}

.chat-sidebar-card {
    background: linear-gradient(180deg, #1d2434 0%, #131a2a 100%);
    color: #eef2ff;
}

.chat-main-card {
    background: #fff;
}

.chat-sidebar-head,
.chat-main-head {
    padding: 1.1rem 1.2rem;
}

.chat-sidebar-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--tf-border);
    background: #fff;
}

.chat-workspace-lockup,
.chat-main-profile,
.chat-main-meta,
.chat-composer-actions,
.chat-attachment-head,
.chat-code-head,
.chat-bubble-meta,
.chat-create-head,
.chat-composer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-workspace-lockup,
.chat-main-meta,
.chat-composer-actions,
.chat-attachment-head,
.chat-code-head {
    justify-content: space-between;
}

.chat-sidebar-kicker {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(238, 242, 255, 0.58);
}

.chat-sidebar-card .admin-table-title,
.chat-sidebar-card .admin-table-subtitle,
.chat-list-section-title,
.chat-empty-mini {
    color: #eef2ff;
}

.chat-sidebar-card .admin-table-subtitle {
    opacity: 0.72;
}

.chat-sidebar-search {
    position: relative;
    margin-top: 0.95rem;
}

.chat-sidebar-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.48);
}

.chat-sidebar-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    padding: 0.7rem 1rem 0.7rem 2.4rem;
}

.chat-sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

.chat-icon-btn,
.chat-toolbar-btn {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 99, 255, 0.08);
    color: inherit;
    transition: background 0.2s ease, transform 0.15s ease;
}

.chat-sidebar-card .chat-icon-btn {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.chat-icon-btn:hover,
.chat-toolbar-btn:hover {
    transform: translateY(-1px);
    background: rgba(79, 99, 255, 0.16);
}

.chat-create-card {
    margin: 0.9rem 0.9rem 0.6rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.2rem;
}

.chat-create-hint {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.58);
}

.chat-create-card .admin-field-label,
.chat-create-card .admin-helper {
    color: rgba(255, 255, 255, 0.82);
}

.chat-create-card .admin-input,
.chat-create-card .admin-select {
    background: rgba(255, 255, 255, 0.92);
}

.chat-section-mini-title {
    margin: 0 0 0.9rem;
    font-size: 0.96rem;
    font-weight: 800;
    color: #fff;
}

.chat-create-form {
    display: grid;
    gap: 0.95rem;
}

.chat-list-section-title {
    padding: 0.55rem 1rem 0.45rem;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(238, 242, 255, 0.54);
}

.chat-conversation-list {
    display: grid;
    gap: 0.35rem;
    padding: 0 0.75rem 0.9rem;
    max-height: calc(100vh - 20rem);
    overflow-y: auto;
}

.chat-conversation-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    color: inherit;
    transition: background 0.18s ease, transform 0.15s ease;
}

.chat-conversation-item:hover,
.chat-conversation-item.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    transform: translateX(2px);
}

.chat-conversation-avatar,
.chat-main-avatar,
.chat-hero-avatar,
.chat-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-family: var(--tf-font-heading);
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #4f63ff, #7b8aff);
}

.chat-conversation-avatar {
    width: 42px;
    height: 42px;
    font-size: 0.92rem;
}

.chat-conversation-content {
    min-width: 0;
}

.chat-conversation-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.chat-conversation-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-users,
.chat-conversation-preview,
.chat-conversation-time {
    font-size: 0.78rem;
    color: rgba(238, 242, 255, 0.64);
}

.chat-conversation-preview {
    margin-top: 0.18rem;
    line-height: 1.45;
}

.chat-main-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.chat-main-title {
    margin: 0;
    font-family: var(--tf-font-heading);
    font-size: 1.18rem;
    font-weight: 800;
}

.chat-main-subtitle {
    margin: 0.22rem 0 0;
    color: var(--tf-muted);
    font-size: 0.88rem;
}

.chat-hero-card {
    margin: 1rem 1rem 0;
    padding: 1.15rem 1.2rem;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    background: linear-gradient(135deg, #f8faff, #ffffff);
    border: 1px solid #e9eef8;
    border-radius: 1.25rem;
}

.chat-hero-avatar {
    width: 68px;
    height: 68px;
    border-radius: 1.3rem;
    font-size: 1.35rem;
}

.chat-hero-copy h4 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tf-ink);
}

.chat-hero-copy p {
    margin: 0;
    color: var(--tf-muted);
    line-height: 1.55;
}

.chat-thread-card {
    margin: 1rem;
    min-height: 360px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #eef2f8;
    border-radius: 1.25rem;
}

.chat-thread-shell {
    display: grid;
    gap: 1.15rem;
}

.chat-bubble-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
}

.chat-bubble-row.is-own {
    grid-template-columns: minmax(0, 1fr) 40px;
}

.chat-bubble-row.is-own .chat-message-avatar {
    order: 2;
}

.chat-bubble-row.is-own .chat-bubble {
    order: 1;
    margin-left: auto;
}

.chat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.95rem;
    font-size: 0.88rem;
}

.chat-message-avatar.is-own {
    background: linear-gradient(135deg, #00c97a, #00e5a0);
}

.chat-bubble {
    width: min(100%, 820px);
    padding: 0.15rem 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.chat-bubble-meta {
    justify-content: flex-start;
    margin-bottom: 0.35rem;
    color: var(--tf-muted);
    font-size: 0.79rem;
}

.chat-bubble-author {
    font-weight: 800;
    color: var(--tf-ink);
}

.chat-bubble-text {
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--tf-ink);
    font-size: 0.94rem;
}

.chat-code-card,
.chat-attachment-card {
    margin-top: 0.75rem;
    padding: 0.9rem;
    border-radius: 1rem;
    background: #f8fbff;
    border: 1px solid #e3ebf7;
}

.chat-code-head,
.chat-attachment-head {
    margin-bottom: 0.75rem;
    color: var(--tf-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.chat-code-block,
.chat-code-input {
    width: 100%;
    margin: 0;
    padding: 1rem;
    border-radius: 1rem;
    background: #121826;
    color: #dbe6ff;
    border: 1px solid #24314c;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-x: auto;
}

.chat-code-input {
    min-height: 180px;
    resize: vertical;
}

.chat-image-preview {
    width: 100%;
    max-width: 320px;
    border-radius: 0.9rem;
    display: block;
    margin-bottom: 0.8rem;
}

.chat-composer-card {
    margin: 0 1rem 1rem;
    padding: 0.9rem;
    border: 1px solid #dce4f1;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.chat-composer-form {
    display: grid;
    gap: 0.9rem;
}

.chat-composer-toolbar {
    padding: 0.1rem 0.15rem 0.8rem;
    border-bottom: 1px solid #edf2f7;
}

.chat-toolbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 0.75rem;
    background: #f8fbff;
    color: #4b5563;
}

.chat-toolbar-divider {
    width: 1px;
    height: 20px;
    background: #dbe3ef;
}

.chat-composer-inputs {
    display: grid;
    gap: 0.9rem;
}

.chat-primary-input {
    border-radius: 1rem;
    background: #fff;
}

.chat-message-input {
    width: 100%;
    min-height: 130px;
    padding: 0.3rem 0;
    border: 0;
    resize: vertical;
    font-size: 0.96rem;
    color: var(--tf-ink);
    background: transparent;
}

.chat-message-input:focus {
    outline: 0;
}

.chat-composer-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
}

.chat-composer-actions {
    padding-top: 0.2rem;
}

.chat-empty-mini,
.chat-empty-state {
    display: grid;
    place-items: center;
    gap: 0.55rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--tf-muted);
}

.chat-empty-state {
    min-height: 540px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px dashed #dbe5f3;
    border-radius: 1.6rem;
}

.chat-empty-state i,
.chat-empty-mini i {
    font-size: 1.6rem;
    color: var(--tf-primary);
}

.chat-app-shell.dm-mode {
    grid-template-columns: 290px minmax(0, 1fr);
}

.chat-app-shell.dm-mode .chat-sidebar-card {
    min-height: calc(100vh - 11rem);
    background: linear-gradient(180deg, #20273a 0%, #151b2a 100%);
}

.chat-app-shell.dm-mode .chat-main-card {
    min-height: calc(100vh - 11rem);
    display: flex;
    flex-direction: column;
    border-radius: 1.35rem;
    background: #fff;
}

.simple-chat-composer {
    margin-top: auto;
}

.chat-message-box {
    border: 1px solid #dce4f1;
    border-radius: 1.1rem;
    padding: 0.85rem 1rem;
    background: #fbfcff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.chat-upload-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.chat-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: #eef1ff;
    color: var(--tf-primary);
    font-weight: 700;
    cursor: pointer;
}

.chat-upload-btn:hover {
    background: #e4e8ff;
    color: var(--tf-primary-dark);
}

.chat-app-shell.dm-mode .chat-thread-card {
    min-height: 420px;
    max-height: 58vh;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.chat-app-shell.dm-mode .chat-conversation-item {
    border: 1px solid transparent;
}

.chat-app-shell.dm-mode .chat-conversation-item:hover,
.chat-app-shell.dm-mode .chat-conversation-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.06);
}

.chat-app-shell.dm-mode .chat-main-head {
    padding: 1rem 1.15rem;
}

.chat-app-shell.dm-mode .chat-main-title {
    font-size: 1.08rem;
}

.chat-app-shell.dm-mode .chat-main-subtitle {
    font-size: 0.82rem;
}

.chat-app-shell.dm-mode .chat-bubble-text {
    font-size: 0.92rem;
}

.chat-app-shell.dm-mode .chat-message-input {
    min-height: 96px;
    font-size: 0.94rem;
    line-height: 1.6;
}

@media (max-width: 1199px) {

    .tf-board,
    .rf-modules-grid,
    .chat-app-shell {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .chat-conversation-list {
        max-height: none;
    }

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

@media (max-width: 991px) {

    .admin-col-3,
    .admin-col-4,
    .admin-col-6,
    .admin-col-8 {
        grid-column: span 12;
    }

    .uf-row,
    .rf-row,
    .uf-row-split,
    .tf-modal-grid {
        grid-template-columns: 1fr;
    }

    .login-screen .pill,
    .login-screen .sbadge,
    .login-screen .pcard,
    .login-screen .emo {
        display: none !important;
    }
}

@media (max-width: 767px) {

    .admin-surface-header,
    .admin-surface-body,
    .admin-table-header,
    .uf-header,
    .uf-body,
    .rf-header,
    .rf-body,
    .tf-modal-hd,
    .tf-modal-bd,
    .tf-modal-ft {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .admin-actions,
    .uf-actions,
    .rf-actions,
    .tf-board-header {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-main-head,
    .chat-hero-card,
    .chat-bubble-row,
    .chat-bubble-row.is-own,
    .chat-composer-grid {
        grid-template-columns: 1fr;
    }

    .chat-bubble-row.is-own .chat-message-avatar,
    .chat-bubble-row.is-own .chat-bubble {
        order: initial;
    }

    .chat-main-head,
    .chat-main-meta,
    .chat-workspace-lockup,
    .chat-composer-actions {
        flex-wrap: wrap;
    }

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

    .login-screen .card {
        padding: 32px 22px 28px;
        margin: 1rem;
    }
}



/* ═══════════════════════════════════════════════
   TASK SHOW PAGE — TaskFlow Theme
   Font: DM Sans + Bricolage Grotesque
   Primary: #4f63ff
═══════════════════════════════════════════════ */
.ts-shell {
    font-family: 'DM Sans', sans-serif;
    padding-bottom: 40px;
}

/* ── Page Header ── */
.ts-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ts-page-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ts-page-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4f63ff, #7b8aff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(79, 99, 255, .32);
}

.ts-page-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #1a1d2e;
    letter-spacing: -.5px;
    margin: 0 0 5px;
    line-height: 1.2;
}

.ts-page-sub {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    font-weight: 500;
}

.ts-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.ts-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 11px;
    background: linear-gradient(135deg, #4f63ff, #7b8aff);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(79, 99, 255, .32);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}

.ts-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(79, 99, 255, .42);
    color: #fff;
}

.ts-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 11px;
    background: #fff;
    color: #6b7280;
    font-size: 13.5px;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    transition: all .15s;
}

.ts-btn-ghost:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* ── Banner ── */
.ts-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 16px 20px;
    background: #f8faff;
    border: 1px solid #eef0ff;
    border-radius: 16px;
}

.ts-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 700;
}

.ts-status-todo {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #6b7280;
}

.ts-status-in_progress {
    background: #eef0ff;
    border-color: #c7d0ff;
    color: #4f63ff;
}

.ts-status-review {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

.ts-status-done {
    background: #edfdf5;
    border-color: #a7f3d0;
    color: #00c97a;
}

.ts-priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 700;
}

.ts-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e8ecff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    margin-left: auto;
}

/* ── Info Grid ── */
.ts-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media(max-width:1100px) {
    .ts-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:640px) {
    .ts-info-grid {
        grid-template-columns: 1fr;
    }
}

.ts-info-card {
    background: #fff;
    border: 1px solid #eef0ff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(79, 99, 255, .05);
    transition: border-color .2s, box-shadow .2s;
    animation: ts-up .5s cubic-bezier(.22, 1, .36, 1) both;
}

.ts-info-card:hover {
    border-color: rgba(79, 99, 255, .2);
    box-shadow: 0 4px 18px rgba(79, 99, 255, .09);
}

.ts-info-card:nth-child(1) {
    animation-delay: .04s
}

.ts-info-card:nth-child(2) {
    animation-delay: .08s
}

.ts-info-card:nth-child(3) {
    animation-delay: .12s
}

.ts-info-card:nth-child(4) {
    animation-delay: .16s
}

.ts-info-card:nth-child(5) {
    animation-delay: .20s
}

.ts-info-card:nth-child(6) {
    animation-delay: .24s
}

.ts-info-card:nth-child(7) {
    animation-delay: .28s
}

.ts-info-card:nth-child(8) {
    animation-delay: .32s
}

/* Accent card for Task Name */
.ts-info-card-accent {
    background: linear-gradient(135deg, #f4f6ff, #eef0ff);
    border-color: rgba(79, 99, 255, .20);
}

.ts-info-card-accent .ts-info-label i {
    color: #4f63ff;
}

.ts-info-card-accent .ts-info-val {
    color: #4f63ff;
    font-weight: 700;
}

.ts-info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.ts-info-label i {
    font-size: 12px;
    color: #c7d0ff;
}

.ts-info-val {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d2e;
    line-height: 1.4;
}

.ts-overdue {
    color: #ef4444 !important;
}

.ts-overdue-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #fff1f2;
    color: #ef4444;
    border: 1px solid #fecdd3;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
}

/* ── Sections ── */
.ts-section {
    background: #fff;
    border: 1px solid #eef0ff;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(79, 99, 255, .05);
    animation: ts-up .55s cubic-bezier(.22, 1, .36, 1) .2s both;
}

.ts-section-warn {
    border-color: rgba(217, 119, 6, .18);
}

.ts-section-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 20px;
    background: #f8faff;
    border-bottom: 1px solid #eef0ff;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #4f63ff;
}

.ts-section-warn .ts-section-header {
    background: #fffbeb;
    border-color: rgba(217, 119, 6, .15);
    color: #d97706;
}

.ts-section-header i {
    font-size: 14px;
}

.ts-section-count {
    background: #eef0ff;
    color: #4f63ff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
}

.ts-section-body {
    padding: 18px 20px;
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
}

/* ── Screenshots ── */
.ts-screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ts-screenshot-link {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e8ecff;
    box-shadow: 0 2px 10px rgba(79, 99, 255, .08);
    transition: box-shadow .2s, transform .2s;
}

.ts-screenshot-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 99, 255, .15);
}

.ts-screenshot-img {
    width: 150px;
    height: 110px;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}

.ts-screenshot-link:hover .ts-screenshot-img {
    transform: scale(1.06);
}

.ts-screenshot-overlay {
    position: absolute;
    inset: 0;
    background: rgba(79, 99, 255, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    opacity: 0;
    transition: opacity .2s;
}

.ts-screenshot-link:hover .ts-screenshot-overlay {
    opacity: 1;
}

.ts-empty-screenshots {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    background: #fafbff;
    border: 1.5px dashed #e8ecff;
    border-radius: 14px;
    color: #9ca3af;
    text-align: center;
}

.ts-empty-screenshots i {
    font-size: 32px;
    opacity: .4;
}

.ts-empty-screenshots span {
    font-size: 13px;
    font-weight: 500;
}

/* ── Animation ── */
@keyframes ts-up {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}


/* Chat thread container */
.chat-thread-shell {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-thread-shell::-webkit-scrollbar {
  width: 5px;
}

.chat-thread-shell::-webkit-scrollbar-track {
  background: transparent;
}

.chat-thread-shell::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 3px;
}

/* ========== RECEIVED MESSAGE (LEFT SIDE) ========== */
.chat-message-received {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: flex-start;
  animation: slideInLeft 0.2s ease-out;
}

.chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: #4f63ff;
}

.chat-message-avatar.sent {
  order: 2;
}

.chat-bubble-received {
  max-width: 65%;
  background: #ffffff;
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.chat-bubble-author {
  font-size: 12px;
  font-weight: 700;
  color: #4f63ff;
  margin-bottom: 4px;
  display: block;
}

.chat-bubble-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #1a1d2e;
  word-wrap: break-word;
}

.chat-bubble-time {
  font-size: 10px;
  color: rgba(0,0,0,.45);
  margin-top: 4px;
  text-align: left;
}

/* ========== SENT MESSAGE (RIGHT SIDE) ========== */
.chat-message-sent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: flex-end;
  animation: slideInRight 0.2s ease-out;
}

.chat-bubble-sent {
  max-width: 65%;
  background: #dcf8c5;
  border-radius: 12px 12px 4px 12px;
  padding: 8px 12px;
  order: 1;
}

.chat-message-sent .chat-bubble-time {
  text-align: right;
}

.chat-message-edited {
  font-size: 9px;
  color: rgba(0,0,0,.35);
  font-style: italic;
  margin-left: 5px;
}

/* ========== ATTACHMENT STYLES ========== */
.chat-attachment-card {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0,0,0,.03);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
}

.chat-attachment-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.chat-image-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin: 6px 0;
  cursor: pointer;
}

/* ========== ANIMATIONS ========== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== EMPTY STATE ========== */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #f8faff;
  padding: 40px;
}

.chat-empty-state i {
  font-size: 64px;
  color: #4f63ff;
  opacity: 0.5;
  margin-bottom: 16px;
}

.chat-empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 8px;
}

.chat-empty-state p {
  font-size: 13px;
  color: #94a3b8;
  max-width: 300px;
}


  .delete-modal-content {
    border: 0;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  }

  .delete-modal-header {
    padding: 18px 20px 14px;
    border: 0;
    background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
  }

  .delete-modal-hero {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .delete-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ff6b6b 0%, #ef4444 100%);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.26);
    flex-shrink: 0;
  }

  .delete-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
  }

  .delete-modal-subtitle {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
  }

  .delete-modal-body {
    padding: 4px 20px 20px;
  }

  .delete-modal-warning {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff7ed 0%, #fffefb 100%);
    border: 1px solid #fed7aa;
    color: #9a3412;
  }

  .delete-modal-warning i {
    font-size: 20px;
    line-height: 1;
    margin-top: 1px;
    flex-shrink: 0;
  }

  .delete-modal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }

  .delete-modal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
  }

  .delete-modal-footer {
    padding: 0 20px 20px;
    border: 0;
    gap: 10px;
  }

@media (max-width: 991.98px) {
    .app-content-header {
        padding-top: 0.9rem;
        padding-bottom: 0.4rem;
    }

    .app-content-header h3 {
        font-size: 1.15rem;
    }

    .admin-table-header,
    .admin-surface-header,
    .uf-header,
    .rf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        padding: 1.1rem 1rem;
    }

    .admin-table-header > .d-flex,
    .admin-table-header > div,
    .admin-table-header .d-flex.justify-content-between {
        width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }

    .admin-table-card .card-body,
    .admin-surface-body,
    .uf-body,
    .rf-body {
        padding: 1rem;
    }

    .tf-filter-bar {
        padding: 0.9rem;
        gap: 0.75rem;
    }

    .tf-filter-item {
        min-width: 100%;
        width: 100%;
    }

    .tf-filter-item,
    .tf-filter-date-btn,
    .tf-btn-primary,
    .tf-filter-reset-btn {
        width: 100%;
        justify-content: center;
    }

    .tf-filter-date-wrap {
        width: 100%;
    }

    .tf-filter-date-menu {
        min-width: min(100vw - 2rem, 360px);
    }

    .task-list-filter-actions {
        width: 100%;
        margin-left: 0 !important;
    }

    .task-list-filter-actions > * {
        flex: 1 1 0;
    }

    .admin-data-table thead th {
        padding: 0.85rem 0.9rem;
        font-size: 0.72rem;
    }

    .admin-data-table tbody td {
        padding: 0.85rem 0.9rem;
    }
}

@media (max-width: 767.98px) {
    .admin-table-card,
    .admin-surface,
    .uf-shell,
    .rf-shell {
        border-radius: 1rem;
    }

    .admin-data-table thead th {
        padding: 0.75rem 0.8rem;
    }

    .admin-data-table tbody td {
        padding: 0.7rem 0.8rem;
        font-size: 0.92rem;
    }

    .admin-table-header .btn,
    .admin-table-header a,
    .admin-actions .btn,
    .admin-actions a {
        width: 100%;
    }

    .admin-actions {
        align-items: stretch;
    }

    .task-list-filter-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.6rem !important;
    }

    .task-list-search-btn,
    .task-list-filter-actions .tf-filter-reset-btn {
        width: 100%;
    }
}


