/* ==========================================================================
   TaskFlow Design System - Exact Replica of Reference UI
   ========================================================================== */

:root {
    --tf-primary: #2563eb;
    --tf-primary-hover: #1d4ed8;
    --tf-primary-soft: #eff6ff;
    --tf-primary-border: #bfdbfe;
    
    --tf-bg: #f8fafc;
    --tf-surface: #ffffff;
    --tf-border: #edf2f7;
    --tf-border-dark: #e2e8f0;
    
    --tf-text: #0f172a;
    --tf-text-secondary: #334155;
    --tf-muted: #64748b;
    --tf-light: #94a3b8;
    
    --tf-sidebar-w: 248px;
    --tf-sidebar-collapsed: 72px;
    --tf-nav-h: 64px;
    
    --tf-radius: 14px;
    --tf-radius-sm: 8px;
    --tf-radius-pill: 999px;
    
    --tf-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.03);
    --tf-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    --tf-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --tf-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);

    --tf-critical: #dc2626;
    --tf-danger: #ef4444;
    --tf-warning: #f97316;
    --tf-amber: #f59e0b;
    --tf-success: #22c55e;
    --tf-purple: #8b5cf6;
    --tf-blue: #2563eb;
    --tf-low: #3b82f6;

    --tf-transition: 150ms ease;
    --tf-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body.tf-body {
    margin: 0;
    font-family: var(--tf-font);
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--tf-text);
    background: var(--tf-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--tf-text);
    font-weight: 650;
    letter-spacing: -0.02em;
}

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

button {
    font-family: inherit;
}

/* ==========================================================================
   Layout Shell & Sidebar
   ========================================================================== */

.tf-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--tf-sidebar-w);
    background: var(--tf-surface);
    border-right: 1px solid var(--tf-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--tf-transition), transform var(--tf-transition);
}

.tf-shell {
    margin-left: var(--tf-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--tf-transition);
}

.tf-body.is-collapsed .tf-sidebar {
    width: var(--tf-sidebar-collapsed);
}

.tf-body.is-collapsed .tf-shell {
    margin-left: var(--tf-sidebar-collapsed);
}

.tf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1035;
}

/* Brand */
.tf-sidebar__top {
    display: flex;
    align-items: center;
    padding: 18px 20px 10px;
    min-height: var(--tf-nav-h);
}

.tf-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.03em;
    color: var(--tf-text);
}

.tf-brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--tf-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Workspace Switcher */
.tf-workspace-wrap {
    padding: 6px 14px 14px;
}

.tf-workspace {
    width: 100%;
    border: 1px solid var(--tf-border-dark);
    background: var(--tf-surface);
    border-radius: 11px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    color: var(--tf-text);
    transition: border-color var(--tf-transition), box-shadow var(--tf-transition);
}

.tf-workspace:hover {
    border-color: #cbd5e1;
}

.tf-workspace__icon-box {
    width: 26px;
    height: 26px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tf-primary);
    font-size: 13px;
    flex-shrink: 0;
    background: #fff;
}

.tf-workspace__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tf-workspace__label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tf-light);
    line-height: 1;
    margin-bottom: 2px;
}

.tf-workspace__name {
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.tf-workspace__caret {
    font-size: 11px;
    color: var(--tf-light);
}

/* Nav */
.tf-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 14px;
}

.tf-nav::-webkit-scrollbar {
    width: 4px;
}
.tf-nav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.tf-nav__section {
    margin: 14px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tf-light);
}

.tf-nav__item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    color: #475569;
    font-weight: 500;
    font-size: 13px;
    transition: background var(--tf-transition), color var(--tf-transition);
}

.tf-nav__group {
    margin: 2px 0;
}

.tf-nav__toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.tf-nav__toggle.is-active {
    background: var(--tf-primary-soft);
}

.tf-nav__caret {
    width: auto !important;
    margin-left: auto;
    color: var(--tf-light) !important;
    font-size: 10px !important;
    transition: transform var(--tf-transition);
}

.tf-nav__group.is-open .tf-nav__caret {
    transform: rotate(180deg);
}

.tf-nav__subitems {
    position: relative;
    display: grid;
    gap: 2px;
    margin: 3px 0 5px 20px;
    padding: 3px 0 3px 16px;
}

.tf-nav__subitems[hidden] {
    display: none;
}

.tf-nav__subitems::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5px;
    width: 1px;
    background: var(--tf-border-dark);
    content: "";
}

.tf-nav__subitem {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--tf-muted);
    font-size: 12px;
    font-weight: 500;
    transition: background var(--tf-transition), color var(--tf-transition);
}

.tf-nav__subitem:hover {
    background: #f8fafc;
    color: var(--tf-text);
}

.tf-nav__subitem.is-active {
    background: #f1f6ff;
    color: var(--tf-primary);
    font-weight: 600;
}

.tf-nav__subitem-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border: 1.5px solid #94a3b8;
    border-radius: 50%;
    background: #fff;
}

