.tf-page-hero {
    border: 1px solid rgba(42, 118, 244, .10);
    border-radius: 14px;
    background:
        radial-gradient(circle at top left, rgba(42, 118, 244, .13), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 56%, #eef8f6 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
    padding: 22px;
}

.tf-page-hero-icon,
.tf-icon-bubble,
.tf-empty-icon,
.tf-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.tf-page-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #1761d8;
    background: rgba(42, 118, 244, .12);
    font-size: 25px;
}

.tf-metric-card {
    border: 0;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .055);
}

.tf-metric-card .card-body {
    padding: 22px;
}

.tf-metric-card h3 {
    font-size: 1.3rem;
    line-height: 1.35;
    white-space: normal;
}

.tf-metric-card small {
    line-height: 1.45;
}

.tf-icon-bubble {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 23px;
}

.tf-filter-card {
    border: 1px solid rgba(148, 163, 184, .18);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.tf-table-card .table > :not(caption) > * > * {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.tf-table-responsive-actions {
    overflow-y: visible;
}

.tf-table-card thead th {
    color: #64748b;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tf-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    overflow: hidden;
}

.tf-avatar-lg {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    font-size: 24px;
}

.tf-avatar-xl {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    font-size: 30px;
}

.tf-avatar-hero {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    font-size: 28px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .10);
    border: 4px solid rgba(255, 255, 255, .9);
}

.tf-avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tf-empty-state {
    padding: 44px 20px;
    text-align: center;
    color: #64748b;
}

.tf-empty-state h5 {
    color: #1f2937;
    margin: 12px 0 6px;
}

.tf-empty-state p {
    margin: 0 auto;
    max-width: 420px;
}

.tf-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: #1761d8;
    background: rgba(42, 118, 244, .10);
    font-size: 28px;
}

.tf-soft-card {
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.tf-profile-cover {
    border-radius: 16px;
    background:
        radial-gradient(circle at 12% 20%, rgba(19, 184, 166, .35), transparent 24%),
        linear-gradient(135deg, #1761d8 0%, #13b8a6 100%);
    min-height: 140px;
}

.tf-patient-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(19, 184, 166, .14), transparent 30%),
        radial-gradient(circle at top left, rgba(23, 97, 216, .12), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.97));
}

.tf-patient-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), transparent 30%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 1px, transparent 1px 14px);
    pointer-events: none;
}

.tf-patient-hero .card-body {
    position: relative;
    z-index: 1;
}

.tf-patient-hero-copy {
    max-width: 700px;
}

.tf-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .45rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .78);
    color: #334155;
    font-size: .78rem;
    font-weight: 600;
}

.tf-chip-brand {
    color: #1761d8;
    background: rgba(42, 118, 244, .08);
    border-color: rgba(42, 118, 244, .14);
}

.tf-patient-context-pill {
    min-width: 150px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(255, 255, 255, .74);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}

.tf-patient-context-pill span {
    display: block;
    color: #64748b;
    font-size: .75rem;
    margin-bottom: 4px;
}

.tf-patient-context-pill strong {
    display: block;
    color: #0f172a;
    font-size: .95rem;
    line-height: 1.45;
}

.tf-patient-hero-actions {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tf-patient-hero-note {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(255,255,255,.8);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}

.tf-tabs.nav-tabs .nav-link {
    border: 0;
    border-radius: 10px;
    color: #64748b;
    margin-right: 6px;
}

.tf-tabs.nav-tabs .nav-link.active {
    background: rgba(42, 118, 244, .10);
    color: #1761d8;
}

.tf-profile-tabs {
    gap: 8px;
    border-bottom: 0;
}

.tf-profile-tabs .nav-link {
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .85);
    padding: 10px 16px;
}

.tf-profile-stat,
.tf-info-block {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96));
    padding: 16px 18px;
    height: 100%;
}

.tf-info-block {
    padding: 18px 20px;
}

.tf-profile-stat span,
.tf-info-block span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    margin-bottom: 6px;
}

.tf-profile-stat strong,
.tf-info-block strong {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 600;
    display: block;
    line-height: 1.55;
    word-break: break-word;
}