.tf-nav__subitem.is-active .tf-nav__subitem-dot {
    border-color: var(--tf-primary);
    background: var(--tf-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tf-nav__item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    color: #64748b;
}

.tf-nav__item:hover {
    background: #f8fafc;
    color: var(--tf-text);
}

.tf-nav__item.is-active {
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
    font-weight: 600;
}

.tf-nav__item.is-active i {
    color: var(--tf-primary);
}

.tf-badge {
    margin-left: auto;
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: var(--tf-radius-pill);
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Bottom */
.tf-sidebar__bottom {
    border-top: 1px solid var(--tf-border);
    padding: 10px 12px 16px;
}

.tf-user {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--tf-transition);
}

.tf-user:hover {
    background: #f8fafc;
}

.tf-user__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tf-user__name {
    font-weight: 650;
    font-size: 13px;
    line-height: 1.2;
    color: var(--tf-text);
}

.tf-user__role {
    font-size: 11px;
    color: var(--tf-muted);
}

.tf-user__more {
    color: var(--tf-light);
    font-size: 14px;
}

/* Collapsed Sidebar adjustments */
.tf-body.is-collapsed .tf-brand__text,
.tf-body.is-collapsed .tf-workspace__copy,
.tf-body.is-collapsed .tf-workspace__caret,
.tf-body.is-collapsed .tf-nav__section,
.tf-body.is-collapsed .tf-nav__item span,
.tf-body.is-collapsed .tf-nav__caret,
.tf-body.is-collapsed .tf-nav__subitems,
.tf-body.is-collapsed .tf-badge,
.tf-body.is-collapsed .tf-user__copy,
.tf-body.is-collapsed .tf-user__more {
    display: none;
}

.tf-body.is-collapsed .tf-workspace {
    justify-content: center;
    padding: 8px;
    width: auto;
}

.tf-body.is-collapsed .tf-nav__item {
    justify-content: center;
    padding: 0;
}

.tf-body.is-collapsed .tf-user {
    justify-content: center;
    padding: 6px;
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.tf-navbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--tf-nav-h);
    background: var(--tf-surface);
    border-bottom: 1px solid var(--tf-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}

.tf-search {
    width: 440px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--tf-border-dark);
    border-radius: 11px;
    padding: 0 14px;
    height: 38px;
    color: var(--tf-light);
    transition: border-color var(--tf-transition), background var(--tf-transition), box-shadow var(--tf-transition);
}

.tf-search i {
    font-size: 14px;
    color: var(--tf-light);
}

.tf-search input {
    border: 0;
    background: transparent;
    outline: none;
    flex: 1;
    min-width: 0;
    color: var(--tf-text);
    font-size: 13px;
    font-family: inherit;
}

.tf-search input::placeholder {
    color: var(--tf-light);
}

.tf-search:focus-within {
    background: #fff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tf-navbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.tf-icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--tf-transition), color var(--tf-transition);
}

.tf-icon-btn:hover {
    background: #f1f5f9;
    color: var(--tf-text);
}

.tf-icon-btn--sm {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.tf-bell {
    position: relative;
}

.tf-bell__dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tf-danger);
    border: 1.5px solid #fff;
}

/* User Avatars */
.tf-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: var(--tf-primary);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
}

.tf-avatar--nav {
    background: #e0e7ff;
    color: #4338ca;
}

.tf-avatar-btn {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
}

.tf-avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.tf-avatar--aa { background: #dbeafe; color: #1d4ed8; }
.tf-avatar--rk { background: #f3e8ff; color: #7e22ce; }
.tf-avatar--as { background: #fee2e2; color: #b91c1c; }
.tf-avatar--aj { background: #dcfce7; color: #15803d; }

/* Buttons */
.tf-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    color: var(--tf-text-secondary);
    transition: background var(--tf-transition), border-color var(--tf-transition), box-shadow var(--tf-transition), transform 80ms ease;
    cursor: pointer;
}

.tf-btn:active {
    transform: scale(0.99);
}

.tf-btn--primary {
    background: var(--tf-primary);
    color: #fff;
    border: 0;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

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

.tf-btn--create {
    padding: 0 16px;
    font-size: 13.5px;
}
.tf-btn--create i {
    font-size: 18px;
    stroke-width: 1px;
}

.tf-btn--ghost {
    background: #fff;
    border: 1px solid var(--tf-border-dark);
    color: #334155;
}

.tf-btn--ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--tf-text);
}

.tf-btn--sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
}

.tf-btn--date {
    gap: 8px;
}
.tf-btn--date i {
    color: #64748b;
}

.tf-text-link {
    color: var(--tf-primary);
    font-weight: 600;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--tf-transition);
}

.tf-text-link:hover {
    color: var(--tf-primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Main Page Layout
   ========================================================================== */

.tf-main {
    padding: 22px 28px 48px;
    width: 100%;
}

.tf-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.tf-page-head h1 {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tf-text);
}

.tf-wave {
    font-size: 22px;
}

.tf-page-head p {
    margin: 4px 0 0;
    color: var(--tf-muted);
    font-size: 13.5px;
}

.tf-page-head__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid System */
.tf-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.tf-grid--65-35 {
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
}

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

/* Cards */
.tf-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    box-shadow: var(--tf-shadow-sm);
    padding: 18px 20px 18px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.tf-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tf-card__head--tabs {
    align-items: center;
}

.tf-card__title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tf-card__title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tf-card__title h2 {
    font-size: 15px;
    font-weight: 650;
    color: var(--tf-text);
    line-height: 1.25;
}

.tf-card__title p {
    margin: 2px 0 0;
    color: var(--tf-muted);
    font-size: 12px;
}

.tf-card__icon {
    font-size: 16px;
    color: var(--tf-text);
    margin-top: 1px;
}

.tf-card__foot {
    margin: 12px 0 0;
    color: var(--tf-muted);
    font-size: 12px;
}

/* ==========================================================================
   KPI Cards (5 across)
   ========================================================================== */

.tf-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.tf-kpi {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    box-shadow: var(--tf-shadow-sm);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 112px;
    transition: box-shadow var(--tf-transition), border-color var(--tf-transition);
}

.tf-kpi:hover {
    box-shadow: var(--tf-shadow-md);
    border-color: #cbd5e1;
}

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

.tf-kpi__top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tf-kpi__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.tf-kpi__icon--primary {
    background: #eff6ff;
    color: var(--tf-primary);
}

.tf-kpi__icon--danger {
    background: #fef2f2;
    color: var(--tf-danger);
}

.tf-kpi__icon--success {
    background: #f0fdf4;
    color: var(--tf-success);
}

.tf-kpi__label {
    margin: 0;
    color: var(--tf-muted);
    font-size: 12.5px;
    font-weight: 500;
}

.tf-kpi__value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 2px;
}

.tf-kpi__value {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--tf-text);
}

.tf-kpi__value.is-danger {
    color: var(--tf-danger);
}

.tf-kpi__spark {
    width: 84px;
    height: 32px;
    position: relative;
    flex-shrink: 0;
}

.tf-kpi__spark canvas {
    width: 100% !important;
    height: 100% !important;
}

.tf-kpi__meta {
    margin: 0;
    color: var(--tf-muted);
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tf-kpi__arrow {
    color: var(--tf-success);
    font-size: 9px;
}

.tf-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: var(--tf-light);
}

.tf-dot--danger, .tf-dot--critical { background: var(--tf-danger); }
.tf-dot--warning, .tf-dot--high { background: var(--tf-warning); }
.tf-dot--amber, .tf-dot--medium { background: var(--tf-amber); }
.tf-dot--success, .tf-dot--completed { background: var(--tf-success); }
.tf-dot--blue, .tf-dot--low { background: var(--tf-blue); }

/* ==========================================================================
   Chart Components
   ========================================================================== */

.tf-chart-wrap {
    position: relative;
    width: 100%;
    height: 230px;
}

.tf-chart-wrap--workload {
    height: 190px;
}

/* Thursday Active Tooltip on Completion Chart */
.tf-thu-tooltip {
    position: absolute;
    top: 24px;
    left: 57.1%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid var(--tf-border-dark);
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.tf-thu-tooltip__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--tf-text);
    line-height: 1.2;
}

.tf-thu-tooltip__sub {
    font-size: 10.5px;
    color: var(--tf-muted);
    line-height: 1.2;
    margin-top: 2px;
}

.tf-thu-tooltip__caret {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-right: 1px solid var(--tf-border-dark);
    border-bottom: 1px solid var(--tf-border-dark);
}

/* Task Status Donut & Legend */
.tf-status-chart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 8px 6px;
    flex: 1;
}

.tf-doughnut {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.tf-doughnut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tf-doughnut__label {
    font-size: 11px;
    color: var(--tf-muted);
    font-weight: 500;
}

.tf-doughnut__val {
    font-size: 24px;
    font-weight: 700;
    color: var(--tf-text);
    line-height: 1.1;
}

.tf-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #475569;
}

.tf-legend__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tf-legend__name {
    font-weight: 500;
    color: #334155;
    flex: 1;
}

.tf-legend__count {
    font-weight: 700;
    color: var(--tf-text);
    margin-right: 10px;
}

.tf-legend__pct {
    color: var(--tf-light);
    font-size: 11.5px;
    min-width: 28px;
    text-align: right;
}

/* Priority Overview List (Horizontal Rows) */
.tf-priority-overview-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.tf-priority-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tf-priority-row__label {
    width: 78px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.tf-priority-row__track {
    flex: 1;
    height: 6px;
    background: #f1f5f9;
    border-radius: var(--tf-radius-pill);
    overflow: hidden;
}

.tf-priority-row__bar {
    display: block;
    height: 100%;
    border-radius: var(--tf-radius-pill);
}

.tf-priority-row__bar--critical { background: var(--tf-danger); }
.tf-priority-row__bar--high { background: var(--tf-warning); }
.tf-priority-row__bar--medium { background: var(--tf-amber); }
.tf-priority-row__bar--low { background: var(--tf-blue); }

.tf-priority-row__count {
    width: 22px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tf-text);
    flex-shrink: 0;
}

/* ==========================================================================
   Tabs & Task Table
   ========================================================================== */

.tf-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border-radius: var(--tf-radius-pill);
    padding: 3px;
    border: 1px solid var(--tf-border);
}

.tf-tabs button {
    border: 0;
    background: transparent;
    color: var(--tf-muted);
    font-weight: 500;
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: var(--tf-radius-pill);
    cursor: pointer;
    transition: background var(--tf-transition), color var(--tf-transition);
}

.tf-tabs button:hover {
    color: var(--tf-text);
}

.tf-tabs button.is-active {
    background: #fff;
    color: var(--tf-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.tf-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
}

.tf-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.tf-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tf-light);
    padding: 10px 12px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-table td {
    padding: 12px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    font-size: 13px;
}

.tf-table tbody tr {
    transition: background var(--tf-transition);
}

.tf-table tbody tr:hover {
    background: #f8fafc;
}

/* Task cell */
.tf-task {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.tf-check {
    margin-top: 3px;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid var(--tf-border-dark);
    accent-color: var(--tf-primary);
    cursor: pointer;
}

.tf-task__info {
    display: flex;
    flex-direction: column;
}

.tf-task__title {
    font-weight: 600;
    color: var(--tf-text);
    font-size: 13px;
    line-height: 1.25;
}

.tf-task__id {
    font-size: 11.5px;
    color: var(--tf-light);
    margin-top: 2px;
}

.tf-project {
    color: #475569;
    font-size: 12.5px;
}

/* Priority & Status Badges */
.tf-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: var(--tf-radius-pill);
    font-size: 12px;
    font-weight: 500;
}

.tf-priority-badge--critical {
    background: #fef2f2;
    color: #dc2626;
}

.tf-priority-badge--high {
    background: #fff7ed;
    color: #ea580c;
}

.tf-priority-badge--medium {
    background: #fefce8;
    color: #ca8a04;
}

.tf-priority-badge--low {
    background: #f1f5f9;
    color: #475569;
}

.tf-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--tf-radius-pill);
    font-size: 12px;
    font-weight: 500;
}

.tf-status-badge--todo {
    background: #f1f5f9;
    color: #475569;
}

.tf-status-badge--in_progress {
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
}

.tf-status-badge--in_review {
    background: #fffbeb;
    color: #b45309;
}

.tf-status-badge--completed {
    background: #f0fdf4;
    color: var(--tf-success);
}

.tf-due {
    font-size: 12.5px;
    color: #64748b;
}

.tf-due--today {
    color: #ea580c;
    font-weight: 600;
}