.tf-evolution-card {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 18px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.tf-side-list-item + .tf-side-list-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .16);
}

.tf-list-group-soft .list-group-item {
    border-color: rgba(148, 163, 184, .14);
}

.tf-action-list .btn {
    justify-content: flex-start;
    text-align: left;
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 575.98px) {
    .tf-page-hero {
        padding: 18px;
    }

    .tf-page-hero-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .tf-table-responsive-actions {
        overflow-x: auto;
        overflow-y: visible;
    }

    .tf-avatar-hero {
        width: 72px;
        height: 72px;
        border-radius: 20px;
        font-size: 22px;
    }

    .tf-patient-context-pill {
        min-width: calc(50% - 6px);
    }
}

@media (min-width: 768px) {
    .tf-table-responsive-actions {
        overflow: visible;
    }
}

.tf-category-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tf-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.tf-document-excerpt {
    color: #64748b;
    line-height: 1.7;
    min-height: 76px;
}

.tf-document-editor {
    min-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .92rem;
}

.tf-paper-preview {
    max-width: 794px;
    min-height: 1040px;
    margin: 0 auto;
    padding: 56px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    line-height: 1.75;
}

.tf-paper-preview h1,
.tf-paper-preview h2,
.tf-paper-preview h3 {
    color: #0f172a;
    margin-bottom: 1rem;
}

.tf-paper-preview p:last-child {
    margin-bottom: 0;
}

.tf-token-btn {
    border-radius: 999px;
}

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

.tf-meta-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.tf-meta-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.tf-meta-list span {
    color: #64748b;
    font-size: .84rem;
}

.tf-meta-list strong {
    text-align: right;
}

.tf-signature-preview {
    max-height: 96px;
    display: block;
    margin-bottom: 10px;
}

.tf-signature-block + .tf-signature-block {
    margin-top: 24px;
}

.tf-exercise-card-image,
.tf-exercise-card-fallback {
    width: 100%;
    aspect-ratio: 16 / 10;
}

.tf-exercise-card-image {
    display: block;
    object-fit: cover;
    background: #f8fafc;
}

.tf-exercise-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(42, 118, 244, .10), rgba(19, 184, 166, .10)),
        #f8fafc;
}

.tf-exercise-instructions {
    border-left: 3px solid rgba(42, 118, 244, .35);
    background: rgba(42, 118, 244, .06);
    border-radius: 0 10px 10px 0;
    padding: 10px 12px;
}

.tf-exercise-instructions strong,
.tf-exercise-instructions span {
    display: block;
}

.tf-exercise-instructions strong {
    color: #1761d8;
    font-size: .78rem;
    margin-bottom: 4px;
}

.tf-exercise-instructions span {
    color: #334155;
    font-size: .88rem;
    line-height: 1.55;
}

.tf-exercise-form-preview {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, .22);
}

.tf-prescription-exercise-image,
.tf-prescription-exercise-fallback {
    width: 180px;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    flex: 0 0 180px;
}

.tf-prescription-exercise-image {
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, .22);
}

.tf-prescription-exercise-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1761d8;
    background: rgba(42, 118, 244, .10);
    font-size: 34px;
}

.tf-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tf-sticky-card {
    position: sticky;
    top: 92px;
}

.tf-checklist {
    display: grid;
    gap: 12px;
}

.tf-checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tf-check-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.tf-inline-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tf-settings-panel {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(248, 250, 252, .9), #fff);
}

.tf-switch-card {
    display: block;
    margin: 0;
    cursor: pointer;
}

.tf-switch-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tf-switch-card-body {
    display: block;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    padding: 16px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tf-switch-card-body strong {
    display: block;
    color: #0f172a;
    margin-bottom: 4px;
}

.tf-switch-card-body small {
    display: block;
    color: #64748b;
    line-height: 1.5;
}

.tf-switch-card input:checked + .tf-switch-card-body {
    border-color: rgba(23, 97, 216, .4);
    box-shadow: 0 12px 24px rgba(23, 97, 216, .10);
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(42, 118, 244, .05), #fff);
}

.tf-type-card {
    transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.tf-type-card:hover,
.tf-type-card.is-active {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .08);
    outline: 2px solid rgba(23, 97, 216, .18);
}

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

.tf-context-card {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
}

.tf-pro-document-preview h5 {
    font-size: 1rem;
    margin-bottom: .5rem;
}

.tf-timeline {
    display: grid;
    gap: 16px;
}

.tf-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 12px;
}