.tf-due--overdue {
    color: var(--tf-danger);
    font-weight: 600;
}

.tf-assignee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tf-assignee__name {
    font-size: 12.5px;
    color: #334155;
    font-weight: 500;
}

.tf-actions {
    text-align: right;
    width: 36px;
}

.tf-icon-btn--more {
    color: var(--tf-light);
}

/* ==========================================================================
   Upcoming Deadlines
   ========================================================================== */

.tf-deadlines-wrap {
    display: flex;
    flex-direction: column;
}

.tf-deadline-group {
    margin-bottom: 12px;
}

.tf-group-label {
    margin: 10px 0 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tf-light);
}

.tf-deadline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.tf-deadline-item .tf-dot {
    margin-top: 6px;
}

.tf-deadline-item__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.tf-deadline-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tf-text);
    line-height: 1.25;
}

.tf-deadline-item__sub {
    font-size: 12px;
    color: var(--tf-muted);
    margin-top: 2px;
}

.tf-deadline-item__time {
    font-size: 12px;
    color: var(--tf-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* ==========================================================================
   Dropdowns, Modals & Toast
   ========================================================================== */

.tf-menu,
.tf-dropdown {
    border: 1px solid var(--tf-border-dark);
    border-radius: 12px;
    box-shadow: var(--tf-shadow-md);
    font-size: 13px;
    padding: 6px;
    background: #fff;
}

.tf-menu .dropdown-item {
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: #334155;
}

.tf-menu .dropdown-item:hover {
    background: #f8fafc;
    color: var(--tf-text);
}

.tf-menu .dropdown-item.active {
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
    font-weight: 600;
}

.tf-dropdown--wide {
    width: 320px;
    padding: 0;
}

.tf-dropdown__head,
.tf-dropdown__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
}

.tf-dropdown__foot {
    border-top: 1px solid var(--tf-border);
    color: var(--tf-primary);
    font-weight: 600;
    justify-content: center;
}

.tf-notify {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    color: var(--tf-text);
}

.tf-notify:hover {
    background: #f8fafc;
}

.tf-notify.is-unread {
    background: var(--tf-primary-soft);
}

.tf-notify__dot {
    width: 6px;
    height: 6px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.tf-notify.is-unread .tf-notify__dot {
    background: var(--tf-primary);
}

.tf-notify__title {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
}

.tf-notify__body {
    display: block;
    font-size: 12px;
    color: var(--tf-muted);
}

.tf-notify__time {
    display: block;
    color: var(--tf-light);
    font-size: 11px;
    margin-top: 2px;
}

.tf-link-btn {
    border: 0;
    background: none;
    color: var(--tf-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Toast */
.tf-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: min(440px, calc(100vw - 32px));
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid #86efac;
    border-left: 4px solid #16a34a;
    border-radius: 13px;
    background: #f0fdf4;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 11px;
    z-index: 1090;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 7px rgba(15, 23, 42, 0.06);
    font-size: 12.5px;
    font-weight: 550;
    animation: tf-toast-enter 220ms ease-out both;
}

.tf-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 16px;
}

.tf-toast--active {
    border-color: #86efac;
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #14532d;
}

.tf-toast--active .tf-toast__icon {
    background: #16a34a;
    color: #fff;
}

.tf-toast--inactive {
    border-color: #fda4af;
    border-left-color: #e11d48;
    background: #fff1f2;
    color: #881337;
}

.tf-toast--inactive .tf-toast__icon {
    background: #e11d48;
    color: #fff;
}

.tf-toast--success {
    border-color: #86efac;
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #14532d;
}

.tf-toast--success .tf-toast__icon {
    background: #16a34a;
    color: #fff;
}

.tf-toast__message {
    min-width: 0;
    flex: 1;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tf-toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.tf-toast__close:hover {
    background: #f1f5f9;
    color: #475569;
}

.tf-toast--inactive .tf-toast__close {
    color: #be123c;
}

.tf-toast--inactive .tf-toast__close:hover {
    background: #ffe4e6;
    color: #9f1239;
}

.tf-toast[hidden] {
    display: none;
}

.tf-operation[hidden] {
    display: none;
}

.tf-operation {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
}

.tf-operation__card {
    position: relative;
    display: flex;
    width: min(340px, 100%);
    flex-direction: column;
    align-items: center;
    padding: 26px 25px 24px;
    border: 1px solid #e8ebf3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
    text-align: center;
    animation: tf-operation-enter 180ms ease-out both;
}

.tf-operation__dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.tf-operation__dismiss:hover {
    background: #f1f5f9;
    color: #475569;
}

.tf-operation__indicator {
    display: inline-flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    margin-bottom: 13px;
    border-radius: 50%;
    background: #eef2ff;
    color: #6366f1;
    font-size: 21px;
}

.tf-operation__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid #c7d2fe;
    border-top-color: #625cf5;
    border-radius: 50%;
    animation: tf-operation-spin 750ms linear infinite;
}

.tf-operation__card > h2 {
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
}

.tf-operation__card > p {
    max-width: 270px;
    margin: 5px 0 0;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.5;
}

.tf-operation__transition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 13px;
    color: #94a3b8;
    font-size: 11px;
}

.tf-operation__status {
    display: inline-flex;
    min-width: 47px;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: capitalize;
}

.tf-operation__status--active {
    background: #dcfce7;
    color: #15803d;
}

.tf-operation__status--inactive {
    background: #ffe4e6;
    color: #be123c;
}

.tf-operation__close {
    height: 33px;
    min-width: 84px;
    margin-top: 17px;
    font-size: 11px;
}

.tf-operation--complete .tf-operation__indicator {
    background: #dcfce7;
    color: #15803d;
}

.tf-operation--inactive.tf-operation--complete .tf-operation__indicator {
    background: #ffe4e6;
    color: #be123c;
}

.tf-operation--inactive .tf-operation__spinner {
    border-color: #fecdd3;
    border-top-color: #e11d48;
}

.tf-operation--active .tf-operation__spinner {
    border-color: #bbf7d0;
    border-top-color: #16a34a;
}

@keyframes tf-operation-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tf-operation-enter {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tf-operation__spinner {
        animation-duration: 2s;
    }

    .tf-operation__card {
        animation: none;
    }
}

@keyframes tf-toast-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .tf-toast {
        right: 12px;
        bottom: 12px;
        max-width: calc(100vw - 24px);
    }
}

/* Modal */
.tf-modal {
    border: 0;
    border-radius: 16px;
    box-shadow: var(--tf-shadow-lg);
}

.tf-modal .modal-header,
.tf-modal .modal-footer {
    border-color: var(--tf-border);
    padding: 16px 20px;
}

.tf-modal .modal-title {
    font-size: 16px;
    font-weight: 700;
}

.tf-label {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.tf-label span {
    color: var(--tf-danger);
}

.tf-input {
    border-radius: 9px;
    border-color: var(--tf-border-dark);
    font-size: 13px;
    padding: 8px 12px;
}

.tf-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tf-management__breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: -8px 0 18px;
    color: var(--tf-light);
    font-size: 12px;
}

.tf-management__breadcrumb a {
    color: var(--tf-muted);
}

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

.tf-management__filters {
    margin-bottom: 16px;
}

.tf-management__filters .tf-card {
    padding: 16px 18px;
}

.tf-management__filters .form-label,
.tf-management__form .form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--tf-text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.tf-management__filters .form-control,
.tf-management__filters .form-select,
.tf-management__form .form-control,
.tf-management__form .form-select {
    min-height: 38px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 9px;
    color: var(--tf-text);
    font-family: var(--tf-font);
    font-size: 13px;
    box-shadow: none;
}

.tf-management__filters .form-control:focus,
.tf-management__filters .form-select:focus,
.tf-management__form .form-control:focus,
.tf-management__form .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tf-management__table-card {
    padding: 0;
    overflow: hidden;
}

.tf-management__table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-management__table-heading h2 {
    font-size: 14px;
}

.tf-management__table-heading p {
    margin: 3px 0 0;
    color: var(--tf-muted);
    font-size: 12px;
}

.tf-management__table-card .tf-table {
    min-width: 960px;
}

.tf-management__table-card .tf-table th {
    white-space: nowrap;
}

.tf-management__table-card .tf-table td {
    color: var(--tf-text-secondary);
}

.tf-user-management {
    padding: 0;
    overflow: hidden;
}

.tf-user-tabs {
    display: flex;
    align-items: stretch;
    gap: 22px;
    min-height: 40px;
    padding: 0 16px;
    border-bottom: 1px solid var(--tf-border);
    overflow-x: auto;
}

.tf-user-tabs__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    color: var(--tf-muted);
    font-size: 11.5px;
    font-weight: 500;
}

.tf-user-tabs__item:hover,
.tf-user-tabs__item.is-active {
    color: var(--tf-text);
}

.tf-user-tabs__item.is-active {
    font-weight: 600;
}

.tf-user-tabs__item.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--tf-primary);
    content: "";
}

.tf-user-tabs__count {
    min-width: 17px;
    padding: 1px 5px;
    border-radius: var(--tf-radius-pill);
    background: #f1f5f9;
    color: var(--tf-muted);
    font-size: 9.5px;
    line-height: 1.35;
    text-align: center;
}

.tf-user-tabs__item.is-active .tf-user-tabs__count {
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
}

.tf-user-tabs__item--active .tf-user-tabs__count {
    background: #f0fdf4;
    color: #15803d;
}

.tf-user-tabs__item--inactive .tf-user-tabs__count {
    background: #fef2f2;
    color: #dc2626;
}

.tf-user-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-user-toolbar__search-form {
    display: flex;
    min-width: 0;
}

.tf-user-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 220px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 7px;
    color: var(--tf-light);
}

.tf-user-search:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tf-user-search i {
    font-size: 11px;
}

.tf-user-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--tf-text);
    font-family: var(--tf-font);
    font-size: 10.5px;
}

.tf-user-search input::placeholder {
    color: var(--tf-muted);
}

.tf-user-toolbar__select {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 30px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 7px;
    background: #fff;
}

.tf-user-toolbar__select select {
    max-width: 120px;
    height: 100%;
    padding: 0 24px 0 9px;
    appearance: none;
    border: 0;
    outline: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--tf-text-secondary);
    font-family: var(--tf-font);
    font-size: 10.5px;
    cursor: pointer;
}

.tf-user-toolbar__select > i {
    position: absolute;
    right: 8px;
    color: var(--tf-muted);
    font-size: 9px;
    pointer-events: none;
}

.tf-user-toolbar__filters {
    height: 30px;
    margin-left: auto;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 10.5px;
}

.tf-user-toolbar__filters i {
    font-size: 11px;
}

.tf-user-toolbar__reset {
    font-size: 11px;
}

.tf-user-advanced {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tf-border);
    background: #fbfcfe;
}

.tf-user-advanced .form-label {
    display: block;
    margin-bottom: 5px;
    color: var(--tf-muted);
    font-size: 10.5px;
    font-weight: 600;
}

.tf-user-advanced .form-control,
.tf-user-advanced .form-select {
    min-height: 32px;
    border-color: var(--tf-border-dark);
    border-radius: 7px;
    font-size: 11px;
    box-shadow: none;
}

.tf-user-advanced__actions {
    display: flex;
    gap: 6px;
}

.tf-user-advanced__actions .tf-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 10.5px;
}

.tf-user-filter-dropdown .tf-user-filter-menu {
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 100px);
    margin-top: 8px;
    padding: 0;
    overflow-y: auto;
    border: 1px solid var(--tf-border);
    border-radius: 14px;
    background: var(--tf-surface);
    box-shadow: var(--tf-shadow-lg);
}