.tf-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 6px;
    background: #1761d8;
    box-shadow: 0 0 0 4px rgba(23, 97, 216, .10);
}

.tf-specialty-card {
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--tf-accent) 12%, white), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .96));
}

.tf-specialty-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, .09);
    border-color: color-mix(in srgb, var(--tf-accent) 28%, white);
}

.tf-specialty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: color-mix(in srgb, var(--tf-accent) 14%, white);
    color: var(--tf-accent);
    font-size: 24px;
}

.tf-library-locked {
    position: relative;
    overflow: hidden;
}

.tf-library-locked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.48));
    pointer-events: none;
}

.tf-ai-context {
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
}

.tf-ai-context-item + .tf-ai-context-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .16);
}

.tf-ai-result-card {
    min-height: 280px;
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    background: linear-gradient(180deg, rgba(248, 250, 252, .9), #fff);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    padding: 20px;
    font-family: inherit;
    line-height: 1.75;
    color: #0f172a;
}

.tf-glass-alert {
    background: linear-gradient(135deg, rgba(59, 130, 246, .10), rgba(20, 184, 166, .08));
    backdrop-filter: blur(10px);
}

.tf-assistant-accordion .accordion-item {
    background: transparent;
}

.tf-assistant-accordion .accordion-button {
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .88);
    gap: 14px;
}

.tf-step-chip {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(20, 184, 166, .16));
    color: #1d4ed8;
    font-weight: 700;
    flex: 0 0 auto;
}

.tf-gradient-btn {
    background: linear-gradient(135deg, #1761d8, #0ea5e9 56%, #14b8a6);
    border: 0;
    box-shadow: 0 18px 30px rgba(23, 97, 216, .18);
}

.tf-assistant-list-card {
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tf-assistant-list-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 40px rgba(15, 23, 42, .08);
    border-color: rgba(23, 97, 216, .22);
}

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

.tf-ai-section-card {
    border: 1px solid rgba(148, 163, 184, .16);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .04);
}

.tf-ai-section-alert {
    border-color: rgba(239, 68, 68, .20);
    background: linear-gradient(180deg, rgba(254, 242, 242, .88), #fff);
}

.tf-ai-section-content {
    color: #0f172a;
    line-height: 1.75;
}

.tf-ai-section-content p + p,
.tf-ai-section-content p + ul,
.tf-ai-section-content ul + p,
.tf-ai-section-content ul + ul {
    margin-top: 12px;
}

.tf-ai-section-content ul {
    padding-left: 1.15rem;
}

.tf-ai-review-alert {
    background: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(20, 184, 166, .04));
}

.tf-assistant-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.tf-assistant-loading-card {
    width: min(560px, 100%);
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 60px rgba(15, 23, 42, .18);
}

.tf-assistant-steps {
    display: grid;
    gap: 14px;
}

.tf-assistant-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    transition: color .18s ease;
}

.tf-assistant-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .45);
    box-shadow: 0 0 0 5px rgba(148, 163, 184, .12);
    transition: all .18s ease;
}

.tf-assistant-step.is-active,
.tf-assistant-step.is-complete {
    color: #0f172a;
}

.tf-assistant-step.is-active .tf-assistant-step-dot {
    background: #1761d8;
    box-shadow: 0 0 0 5px rgba(23, 97, 216, .12);
}

.tf-assistant-step.is-complete .tf-assistant-step-dot {
    background: #14b8a6;
    box-shadow: 0 0 0 5px rgba(20, 184, 166, .12);
}

.tf-schedule-card {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
    padding: 18px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .045);
}

@media (max-width: 991.98px) {
    .tf-paper-preview {
        min-height: auto;
        padding: 28px;
    }

    .tf-document-editor {
        min-height: 320px;
    }

    .tf-sticky-card {
        position: static;
        top: auto;
    }

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