.tf-user-filter-menu__header {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-user-filter-menu__header h2 {
    color: var(--tf-text);
    font-size: 15px;
    font-weight: 650;
}

.tf-user-filter-menu__header p {
    margin-top: 3px;
    color: var(--tf-muted);
    font-size: 11.5px;
}

.tf-user-filter-menu .tf-user-filter-grid {
    padding: 16px 18px;
}

.tf-user-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tf-user-filter-grid .form-label {
    display: block;
    margin-bottom: 5px;
    color: var(--tf-text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}

.tf-user-filter-grid .form-control,
.tf-user-filter-grid .form-select {
    min-height: 36px;
    border-color: var(--tf-border-dark);
    border-radius: 8px;
    font-size: 12px;
    box-shadow: none;
}

.tf-user-filter-grid .form-control:focus,
.tf-user-filter-grid .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tf-user-filter-menu__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--tf-border);
    background: #fbfcfe;
}

.tf-user-filter-menu__footer .tf-btn {
    height: 34px;
    font-size: 11.5px;
}

.tf-user-table-wrap {
    margin-top: 0;
}

.tf-user-table {
    min-width: 1050px;
}

.tf-management__table-card .tf-user-table {
    min-width: 1050px;
}

.tf-user-table.tf-organization-table {
    min-width: 820px;
}

.tf-user-table th {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 10.5px;
    letter-spacing: 0.06em;
}

.tf-user-table td {
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 12px;
    white-space: nowrap;
}

.tf-user-table th,
.tf-user-table td {
    text-align: left;
}

.tf-user-table .tf-user-table__check,
.tf-user-table th:last-child,
.tf-user-table td:last-child {
    text-align: center;
}

.tf-user-table__check {
    width: 36px;
    text-align: center !important;
}

.tf-user-table .tf-check {
    margin: 0;
    width: 13px;
    height: 13px;
    accent-color: var(--tf-primary);
    vertical-align: middle;
}

.tf-user-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 155px;
}

.tf-user-row__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 700;
}

.tf-user-table tbody tr:nth-child(6n + 2) .tf-user-row__avatar { background: #ffedd5; color: #c2410c; }
.tf-user-table tbody tr:nth-child(6n + 3) .tf-user-row__avatar { background: #ccfbf1; color: #0f766e; }
.tf-user-table tbody tr:nth-child(6n + 4) .tf-user-row__avatar { background: #fce7f3; color: #be185d; }
.tf-user-table tbody tr:nth-child(6n + 5) .tf-user-row__avatar { background: #e0e7ff; color: #4338ca; }
.tf-user-table tbody tr:nth-child(6n) .tf-user-row__avatar { background: #dcfce7; color: #15803d; }

.tf-user-row__identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tf-user-row__identity strong {
    color: var(--tf-text);
    font-size: 12px;
    font-weight: 600;
}

.tf-user-row__identity small {
    color: var(--tf-muted);
    font-size: 10.5px;
}

.tf-user-row__designation {
    display: block;
    max-width: 170px;
    overflow: hidden;
    color: var(--tf-text);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
}

.tf-user-row__department {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 5px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 10.5px;
}

.tf-user-row__employee-id {
    display: inline-flex;
    padding: 3px 6px;
    border: 1px solid #e9edf3;
    border-radius: 5px;
    background: #f8fafc;
    color: var(--tf-text-secondary);
    font-size: 10px;
}

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

.tf-user-row__phone i {
    margin-right: 4px;
    color: var(--tf-light);
}

.tf-user-table .tf-management__status {
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
}

.tf-user-table .tf-management__status::before {
    width: 5px;
    height: 5px;
}

.tf-user-row__actions .tf-icon-btn {
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f1f5f9;
    color: var(--tf-muted);
}

.tf-user-row__actions .tf-icon-btn:hover {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: var(--tf-text);
}

.tf-user-row__actions {
    display: flex;
    justify-content: center;
}

.tf-user-row__actions .tf-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    background: #fff;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tf-user-row__actions .tf-icon-btn[aria-expanded="true"],
.tf-user-row__actions .tf-icon-btn:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.tf-user-action-menu {
    width: 226px;
    padding: 7px;
    border: 1px solid #e5eaf1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.05);
}

.tf-user-action-menu.tf-organization-action-menu--portal {
    position: fixed !important;
    z-index: 1080;
    display: block;
    margin: 0;
}

.tf-user-action-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 9px 9px;
    border-bottom: 1px solid #eef2f7;
}

.tf-user-action-menu__header strong {
    color: #334155;
    font-size: 10px;
    font-weight: 700;
}

.tf-user-action-menu__header small {
    max-width: 95px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 9px;
    text-overflow: ellipsis;
}

.tf-user-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 35px;
    gap: 9px;
    padding: 0 9px;
    border-radius: 7px;
    color: #475569;
    font-size: 11.5px;
    font-weight: 550;
}

.tf-user-action-menu .dropdown-item > i:first-child {
    width: 15px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.tf-user-action-menu .dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tf-user-action-menu .tf-user-action-menu__arrow {
    margin-left: auto;
    color: #a0aec0;
    font-size: 10px;
    opacity: 0;
}

.tf-user-action-menu .dropdown-item:hover .tf-user-action-menu__arrow {
    opacity: 1;
}

.tf-user-action-menu__status {
    margin-top: 4px;
    padding: 9px 9px 8px;
    border-top: 1px solid #eef2f7;
}

.tf-user-action-menu__status form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tf-user-action-menu__status-copy span,
.tf-user-action-menu__status-copy small {
    display: block;
}

.tf-user-action-menu__status-copy span {
    color: #334155;
    font-size: 10.5px;
    font-weight: 650;
}

.tf-user-action-menu__status-copy small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 9px;
}

.tf-user-action-menu .tf-user-status-toggle {
    width: 32px;
    height: 19px;
    flex-basis: 32px;
}

.tf-user-action-menu .tf-user-status-toggle span {
    width: 13px;
    height: 13px;
}

.tf-user-action-menu .tf-user-status-toggle[aria-checked="true"] span {
    transform: translateX(13px);
}

.tf-user-action-menu .tf-user-status-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tf-user-action-menu__divider {
    margin: 4px 0;
}

.tf-user-action-menu__divider .dropdown-divider {
    margin: 0;
    border-color: #eef2f7;
}

.tf-user-action-menu .dropdown-item.tf-user-action-menu__delete {
    color: #dc2626;
}

.tf-user-action-menu .dropdown-item.tf-user-action-menu__delete > i:first-child {
    color: #ef4444;
}

.tf-user-action-menu .dropdown-item.tf-user-action-menu__delete:hover {
    background: #fff1f2;
    color: #b91c1c;
}

.tf-management__primary {
    color: var(--tf-text);
    font-size: 13px;
    font-weight: 600;
}

.tf-management__secondary {
    display: block;
    margin-top: 2px;
    color: var(--tf-muted);
    font-size: 11.5px;
}

.tf-management__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: var(--tf-radius-pill);
    font-size: 11.5px;
    font-weight: 600;
}

.tf-management__status::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.tf-management__status--active {
    color: #15803d;
    background: #f0fdf4;
}

.tf-management__status--inactive {
    color: #64748b;
    background: #f1f5f9;
}

.tf-management__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tf-management__action {
    height: 29px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 11.5px;
}

.tf-management__table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--tf-border);
    color: var(--tf-muted);
    font-size: 12px;
}

.tf-management__table-footer .pagination {
    margin: 0;
    gap: 4px;
}

.tf-management__table-footer .page-link {
    padding: 5px 9px;
    border: 1px solid var(--tf-border);
    border-radius: 7px !important;
    color: var(--tf-muted);
    font-size: 12px;
    box-shadow: none;
}

.tf-management__table-footer .page-item.active .page-link {
    border-color: var(--tf-primary);
    background: var(--tf-primary);
    color: #fff;
}

.tf-management__form-card {
    max-width: 960px;
    margin: 0 auto;
}

.tf-management__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.tf-management__stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
}

.tf-management__stat > strong {
    color: var(--tf-text);
    font-size: 22px;
    font-weight: 700;
}

.tf-management__form-card .tf-card__head {
    margin-bottom: 20px;
}

.tf-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--tf-border);
}

.tf-management__field-error {
    margin-top: 5px;
    color: var(--tf-danger);
    font-size: 11.5px;
}

.tf-management__detail-label {
    margin-bottom: 4px;
    color: var(--tf-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tf-management__detail-value {
    color: var(--tf-text);
    font-size: 13px;
    font-weight: 600;
}

.tf-management__notice {
    margin-bottom: 16px;
    padding: 11px 14px;
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
}

.tf-management__notice--success {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.tf-management__notice--error {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.tf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
    text-align: center;
}

.tf-empty > i {
    margin-bottom: 10px;
    color: var(--tf-light);
    font-size: 24px;
}

.tf-empty h4 {
    font-size: 14px;
}

.tf-empty p {
    margin: 4px 0 0;
    color: var(--tf-muted);
    font-size: 12px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1320px) {
    .tf-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .tf-grid--65-35,
    .tf-grid--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .tf-sidebar {
        transform: translateX(-100%);
        width: var(--tf-sidebar-w);
    }

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

    .tf-body.sidebar-open .tf-overlay {
        display: block;
    }

    .tf-shell,
    .tf-body.is-collapsed .tf-shell {
        margin-left: 0;
    }

    .tf-search {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .tf-main {
        padding: 16px 14px 36px;
    }

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

    .tf-page-head {
        flex-direction: column;
    }

    .tf-status-chart-row {
        flex-direction: column;
    }

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

    .tf-management__table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .tf-user-toolbar {
        flex-wrap: wrap;
    }

    .tf-user-toolbar__search-form {
        flex: 1 1 100%;
    }

    .tf-user-search {
        width: 100%;
    }

    .tf-user-toolbar__filters {
        margin-left: 0;
    }

    .tf-user-advanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .tf-page-head__actions {
        width: 100%;
        flex-wrap: wrap;
    }

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

    .tf-management__table-footer .pagination {
        flex-wrap: wrap;
    }

    .tf-form-actions {
        flex-direction: column-reverse;
    }

    .tf-form-actions .tf-btn {
        width: 100%;
    }

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

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

@media (max-width: 520px) {
    .tf-kpi-row {
        grid-template-columns: 1fr;
    }
}

.tf-user-modal .modal-dialog {
    width: min(760px, calc(100vw - 32px));
    max-width: none;
}

.tf-user-modal .modal-content {
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
}

.tf-user-offcanvas__form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tf-user-offcanvas__header {
    flex: 0 0 auto;
    align-items: flex-start;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--tf-border-dark);
}

.tf-user-offcanvas__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--tf-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.tf-user-offcanvas__header h2 {
    font-size: 21px;
    font-weight: 700;
}

.tf-user-offcanvas__header p {
    margin: 4px 0 0;
    color: var(--tf-muted);
    font-size: 12px;
}

.tf-user-offcanvas__body {
    min-height: 0;
    padding: 4px 26px 24px;
}

.tf-user-offcanvas__section {
    padding: 20px 0;
    border-bottom: 1px solid var(--tf-border);
}

.tf-user-offcanvas__section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 700;
}

.tf-user-offcanvas__section h3 i {
    color: var(--tf-primary);
    font-size: 15px;
}

.tf-user-offcanvas__field {
    margin-bottom: 13px;
}

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

.tf-user-offcanvas__field--full {
    grid-column: 1 / -1;
}

.tf-user-offcanvas__field:last-child {
    margin-bottom: 0;
}

.tf-user-offcanvas__field > label {
    display: block;
    margin-bottom: 5px;
    color: var(--tf-text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}

.tf-user-offcanvas__field > label span {
    color: var(--tf-danger);
}

.tf-user-offcanvas__field .form-control,
.tf-user-offcanvas__field .form-select {
    min-height: 39px;
    border-color: var(--tf-border-dark);
    border-radius: 8px;
    color: var(--tf-text);
    font-size: 12px;
}

.tf-user-offcanvas__field .form-control:focus,
.tf-user-offcanvas__field .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tf-user-role-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tf-user-role-option {
    position: relative;
    cursor: pointer;
}

.tf-user-role-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.tf-user-role-option span {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 7px;
    background: #fff;
    color: var(--tf-text-secondary);
    font-size: 10.5px;
    font-weight: 600;
}

.tf-user-role-option input:checked + span {
    border-color: var(--tf-primary);
    background: var(--tf-primary-soft);
    color: var(--tf-primary);
}

.tf-user-role-option input:focus-visible + span {
    outline: 3px solid rgba(37, 99, 235, 0.2);
}

.tf-user-offcanvas__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 17px;
    padding: 12px;
    border: 1px solid var(--tf-border-dark);
    border-radius: 9px;
}

.tf-user-offcanvas__status strong,
.tf-user-offcanvas__status small {
    display: block;
}

.tf-user-offcanvas__status strong {
    font-size: 11.5px;
}

.tf-user-offcanvas__status small {
    margin-top: 2px;
    color: var(--tf-muted);
    font-size: 10.5px;
}

.tf-user-status-toggle {
    position: relative;
    width: 36px;
    height: 21px;
    flex: 0 0 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background var(--tf-transition);
}

.tf-user-status-toggle span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform var(--tf-transition);
}

.tf-user-status-toggle[aria-checked="true"] {
    background: var(--tf-success);
}

.tf-user-status-toggle[aria-checked="true"] span {
    transform: translateX(15px);
}

.tf-user-offcanvas__footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 26px;
    border-top: 1px solid var(--tf-border-dark);
    background: #fff;
}

@media (max-width: 620px) {
    .tf-user-modal .modal-dialog {
        width: calc(100vw - 20px);
    }

    .tf-user-offcanvas__header,
    .tf-user-offcanvas__footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .tf-user-offcanvas__body {
        padding-right: 18px;
        padding-left: 18px;
    }

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

    .tf-user-offcanvas__field--full {
        grid-column: auto;
    }
}

.tf-user-page-actions {
    gap: 9px;
}

.tf-user-action-btn {
    position: relative;
    min-height: 32px;
    height: 31px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.045);
}

.tf-user-action-btn i {
    font-size: 13px;
}

.tf-user-action-btn--filter {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.tf-user-action-btn--filter:hover {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1e40af;
}

.tf-user-action-btn--export {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.tf-user-action-btn--export:hover {
    border-color: #6ee7b7;
    background: #d1fae5;
    color: #065f46;
}

.tf-user-bulk-delete-form {
    display: flex;
    align-items: center;
}

.tf-user-bulk-delete-form[hidden] {
    display: none;
}

.tf-user-action-btn--bulk-delete {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.tf-user-action-btn--bulk-delete:hover {
    border-color: #fda4af;
    background: #ffe4e6;
    color: #9f1239;
}

.tf-user-bulk-delete-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(190, 18, 60, 0.12);
    font-size: 10px;
    font-weight: 700;
}

.tf-user-action-btn--add {
    padding: 0 14px;
    background: linear-gradient(135deg, #3478f6, #245bd9);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.17);
}

.tf-user-action-btn--add:hover {
    background: linear-gradient(135deg, #2868e8, #1d4ed8);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.23);
    transform: translateY(-1px);
}

.tf-user-filter-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tf-primary);
    box-shadow: 0 0 0 3px var(--tf-primary-soft);
}

.tf-user-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 18px;
}

.tf-user-summary__card {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    padding: 15px 14px;
    overflow: hidden;
    border: 1px solid #e8edf4;
    border-radius: 13px;
    background: linear-gradient(140deg, #fff 0%, #fbfdff 100%);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.tf-user-summary__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.075);
}

.tf-user-summary__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 19px;
}

.tf-user-summary__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.tf-user-summary__label {
    overflow: hidden;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-user-summary__content > strong {
    margin-top: 2px;
    color: #0f172a;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
}

.tf-user-summary__content > strong small {
    margin-left: 2px;
    font-size: 15px;
}

.tf-user-summary__content > small {
    margin-top: 3px;
    overflow: hidden;
    color: #94a3b8;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-user-summary__trend {
    display: none;
}

.tf-user-summary__card--active .tf-user-summary__icon {
    background: #ecfdf3;
    color: #16a34a;
}

.tf-user-summary__card--active .tf-user-summary__trend {
    background: #dcfce7;
    color: #15803d;
}

.tf-user-summary__card--inactive .tf-user-summary__icon {
    background: #fff1f2;
    color: #e11d48;
}

.tf-user-summary__card--inactive .tf-user-summary__trend {
    background: #ffe4e6;
    color: #be123c;
}

.tf-user-summary__card--rate .tf-user-summary__icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.tf-user-summary__card--rate .tf-user-summary__trend {
    background: #ede9fe;
    color: #6d28d9;
}

@media (max-width: 1000px) {
    .tf-user-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .tf-user-page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tf-user-page-actions .tf-user-filter-dropdown {
        min-width: 0;
    }

    .tf-user-page-actions .tf-user-filter-dropdown > button {
        width: 100%;
    }

    .tf-user-action-btn--add {
        grid-column: 1 / -1;
    }

    .tf-user-summary {
        gap: 9px;
        margin-top: 12px;
    }

    .tf-user-summary__card {
        gap: 9px;
        padding: 13px 11px;
    }

    .tf-user-summary__icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 10px;
        font-size: 16px;
    }

    .tf-user-summary__trend {
        display: none;
    }
}
