:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #111827;
    --muted: #64748b;
    --border: #dce4ef;
    --primary: #3157d5;
    --primary-dark: #2444ad;
    --danger: #b42318;
    --success: #087a55;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, .14);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.8;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.45; letter-spacing: -.025em; }
code, pre { direction: ltr; text-align: left; font-family: Consolas, Monaco, monospace; }

.container { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow-light { color: #c7d2fe; }
.text-link { color: var(--primary); font-weight: 700; }

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(220, 228, 239, .88);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}
.topbar-inner { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #111827, #3157d5); color: #fff; box-shadow: 0 8px 20px rgba(49, 87, 213, .2); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav > a:not(.btn) { padding: 8px 11px; border-radius: 10px; color: #334155; }
.nav > a:not(.btn):hover { background: #eef2ff; color: var(--primary); }
.nav-toggle { display: none; background: transparent; color: var(--text); font-size: 24px; cursor: pointer; }

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--primary-dark); box-shadow: 0 10px 25px rgba(49, 87, 213, .2); }
.btn:disabled { opacity: .65; transform: none; cursor: wait; }
.btn-secondary { border-color: #cbd5e1; background: #fff; color: #1e293b; }
.btn-secondary:hover, .btn-ghost:hover { background: #f8fafc; color: var(--text); box-shadow: none; }
.btn-ghost { border-color: #dbe3ed; background: transparent; color: #334155; }
.btn-small { min-height: 38px; padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }

.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.hero { overflow: hidden; padding: 92px 0 80px; background: radial-gradient(circle at 14% 12%, rgba(129, 140, 248, .2), transparent 34%), linear-gradient(180deg, #f8faff, #eef3fa); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(36px, 7vw, 86px); }
.hero-copy h1 { max-width: 760px; margin-bottom: 20px; font-size: clamp(34px, 5.3vw, 64px); }
.hero-copy p { max-width: 670px; margin-bottom: 28px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-console { overflow: hidden; border: 1px solid rgba(255, 255, 255, .16); border-radius: 22px; background: #111827; color: #dbeafe; box-shadow: var(--shadow-lg); direction: ltr; }
.console-bar { display: flex; gap: 7px; padding: 15px 18px; border-bottom: 1px solid #263244; }
.console-bar span { width: 10px; height: 10px; border-radius: 50%; background: #fb7185; }
.console-bar span:nth-child(2) { background: #fbbf24; }
.console-bar span:nth-child(3) { background: #34d399; }
.hero-console pre { min-height: 285px; margin: 0; padding: 28px; overflow: auto; font-size: 13px; line-height: 1.85; }

.section { padding: 82px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 34px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); }
.section-heading > p { max-width: 500px; margin: 0; color: var(--muted); }
.section-heading.compact { align-items: center; }
.section-heading.compact h2 { font-size: 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.feature-card { min-height: 230px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.feature-icon { display: grid; width: 46px; height: 46px; margin-bottom: 28px; place-items: center; border-radius: 14px; background: #eef2ff; color: var(--primary); font-size: 12px; font-weight: 900; }
.feature-card h3 { margin-bottom: 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; }

.auth-page { min-height: calc(100vh - 138px); padding: 54px 0; background: radial-gradient(circle at 90% 10%, rgba(99, 102, 241, .13), transparent 30%); }
.auth-shell { display: grid; max-width: 1020px; grid-template-columns: minmax(0, 1fr) minmax(330px, .78fr); overflow: hidden; border-radius: 26px; background: #fff; box-shadow: var(--shadow-lg); }
.auth-panel { padding: clamp(28px, 5vw, 58px); border: 0; border-radius: 0; box-shadow: none; }
.auth-panel h1 { margin-bottom: 8px; font-size: 32px; }
.auth-panel form { display: grid; gap: 16px; margin-top: 26px; }
.auth-panel > .small { margin: 22px 0 0; }
.auth-aside { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: linear-gradient(145deg, #111827, #253da2); color: #fff; }
.auth-aside-warm { background: linear-gradient(145deg, #172033, #6d3f77); }
.auth-aside h2 { margin-bottom: 12px; font-size: 30px; }
.auth-aside p { color: #dbe4ff; }
.check-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.check-list li::before { content: '✓'; margin-left: 8px; color: #86efac; font-weight: 900; }
.field { display: grid; gap: 7px; }
.field label { color: #334155; font-size: 13px; font-weight: 800; }
.field-help { color: var(--muted); font-size: 12px; }
.input, select, textarea { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #bdc9d8; border-radius: 11px; outline: 0; background: #fff; color: var(--text); transition: border .16s ease, box-shadow .16s ease; }
.input:focus, select:focus, textarea:focus { border-color: #6b83e1; box-shadow: 0 0 0 4px rgba(49, 87, 213, .12); }
.alert { margin: 18px 0; padding: 12px 14px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; }
.alert-error { border-color: #fecaca; background: #fff1f2; color: var(--danger); }
.alert-success { border-color: #a7f3d0; background: #ecfdf5; color: var(--success); }

.app-dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(15, 23, 42, .28); color: var(--text); direction: rtl; }
.app-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(4px); }
.app-dialog-card { display: grid; gap: 18px; padding: 22px; }
.app-dialog-card > header { display: grid; grid-template-columns: 42px 1fr auto; align-items: start; gap: 12px; }
.app-dialog-card > header h2 { margin: 1px 0 3px; font-size: 19px; }
.app-dialog-card > header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; white-space: pre-line; }
.app-dialog-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #eef2ff; color: var(--primary); font-size: 18px; font-weight: 900; }
.app-dialog.is-danger .app-dialog-icon { background: #fff1f2; color: var(--danger); }
.app-dialog.is-success .app-dialog-icon { background: #ecfdf5; color: var(--success); }
.app-dialog-close { width: 30px; height: 30px; border-radius: 9px; background: #f4f6f9; color: #7b8798; cursor: pointer; font-size: 20px; line-height: 1; }
.app-dialog-field { display: grid; gap: 6px; color: #475569; font-size: 12px; font-weight: 800; }
.app-dialog-field[hidden], .app-dialog-card > footer [hidden] { display: none; }
.app-dialog-field textarea { min-height: 105px; resize: vertical; }
.app-dialog-field small { color: var(--danger); font-size: 11px; font-weight: 700; }
.app-dialog-card > footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 15px; border-top: 1px solid #edf1f5; }
.app-dialog.is-danger [data-app-dialog-submit] { background: var(--danger); }
.app-dialog.is-danger [data-app-dialog-submit]:hover { background: #912018; box-shadow: 0 10px 25px rgba(180, 35, 24, .18); }

.dashboard-page { min-height: calc(100vh - 138px); padding: 34px 0 70px; background: linear-gradient(180deg, #edf2f9 0, #f7f9fc 300px); }
.dashboard-stack { display: grid; gap: 30px; }
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px; border-radius: 24px; background: linear-gradient(135deg, #111827, #2849bd); color: #fff; box-shadow: 0 20px 50px rgba(29, 51, 128, .23); }
.dashboard-hero h1 { margin-bottom: 4px; font-size: clamp(26px, 4vw, 38px); }
.dashboard-hero p { margin: 0; color: #c7d2fe; direction: ltr; text-align: right; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 13px; }
.status-pill span { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 5px rgba(74, 222, 128, .12); }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module-card { display: grid; min-height: 112px; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.module-card h3, .module-card p { margin: 0; }
.module-card p { color: var(--muted); font-size: 12px; direction: ltr; text-align: right; }
.module-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: #e0e7ff; color: #3730a3; font-weight: 900; }
.tone-2 .module-icon { background: #dcfce7; color: #166534; }
.tone-3 .module-icon { background: #fce7f3; color: #9d174d; }
.tone-4 .module-icon { background: #ffedd5; color: #9a3412; }
.badge { padding: 4px 10px; border-radius: 999px; background: #ecfdf5; color: var(--success); font-size: 11px; font-weight: 800; }
.empty-state { grid-column: 1 / -1; padding: 30px; border: 1px dashed #94a3b8; border-radius: 16px; background: rgba(255, 255, 255, .55); color: var(--muted); text-align: center; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { display: grid; gap: 3px; padding: 20px; }
.metric-label, .metric-card small { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 25px; direction: ltr; text-align: right; }
.metric-card small { direction: ltr; text-align: right; }
.next-steps { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 30px; padding: 26px; }
.next-steps h2 { margin: 0; }
.next-steps ol { margin: 0; padding-right: 22px; color: #475569; }

.workspace-page { min-height: calc(100vh - 138px); padding: 30px 0 72px; background: linear-gradient(180deg, #e9eefb 0, #f6f8fc 360px); }
.workspace-stack { display: grid; gap: 20px; }
.workspace-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px; border-radius: 24px; background: radial-gradient(circle at 8% 12%, rgba(129, 140, 248, .3), transparent 30%), linear-gradient(135deg, #111827, #263fa0); color: #fff; box-shadow: 0 20px 50px rgba(29, 51, 128, .2); }
.workspace-hero h1 { margin-bottom: 5px; font-size: clamp(26px, 4vw, 38px); }
.workspace-hero p { margin: 0; color: #c7d2fe; }
.btn-light { background: #fff; color: #1e3a8a; }
.btn-light:hover { background: #eef2ff; color: #1e3a8a; }
.workspace-alert { position: sticky; z-index: 15; top: 82px; padding: 12px 16px; border: 1px solid #a7f3d0; border-radius: 12px; background: #ecfdf5; color: var(--success); box-shadow: var(--shadow-sm); }
.workspace-alert.is-error { border-color: #fecaca; background: #fff1f2; color: var(--danger); }
.workspace-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.workspace-metrics article { display: grid; gap: 2px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.workspace-metrics span { color: var(--muted); font-size: 12px; font-weight: 700; }
.workspace-metrics strong { font-size: 28px; }
.workspace-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 6px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.workspace-tabs button { flex: 1 0 max-content; padding: 10px 14px; border-radius: 10px; background: transparent; color: #475569; cursor: pointer; font-weight: 800; }
.workspace-tabs button.is-active { background: #eef2ff; color: var(--primary); }
.workspace-panel { display: none; padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-sm); }
.workspace-panel.is-active { display: block; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 3px; font-size: 25px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.filter-row, .inline-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
.filter-row input, .filter-row select, .inline-form input, .inline-form select { min-width: 0; }
.task-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.task-card, .order-card, .template-card, .notification { border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.task-card { display: grid; gap: 9px; padding: 17px; border-top: 4px solid #94a3b8; }
.task-card.status-in_progress { border-top-color: #3157d5; }
.task-card.status-completed { border-top-color: #16a34a; }
.task-card h3, .task-card p { margin: 0; }
.task-card p, .task-card small { color: var(--muted); font-size: 12px; }
.task-card-top, .order-meta, .progress-row { display: flex; align-items: center; gap: 7px; color: #475569; font-size: 12px; font-weight: 700; }
.type-dot, .priority-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--task-color, #3157d5); }
.priority-dot { background: var(--priority-color, #94a3b8); }
.status-badge { margin-right: auto; padding: 3px 8px; border-radius: 999px; background: #eef2f7; color: #475569; font-size: 11px; font-weight: 800; }
.progress { width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: #e7ecf4; direction: ltr; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3157d5, #7591f2); }
.task-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.order-list { display: grid; gap: 12px; }
.order-card { padding: 18px; }
.order-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.order-main h3 { margin: 3px 0; }
.order-main p { margin: 0; color: var(--muted); font-size: 13px; }
.progress-row { margin-top: 14px; }
.progress-row strong { width: 58px; color: #1e293b; text-align: left; }
.order-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-grid h4 { margin: 0 0 10px; }
.step-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.step-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 9px 11px; border-right: 4px solid #cbd5e1; border-radius: 9px; background: #f8fafc; }
.step-list b { color: var(--muted); font-size: 11px; }
.step-list button { background: transparent; color: var(--danger); cursor: pointer; font-size: 11px; }
.step-list .step-active { border-color: #3157d5; }
.step-list .step-completed { border-color: #16a34a; }
.history-list { max-height: 260px; overflow: auto; }
.history-list p { display: grid; margin: 0; padding: 8px 0; border-bottom: 1px solid #edf1f5; font-size: 12px; }
.history-list small { color: var(--muted); }
.attachment-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.attachment-strip img { width: 86px; height: 70px; object-fit: cover; border-radius: 10px; }
.quick-form { display: grid; align-content: start; gap: 11px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: #f8fafc; }
.quick-form[hidden] { display: none; }
.quick-form h3 { margin: 0 0 3px; font-size: 17px; }
.quick-form label { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 800; }
.quick-form .check { display: flex; align-items: center; }
.quick-form .check input { width: auto; min-height: auto; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.management-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.span-2 { grid-column: span 2; }
.template-list { display: grid; gap: 12px; }
.template-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px; }
.template-card h3, .template-card p { margin: 0; }
.template-card p, .template-card > span { color: var(--muted); font-size: 12px; }
.template-card ol { display: flex; grid-column: 1 / -1; gap: 8px; overflow-x: auto; margin: 3px 0 0; padding: 0; list-style: none; }
.template-card li { display: grid; min-width: 180px; gap: 2px; padding: 9px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; font-size: 12px; }
.template-card small { color: var(--muted); }
.notification-list { display: grid; gap: 9px; }
.notification { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; }
.notification.is-unread { border-right: 4px solid var(--primary); background: #f6f8ff; }
.notification h3, .notification p { margin: 0; }
.notification h3 { font-size: 14px; }
.notification p, .notification time { color: var(--muted); font-size: 12px; }
.loading { padding: 28px; color: var(--muted); text-align: center; }

.footer { padding: 28px 0; border-top: 1px solid var(--border); background: #fff; font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

@media (max-width: 900px) {
    .hero-grid, .auth-shell, .next-steps { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-aside { min-height: 300px; }
    .hero { padding-top: 62px; }
    .workspace-metrics, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .task-board, .management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-row, .inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .container { width: min(100% - 24px, 1160px); }
    .nav-toggle { display: block; }
    .nav { display: none; position: absolute; top: 62px; right: 12px; left: 12px; flex-direction: column; align-items: stretch; padding: 12px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow-lg); }
    .nav.is-open { display: flex; }
    .nav .btn { width: 100%; }
    .hero { padding: 50px 0; }
    .hero-copy h1 { font-size: 34px; }
    .feature-grid, .module-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .section-heading, .dashboard-hero, .footer-inner { align-items: flex-start; flex-direction: column; }
    .section { padding: 58px 0; }
    .auth-page { padding: 22px 0; }
    .auth-aside { min-height: 250px; padding: 30px; }
    .module-card { grid-template-columns: 48px 1fr; }
    .module-card .badge { grid-column: 2; justify-self: start; }
    .workspace-page { padding-top: 16px; }
    .workspace-hero, .panel-heading, .order-main, .notification { align-items: flex-start; flex-direction: column; }
    .workspace-metrics, .task-board, .management-grid, .form-grid, .filter-row, .inline-form, .detail-grid { grid-template-columns: 1fr; }
    .workspace-panel { padding: 16px; }
    .span-2 { grid-column: auto; }
    .template-card { grid-template-columns: 1fr; }
    .template-card ol { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* TaskFlow project workspace */
body:has(.tf-app) .topbar,
body:has(.tf-app) .footer { display: none; }
body:has(.tf-app) { background: #f4f6fa; }
.tf-app { --tf-navy: #17233d; --tf-blue: #4969e8; --tf-soft: #f4f6fa; --tf-line: #e4e8f0; display: grid; min-height: 100vh; grid-template-columns: 258px minmax(0, 1fr); direction: rtl; color: #182033; }
.tf-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 16px; border-left: 1px solid #202f50; background: var(--tf-navy); color: #fff; }
.tf-product { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; border-bottom: 1px solid rgba(255,255,255,.09); }
.tf-product > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #7188ff, #405edb); font-weight: 900; box-shadow: 0 9px 24px rgba(73,105,232,.3); }
.tf-product div, .tf-user div { display: grid; min-width: 0; }
.tf-product strong { font-size: 17px; }
.tf-product small, .tf-user small { overflow: hidden; color: #9eabc5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tf-nav { display: grid; gap: 5px; min-height: 0; padding-top: 10px; overflow-y: auto; }
.tf-nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border-radius: 10px; background: transparent; color: #b7c1d6; cursor: pointer; text-align: right; font-weight: 700; }
.tf-nav button span { display: grid; width: 22px; place-items: center; font-size: 17px; }
.tf-nav button b { min-width: 21px; margin-right: auto; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; text-align: center; }
.tf-nav button:hover, .tf-nav button.is-active { background: rgba(93,120,235,.18); color: #fff; }
.tf-nav button.is-active { box-shadow: inset -3px 0 #7188ff; }
.tf-nav-label { padding: 22px 13px 5px; color: #697994; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.tf-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.tf-user > span { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 50%; background: #2e426c; font-weight: 900; }
.tf-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tf-main { min-width: 0; padding: 36px clamp(22px, 4vw, 58px) 70px; direction: rtl; }
.tf-mobile-head { display: none; }
.tf-view { display: none; max-width: 1440px; margin-inline: auto; }
.tf-view.is-active { display: block; }
.tf-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.tf-page-head > div:first-child > span, .tf-editor-head > div > span { display: block; margin-bottom: 4px; color: var(--tf-blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.tf-page-head h1 { margin: 0 0 5px; font-size: clamp(27px, 3vw, 38px); }
.tf-page-head p, .tf-card-head p, .tf-editor-head p { margin: 0; color: #798399; font-size: 13px; }
.tf-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid var(--tf-blue); border-radius: 10px; background: var(--tf-blue); color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.tf-button:hover { background: #3d59cb; }
.tf-button.secondary { border-color: #d9dfeb; background: #fff; color: #3c475d; }
.tf-button.ghost { border-color: transparent; background: transparent; color: #6d778b; }
.tf-button.danger { border-color: #dc2626; background: #fff; color: #c81e1e; }
.tf-button.danger:hover { background: #dc2626; color: #fff; }
.tf-app [hidden] { display: none !important; }
.push { margin-right: auto; }
.tf-button.tiny { min-height: 32px; padding: 5px 10px; font-size: 10px; }
.tf-link { padding: 4px; background: transparent; color: var(--tf-blue); cursor: pointer; font-size: 11px; font-weight: 800; }
.tf-toast { position: fixed; z-index: 100; top: 18px; left: 24px; max-width: 360px; padding: 11px 15px; border: 1px solid #a7f3d0; border-radius: 10px; background: #ecfdf5; color: #087a55; box-shadow: 0 15px 40px rgba(15,23,42,.15); font-size: 12px; }
.tf-toast.is-error { border-color: #fecaca; background: #fff1f2; color: #b42318; }
.tf-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.tf-setup-card { margin-bottom: 16px; overflow: hidden; border: 1px solid #d9e0f4; border-radius: 15px; background: #fff; }
.tf-setup-card:empty { display: none; }
.tf-setup-card > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 18px; border-bottom: 1px solid #edf0f7; background: #f8f9ff; }
.tf-setup-card > header div { display: grid; }
.tf-setup-card > header span { color: #68789f; font-size: 9px; font-weight: 900; }
.tf-setup-card > header strong { font-size: 13px; }
.tf-setup-card > header button, .tf-context-help button, .tf-guide-steps button { background: transparent; color: var(--tf-blue); cursor: pointer; font-size: 10px; font-weight: 900; }
.tf-setup-card > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tf-setup-card > div > button { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-left: 1px solid #edf0f5; background: #fff; color: inherit; cursor: pointer; text-align: right; }
.tf-setup-card > div > button:hover { background: #fafbff; }
.tf-setup-card > div > button > b { display: grid; width: 27px; height: 27px; flex: none; place-items: center; border-radius: 8px; background: #eef1f7; color: #6d7890; font-size: 10px; }
.tf-setup-card > div > button.done > b { background: #e8f8ef; color: #14865b; }
.tf-setup-card > div > button span { display: grid; }
.tf-setup-card > div > button strong { font-size: 10px; }
.tf-setup-card > div > button small { color: #8c96aa; font-size: 8px; }
.tf-metrics article { display: flex; align-items: center; gap: 13px; padding: 20px; border: 1px solid var(--tf-line); border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(24,32,51,.04); }
.tf-metrics i { display: grid; width: 43px; height: 43px; flex: none; place-items: center; border-radius: 12px; background: #edf1ff; color: #4969e8; font-style: normal; }
.tf-metrics i.orange { background: #fff3e8; color: #e4771c; }
.tf-metrics i.green { background: #eaf8f1; color: #139663; }
.tf-metrics i.purple { background: #f4edff; color: #8356d8; }
.tf-metrics div { display: grid; }
.tf-metrics span { color: #7c8699; font-size: 11px; }
.tf-metrics strong { font-size: 27px; }
.tf-dashboard-grid, .tf-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tf-card { border: 1px solid var(--tf-line); border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(24,32,51,.035); }
.tf-card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid #edf0f5; }
.tf-card-head h2 { margin: 0 0 2px; font-size: 16px; }
.tf-row { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 65px; padding: 10px 20px; border-bottom: 1px solid #f0f2f6; background: transparent; color: inherit; text-align: right; }
button.tf-row { cursor: pointer; }
button.tf-row:hover { background: #fafbfe; }
.tf-row > span:nth-child(2) { display: grid; min-width: 0; }
.tf-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tf-row small { color: #929bad; font-size: 10px; }
.tf-row-progress { margin-right: auto; color: var(--tf-blue); font-weight: 900; }
.tf-check-dot { width: 17px; height: 17px; flex: none; border: 2px solid #b7c1d3; border-radius: 50%; }
.tf-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px auto; gap: 9px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--tf-line); border-radius: 13px; background: #fff; }
.tf-filters label { display: grid; gap: 4px; color: #667085; font-size: 10px; font-weight: 800; }
.tf-filter-actions { display: flex; align-items: end; gap: 8px; }
.tf-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.tf-task-filters { position: relative; z-index: 20; margin-bottom: 20px; border: 1px solid var(--tf-line); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(24,32,51,.035); }
.tf-task-filters.is-open { z-index: 100; }
.tf-task-filter-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px; }
.tf-task-search { position: relative; display: flex; min-width: 0; align-items: center; border: 1px solid #d8deea; border-radius: 10px; background: #fff; color: #818b9e; transition: border-color .16s ease, box-shadow .16s ease; }
.tf-task-search:focus-within { border-color: #8fa1ec; box-shadow: 0 0 0 3px rgba(72,101,223,.1); }
.tf-task-search > svg { width: 19px; height: 19px; margin-right: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tf-task-search input { width: 100%; min-width: 0; min-height: 43px; padding: 8px 10px; border: 0; outline: 0; background: transparent; color: #263149; font-size: 12px; }
.tf-task-search > button { display: grid; width: 39px; height: 35px; margin-left: 4px; flex: none; place-items: center; border-radius: 8px; background: #f2f4f9; color: #5f6b82; cursor: pointer; }
.tf-task-search > button:hover { background: #e9edfa; color: var(--tf-blue); }
.tf-task-search > button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.tf-filter-segment { display: flex; min-width: max-content; margin: 0; padding: 3px; border: 1px solid #dfe4ed; border-radius: 10px; background: #f4f6f9; }
.tf-filter-segment label { position: relative; cursor: pointer; }
.tf-filter-segment input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tf-filter-segment span { display: flex; min-height: 35px; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 7px; color: #6c7689; font-size: 11px; font-weight: 800; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.tf-filter-segment label:hover span { color: #344057; }
.tf-filter-segment input:focus-visible + span { outline: 2px solid #8fa1ec; outline-offset: 1px; }
.tf-filter-segment input:checked + span { background: #fff; color: #344fc1; box-shadow: 0 1px 4px rgba(28,39,68,.12); }
.tf-task-filter-toggle { position: relative; display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid #d8deea; border-radius: 10px; background: #fff; color: #465168; cursor: pointer; font-size: 11px; font-weight: 900; white-space: nowrap; }
.tf-task-filter-toggle:hover, .tf-task-filter-toggle[aria-expanded="true"], .tf-task-filter-toggle.has-active-filters { border-color: #bfc9ef; background: #f5f7ff; color: #4059c9; }
.tf-task-filter-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tf-task-filter-toggle b { display: grid; min-width: 19px; height: 19px; padding: 0 5px; place-items: center; border-radius: 99px; background: var(--tf-blue); color: #fff; font-size: 9px; line-height: 1; }
.tf-task-status { width: max-content; max-width: calc(100% - 24px); margin: 0 12px 12px; overflow-x: auto; border-color: transparent; background: #f7f8fb; scrollbar-width: none; }
.tf-task-status::-webkit-scrollbar { display: none; }
.tf-task-status span { min-height: 34px; padding-inline: 16px; }
.tf-task-active-filters { display: flex; align-items: center; gap: 7px; padding: 0 12px 12px; overflow-x: auto; scrollbar-width: thin; }
.tf-task-active-filters > span { flex: none; color: #798399; font-size: 10px; font-weight: 800; }
.tf-task-filter-chip { display: inline-flex; min-height: 30px; flex: none; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid #dbe2f6; border-radius: 99px; background: #f6f8ff; color: #4059b9; cursor: pointer; font-size: 10px; font-weight: 800; }
.tf-task-filter-chip:hover { border-color: #bdc8ee; background: #eef2ff; }
.tf-task-filter-chip i { display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: #dfe5fb; font-size: 12px; font-style: normal; line-height: 1; }
.tf-task-filter-clear { min-height: 30px; flex: none; padding: 4px 8px; background: transparent; color: #7c8699; cursor: pointer; font-size: 10px; font-weight: 800; }
.tf-task-filter-clear:hover { color: #c81e1e; }
.tf-task-filter-backdrop { position: fixed; z-index: 70; inset: 0; background: transparent; cursor: default; }
.tf-task-filter-panel { position: absolute; z-index: 80; top: calc(100% + 9px); left: 0; width: min(620px, 100%); overflow: hidden; border: 1px solid #dce2ed; border-radius: 16px; background: #fff; box-shadow: 0 24px 65px rgba(25,34,55,.2); }
.tf-task-filter-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border-bottom: 1px solid #edf0f5; }
.tf-task-filter-panel > header h2 { margin: 0 0 2px; font-size: 15px; }
.tf-task-filter-panel > header p { margin: 0; color: #838da0; font-size: 10px; }
.tf-task-filter-panel > header > button { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #f3f5f8; color: #697488; cursor: pointer; }
.tf-task-filter-panel > header > button:hover { background: #e9edf4; color: #2d3950; }
.tf-task-filter-panel > header svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tf-task-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 18px; }
.tf-task-filter-grid label { display: grid; min-width: 0; gap: 6px; color: #5e697d; font-size: 11px; font-weight: 800; }
.tf-task-filter-grid input, .tf-task-filter-grid select { width: 100%; min-width: 0; min-height: 43px; padding: 8px 11px; border: 1px solid #d8deea; border-radius: 9px; outline: 0; background: #fff; color: #263149; font-size: 12px; }
.tf-task-filter-grid input:focus, .tf-task-filter-grid select:focus { border-color: #8fa1ec; box-shadow: 0 0 0 3px rgba(72,101,223,.09); }
.tf-task-filter-panel > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #edf0f5; background: #fafbfc; }
.tf-team-member-list { padding: 12px 0; }
.tf-team-member-list > span { width: 100%; border-radius: 10px; }
.tf-team-member-list > span > button:first-of-type { margin-right: auto; }
.tf-context-help { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 11px 14px; border: 1px solid #dbe3f9; border-radius: 11px; background: #f6f8ff; color: #66738d; font-size: 10px; }
.tf-context-help b { flex: none; color: #354d9d; }
.tf-context-help button { margin-right: auto; white-space: nowrap; }
.tf-filters input, .tf-filters select, .tf-form input, .tf-form select, .tf-form textarea, .tf-inline-form input, .tf-inline-form select, .tf-modal-card input, .tf-modal-card select, .tf-modal-card textarea { min-height: 41px; padding: 8px 11px; border: 1px solid #d8deea; border-radius: 9px; background: #fff; font-size: 12px; }
.tf-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.tf-project-card { padding: 18px; border: 1px solid var(--tf-line); border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(24,32,51,.035); cursor: pointer; }
.tf-project-card:hover { transform: translateY(-2px); border-color: #cfd7f5; box-shadow: 0 13px 30px rgba(42,58,105,.08); }
.tf-project-card header, .tf-task-card header, .tf-task-card footer { display: flex; align-items: center; gap: 8px; }
.tf-project-card header .tf-status { margin-right: auto; }
.tf-project-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #edf1ff; color: #435fda; font-style: normal; font-weight: 900; }
.tf-project-icon.small { width: 35px; height: 35px; flex: none; border-radius: 10px; }
.tf-project-card h3 { margin: 15px 0 1px; font-size: 16px; }
.tf-project-card .tf-code { margin: 0; color: #929bad; direction: ltr; font-size: 10px; text-align: right; }
.tf-project-card footer { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #eef1f5; color: #7e889b; font-size: 10px; }
.tf-status { display: inline-flex; width: max-content; align-items: center; padding: 3px 8px; border-radius: 999px; background: #f0f2f6; color: #667085; font-size: 9px; font-weight: 900; }
.tf-status.status-active, .tf-status.status-in_progress { background: #edf1ff; color: #405ed6; }
.tf-status.status-completed { background: #eaf8f1; color: #0d8a59; }
.tf-status.status-draft, .tf-status.status-open, .tf-status.status-pending { background: #fff4e9; color: #cf6a17; }
.tf-progress-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; margin-top: 14px; }
.tf-progress-row b { color: #4d5a72; font-size: 10px; }
.tf-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e9edf4; direction: ltr; }
.tf-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4969e8, #7d93ef); }
.tf-task-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; align-items: start; }
.tf-task-column { padding: 12px; border: 1px solid var(--tf-line); border-radius: 14px; background: #edf0f5; }
.tf-task-column[data-task-column="open"] { border-color: #eee4d8; background: #f3f0ec; }
.tf-task-column[data-task-column="in_progress"] { border-color: #dce3fa; background: #edf1f8; }
.tf-task-column[data-task-column="completed"] { border-color: #d8e9e0; background: #edf5f1; }
.tf-task-column > header { display: flex; align-items: center; justify-content: space-between; padding: 3px 5px 12px; }
.tf-task-column > header h2 { margin: 0; font-size: 13px; }
.tf-task-column > header span { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 8px; background: #fff; color: #667085; font-size: 10px; }
.tf-task-column > div { display: grid; gap: 9px; }
.tf-task-card { display: grid; gap: 7px; padding: 14px; border: 1px solid #e1e5ed; border-radius: 12px; background: #fff; }
.tf-task-card h3, .tf-task-card p { margin: 0; }
.tf-task-card h3 { font-size: 13px; }
.tf-task-card p, .tf-task-card small { color: #7c8699; font-size: 10px; }
.tf-task-card footer { flex-wrap: wrap; margin-top: 5px; padding-top: 10px; border-top: 1px solid #eef1f5; }
.tf-task-card footer .tf-status { margin-right: auto; }
.tf-type { padding-right: 8px; border-right: 3px solid var(--type-color, #4969e8); color: #5d687d; font-size: 9px; font-weight: 900; }
.tf-independent { margin-right: auto; padding: 2px 7px; border-radius: 6px; background: #f1eafa; color: #7e4fc7; font-size: 9px; font-weight: 900; }
.tf-independent.delegated { margin-right: 0; background: #eef3ff; color: #3f5ec4; }
.tf-column-empty { margin: 0; padding: 25px 8px; color: #929bad; font-size: 11px; text-align: center; }
.tf-workflow-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.tf-template-list { position: sticky; top: 86px; display: flex; max-height: calc(100dvh - 108px); overflow: hidden; flex-direction: column; }
.tf-template-list > header { display: flex; align-items: center; justify-content: space-between; padding: 17px; border-bottom: 1px solid #edf0f5; }
.tf-template-list > header > div { display: grid; gap: 2px; }
.tf-template-list > header h2 { margin: 0; font-size: 15px; }
.tf-template-list > header small { color: #8490a4; font-size: 9px; }
.tf-template-list > header span { display: grid; min-width: 29px; height: 29px; place-items: center; border-radius: 9px; background: #f1f4fa; color: #68758b; font-size: 10px; font-weight: 900; }
.tf-template-tools { display: grid; gap: 9px; padding: 12px; border-bottom: 1px solid #edf0f5; background: #fafbfc; }
.tf-template-search { position: relative; display: flex; align-items: center; }
.tf-template-search > svg { position: absolute; right: 11px; width: 16px; height: 16px; fill: none; stroke: #7d889a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; pointer-events: none; }
.tf-template-search input { width: 100%; min-height: 40px; padding: 8px 36px 8px 34px; border: 1px solid #dce2eb; border-radius: 10px; outline: none; background: #fff; color: #26334a; font: inherit; font-size: 11px; }
.tf-template-search input:focus { border-color: #8fa2f3; box-shadow: 0 0 0 3px rgba(73,105,232,.11); }
.tf-template-search button { position: absolute; left: 7px; display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; background: #eef1f6; color: #667389; cursor: pointer; }
.tf-template-search button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.tf-template-controls { display: grid; grid-template-columns: minmax(0, 1fr) 105px; gap: 7px; }
.tf-template-status { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid #e0e5ee; border-radius: 9px; background: #fff; }
.tf-template-status button { min-height: 30px; border-radius: 6px; background: transparent; color: #748096; cursor: pointer; font-size: 9px; font-weight: 900; }
.tf-template-status button.is-active { background: #e9edff; color: #3f5dcc; }
.tf-template-sort select { width: 100%; min-height: 38px; padding: 6px 8px; border: 1px solid #dce2eb; border-radius: 9px; background: #fff; color: #566278; font: inherit; font-size: 9px; font-weight: 800; }
.tf-template-results { min-height: 150px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.tf-template-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 15px; border-bottom: 1px solid #f0f2f6; background: #fff; color: inherit; cursor: pointer; text-align: right; }
.tf-template-item:hover, .tf-template-item.is-active { background: #f4f6ff; }
.tf-template-item.is-active { box-shadow: inset -3px 0 var(--tf-blue); }
.tf-template-item span { display: grid; min-width: 0; flex: 1; }
.tf-template-item strong { font-size: 12px; }
.tf-template-item small { color: #8a94a7; font-size: 9px; }
.tf-template-item em { padding: 3px 6px; border-radius: 999px; background: #f0f2f6; color: #8690a2; font-size: 8px; font-style: normal; font-weight: 900; }
.tf-template-item em.is-active { background: #e9f6ee; color: #24814b; }
.tf-template-item b { color: #8994a7; font-size: 14px; }
.tf-template-editor { min-height: 440px; padding: 22px; }
.tf-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #edf0f5; }
.tf-editor-head h2 { margin: 0 0 3px; font-size: 22px; }
.tf-template-stages { display: grid; gap: 10px; padding-top: 18px; }
.tf-template-stages article { display: grid; grid-template-columns: 38px 1fr; gap: 11px; padding: 13px; border: 1px solid #e6eaf1; border-radius: 11px; background: #fafbfc; }
.tf-template-stages article.is-disabled { opacity: .58; }
.tf-template-stages article > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #e9edff; color: #4969e8; font-size: 11px; font-weight: 900; }
.tf-template-stages h3, .tf-template-stages p { margin: 0; }
.tf-template-stages h3 { font-size: 12px; }
.tf-template-stages p, .tf-template-stages small { display: block; color: #828da0; font-size: 10px; }
.tf-template-guides { margin-top: 18px; padding: 16px; border: 1px solid #e6eaf1; border-radius: 14px; background: #fbfcff; }
.tf-template-guides .tf-card-head { min-height: 0; padding: 0 0 13px; border: 0; }
.tf-template-guides .tf-card-head h3 { margin: 0; color: #26344f; font-size: 13px; }
.tf-template-guides .tf-card-head p { margin: 3px 0 0; color: #7f899b; font-size: 10px; }
.tf-template-guide-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tf-guide-file { min-width: 0; overflow: hidden; border: 1px solid #e2e7f0; border-radius: 12px; background: #fff; }
.tf-guide-file > a { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 72px; padding: 8px; color: inherit; text-decoration: none; }
.tf-guide-file img, .tf-guide-file-icon { display: grid; width: 58px; height: 56px; place-items: center; object-fit: cover; border-radius: 8px; background: #fff0ee; color: #c43d32; font-size: 12px; font-weight: 900; }
.tf-guide-file strong, .tf-guide-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-guide-file strong { color: #26344f; font-size: 11px; }
.tf-guide-file small { margin-top: 4px; color: #8993a5; font-size: 9px; }
.tf-guide-file-actions { display: flex; gap: 5px; padding: 0 8px 8px; }
.tf-guide-file-actions button { min-height: 27px; padding: 3px 8px; border: 1px solid #e2e7f0; border-radius: 7px; background: #fff; color: #687389; font: inherit; font-size: 10px; cursor: pointer; }
.tf-template-guide-upload { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #dce2ec; }
.tf-template-guide-upload label { display: grid; gap: 5px; color: #59667d; font-size: 10px; }
.tf-template-guide-upload input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #dce2ec; border-radius: 9px; background: #fff; font: inherit; }
.tf-template-guide-upload > small { grid-column: 1 / -1; color: #8a94a6; font-size: 9px; }
.tf-stage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tf-stage-actions button, .tf-actions button { padding: 0; background: transparent; color: var(--tf-blue); cursor: pointer; font-size: 9px; font-weight: 900; }
.tf-stage-actions button.danger-text, .tf-actions button.danger-text, .danger-text { color: #c33a32; }
.tf-entity-list, .tf-user-list { display: grid; }
.tf-entity-list article, .tf-user-list article { display: flex; align-items: center; gap: 11px; padding: 13px 20px; border-bottom: 1px solid #f0f2f6; }
.tf-entity-list article > i, .tf-user-list article > i { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 10px; background: #edf1ff; color: #4969e8; font-style: normal; font-weight: 900; }
.tf-entity-list article > span, .tf-user-list article > span { display: grid; min-width: 0; }
.tf-entity-list strong, .tf-user-list strong { font-size: 12px; }
.tf-entity-list small, .tf-user-list small { color: #8a94a7; font-size: 10px; }
.tf-entity-list .tf-status, .tf-user-list .tf-status { margin-right: auto; }
.tf-user-list article form { display: flex; align-items: center; gap: 5px; margin-right: auto; }
.tf-user-list article form select { min-height: 32px; padding: 4px 7px; border: 1px solid #d8deea; border-radius: 7px; font-size: 9px; }
.tf-user-list article form button { padding: 6px 8px; border-radius: 7px; background: #eef1ff; color: #425ed5; cursor: pointer; font-size: 8px; font-weight: 900; }
.tf-form { display: grid; gap: 13px; padding: 20px; }
.tf-form label, .tf-modal-card label { display: grid; gap: 5px; color: #596579; font-size: 11px; font-weight: 800; }
.tf-check { display: flex !important; align-items: center; }
.tf-check input { width: auto; min-height: auto; }
.tf-project-hero { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 28px; border-radius: 18px; background: linear-gradient(135deg, #17233d, #2c4271); color: #fff; }
.tf-project-kicker { color: #aebce0; direction: ltr; font-size: 10px; text-align: right; }
.tf-project-hero h1 { margin: 4px 0; font-size: 29px; }
.tf-project-hero p { margin: 0; color: #b8c4df; font-size: 11px; }
.tf-project-score { display: grid; min-width: 115px; text-align: center; }
.tf-project-score strong { font-size: 35px; }
.tf-project-score span { color: #aebce0; font-size: 10px; }
.tf-project-toolbar { display: flex; align-items: center; gap: 8px; margin: 13px 0; }
.tf-back { margin-bottom: 13px; background: transparent; color: #67738a; cursor: pointer; font-size: 11px; font-weight: 800; }
.tf-members, .tf-stages { margin-bottom: 13px; }
.tf-member-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px; }
.tf-member-pills > span { display: flex; align-items: center; gap: 7px; padding: 6px 10px 6px 12px; border: 1px solid #e1e6ee; border-radius: 999px; font-size: 10px; font-weight: 800; }
.tf-member-pills i { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #edf1ff; color: #4969e8; font-style: normal; }
.tf-member-pills small { color: #929bad; }
.tf-inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 0 20px 18px; }
.tf-stage-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px; }
.tf-stage { padding: 14px; border: 1px solid #e3e7ef; border-top: 3px solid #b3bccb; border-radius: 12px; background: #fff; }
.tf-stage.status-active { border-top-color: #4969e8; }
.tf-stage.status-completed { border-top-color: #16a36a; }
.tf-stage > header { display: flex; align-items: center; justify-content: space-between; }
.tf-stage > header > span:first-child { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #f0f2f6; color: #687489; font-size: 9px; font-weight: 900; }
.tf-stage h3 { margin: 12px 0 1px; font-size: 13px; }
.tf-stage > p { margin: 0; color: #8a94a7; font-size: 10px; }
.tf-dependency { min-height: 37px; margin-top: 10px; padding: 7px; border-radius: 7px; background: #f7f8fa; color: #7b8699; font-size: 9px; }
.tf-stage-task { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf0f4; font-size: 9px; }
.tf-stage-work-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.tf-stage-work-actions:empty { display: none; }
.tf-timeline { display: grid; padding: 8px 20px 18px; }
.tf-timeline article { display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 10px 0; border-bottom: 1px solid #f0f2f6; }
.tf-timeline article i { width: 8px; height: 8px; margin-top: 8px; border: 2px solid #8798df; border-radius: 50%; }
.tf-timeline article div { display: grid; }
.tf-timeline strong { font-size: 11px; }
.tf-timeline small { color: #929bad; font-size: 9px; }
.tf-notifications { overflow: hidden; }
.tf-notification { display: grid; grid-template-columns: 32px 1fr; gap: 11px; padding: 15px 19px; border-bottom: 1px solid #eff1f5; }
.tf-notification.unread { background: #f8f9ff; box-shadow: inset -3px 0 var(--tf-blue); }
.tf-notification > i { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #edf1ff; color: #4969e8; font-style: normal; }
.tf-notification div { display: grid; }
.tf-notification strong { font-size: 12px; }
.tf-notification p { margin: 1px 0; color: #737e92; font-size: 10px; }
.tf-notification small { color: #9ba3b2; font-size: 9px; }
.tf-notification { width: 100%; border-width: 0 0 1px; font: inherit; text-align: right; cursor: pointer; }
.tf-notification:hover { background: #f7f9fd; }
.tf-notification:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(49,87,213,.25); outline-offset: -3px; }
.tf-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 17px; box-shadow: 0 35px 90px rgba(15,23,42,.28); direction: rtl; }
.tf-dialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.tf-modal-card { display: grid; gap: 15px; padding: 22px; }
.tf-modal-card.compact { max-width: 480px; margin-inline: auto; }
.tf-modal-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 1px solid #edf0f4; }
.tf-modal-card > header h2 { margin: 0; font-size: 19px; }
.tf-modal-card > header p { margin: 2px 0 0; color: #8490a4; font-size: 11px; }
.tf-modal-card > header button { background: transparent; color: #8490a4; cursor: pointer; font-size: 25px; }
.tf-modal-card > footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.tf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-form-grid .span-2 { grid-column: span 2; }
.tf-target-box { padding: 13px; border: 1px dashed #cbd5ec; border-radius: 11px; background: #f8f9fd; }
.tf-target-box > strong { color: #45536c; font-size: 11px; }
.tf-target-box > p { margin: 2px 0 10px; color: #8490a4; font-size: 9px; }
.tf-modal-card select[multiple] { min-height: 98px; }
.tf-modal-card label small { color: #929bad; font-size: 9px; font-weight: 400; }
.tf-empty { display: grid; place-items: center; min-height: 190px; padding: 25px; color: #7e899c; text-align: center; }
.tf-empty.small { min-height: 80px; }
.tf-empty strong { color: #4c586e; font-size: 13px; }
.tf-empty p { margin: 3px 0 12px; font-size: 11px; }
.tf-loading { grid-column: 1 / -1; padding: 50px; color: #7d889b; text-align: center; }
.tf-table { display: grid; overflow-x: auto; }
.tf-table-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, .8fr) 100px 90px 120px; min-width: 720px; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #eef1f5; color: #687389; font-size: 10px; }
.tf-table-row.customer { grid-template-columns: minmax(200px, 1.5fr) minmax(160px, 1fr) 100px 120px; min-width: 650px; }
.tf-table-row.tf-table-head { background: #fafbfc; color: #8993a5; font-size: 9px; font-weight: 900; }
.tf-table-row > span:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.tf-table-row > span:first-child small { grid-column: 2; color: #949dad; }
.tf-color { width: 11px; height: 11px; border-radius: 50%; }
.tf-actions { display: flex; gap: 10px; }
.tf-task-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px; background: #f5f7fa; color: #6c778b; font-size: 10px; }
.tf-task-description { margin: 0; padding: 3px 2px; color: #657084; font-size: 11px; line-height: 2; }
.tf-subform { padding: 13px; border: 1px solid #e4e8f0; border-radius: 11px; }
.tf-assignment-box { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid #cfd8f4; border-radius: 11px; background: #f8f9ff; }
.tf-assignment-box label { display: grid; gap: 4px; }
.tf-assignment-box label strong { font-size: 11px; }
.tf-assignment-box label small { color: #8390a6; font-size: 9px; }
.tf-assignment-box select { min-height: 105px; padding: 8px; border: 1px solid #d4dbeb; border-radius: 9px; }
.tf-report-list { display: grid; gap: 7px; }
.tf-report-list > h3 { margin: 0; font-size: 12px; }
.tf-report-list article { padding: 10px 12px; border-right: 3px solid #8ca0ec; border-radius: 8px; background: #f7f8fb; }
.tf-report-list article strong, .tf-report-list article small { font-size: 9px; }
.tf-report-list article p { margin: 3px 0; color: #606c81; font-size: 10px; }
.tf-report-list article small, .tf-muted { color: #929bad; }
.tf-attachment-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 16px 20px; }
.tf-attachment-grid a { display: grid; gap: 4px; color: #687389; font-size: 9px; }
.tf-attachment-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid #e3e7ef; border-radius: 10px; }
.tf-upload { padding-top: 0; }
.tf-guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.tf-guide-steps article { display: flex; gap: 12px; padding: 17px; border: 1px solid var(--tf-line); border-radius: 14px; background: #fff; }
.tf-guide-steps article > b { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 10px; background: #edf1ff; color: #4969e8; }
.tf-guide-steps h2 { margin: 0; font-size: 13px; }
.tf-guide-steps p { min-height: 38px; margin: 4px 0; color: #778297; font-size: 10px; line-height: 1.8; }
.tf-guide-card { margin-bottom: 15px; }
.tf-glossary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tf-glossary article { display: grid; gap: 3px; padding: 16px; border-left: 1px solid #eef1f5; }
.tf-glossary strong { color: #425ed5; font-size: 11px; }
.tf-glossary span, .tf-guide-copy { color: #6f7a8f; font-size: 10px; line-height: 1.9; }
.tf-guide-copy { padding: 13px 20px; }
.tf-guide-copy p { margin: 4px 0; }
.tf-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; padding: 18px 20px; border: 1px solid #fecaca; border-radius: 14px; background: #fff7f7; }
.tf-danger-zone[hidden] { display: none; }
.tf-danger-zone strong { color: #b42318; font-size: 13px; }
.tf-danger-zone p { max-width: 850px; margin: 3px 0 0; color: #8f5450; font-size: 10px; }
.tf-archive-stack { display: grid; gap: 16px; }
.tf-archive-stack .tf-project-grid { padding: 18px; }
.tf-task-archive-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.tf-project-card.is-archived, .tf-task-card.is-archived { background: #fbfcfe; box-shadow: none; }
.tf-user-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tf-user-facts span { display: grid; gap: 2px; min-width: 0; padding: 10px; border: 1px solid #e4e8f0; border-radius: 10px; background: #f8f9fc; }
.tf-user-facts small { color: #8a94a7; font-size: 10px; }
.tf-user-facts strong { overflow: hidden; color: #4c586e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tf-role-list article { align-items: flex-start; }
.tf-role-list article > span { gap: 2px; flex: 1; }
.tf-role-list .tf-actions { flex-wrap: wrap; justify-content: flex-end; }
.tf-choice-field { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 14px; border: 1px solid #e2e7f0; border-radius: 12px; }
.tf-choice-field legend { padding: 0 7px; color: #4c586e; font-size: 12px; font-weight: 900; }
.tf-choice-field > small { color: #7d8799; font-size: 10px; line-height: 1.8; }
.tf-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tf-choice-option { display: flex !important; min-width: 0; cursor: pointer; align-items: flex-start !important; gap: 9px !important; padding: 10px; border: 1px solid #e5e9f1; border-radius: 10px; background: #fafbfc; }
.tf-choice-option:has(input:checked) { border-color: #9cadf1; background: #f0f3ff; box-shadow: inset 0 0 0 1px rgba(73,105,232,.08); }
.tf-choice-option input { width: 16px !important; min-height: 16px !important; margin-top: 2px; accent-color: var(--tf-blue); }
.tf-choice-option span { display: grid; min-width: 0; }
.tf-choice-option strong { color: #37445a; font-size: 11px; }
.tf-choice-option small { overflow-wrap: anywhere; color: #8a94a7; font-size: 9px; font-weight: 500; }
.tf-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tf-permission-grid section { display: grid; align-content: start; gap: 7px; }
.tf-permission-grid h3 { margin: 0 0 2px; color: #5c687d; font-size: 11px; }
.tf-permission-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tf-permission-chips span { padding: 3px 7px; border-radius: 999px; background: #edf1ff; color: #4660c8; font-size: 9px; line-height: 1.5; }
.tf-permission-chips span.is-critical { background: #fff0ef; color: #b63731; }
.tf-permission-chips em { color: #919aab; font-size: 10px; font-style: normal; }
.tf-effective-access { display: grid; gap: 5px; padding: 11px 13px; border-radius: 11px; background: #f5f7fb; }
.tf-effective-access > strong { color: #4e5a70; font-size: 11px; }
.tf-effective-access > small { color: #7d8799; font-size: 10px; }
.tf-assignment-choice .tf-filter-segment { width: fit-content; max-width: 100%; overflow-x: auto; }
.tf-assignment-choice .tf-filter-segment label { flex: 1; }
.span-all { grid-column: 1 / -1; }

@media (max-width: 1120px) {
    .tf-project-grid, .tf-stage-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tf-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tf-glossary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .tf-app { display: block; }
    .tf-sidebar { position: fixed; z-index: 80; right: 0; width: 258px; transform: translateX(105%); transition: transform .2s ease; }
    .tf-app.sidebar-open .tf-sidebar { transform: translateX(0); }
    .tf-main { padding: 18px 14px 50px; }
    .tf-mobile-head { display: flex; align-items: center; justify-content: space-between; margin: -18px -14px 20px; padding: 12px 16px; border-bottom: 1px solid var(--tf-line); background: #fff; }
    .tf-mobile-head button { background: transparent; cursor: pointer; }
    .tf-dashboard-grid, .tf-split, .tf-workflow-layout { grid-template-columns: 1fr; }
    .tf-template-list { position: static; top: auto; max-height: min(52dvh, 460px); }
    .tf-task-columns, .tf-task-archive-list { grid-template-columns: 1fr; }
    .tf-setup-card > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tf-attachment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .tf-page-head, .tf-editor-head, .tf-project-hero { align-items: flex-start; flex-direction: column; }
    .tf-project-grid, .tf-stage-flow, .tf-metrics, .tf-form-grid, .tf-filters, .tf-inline-form { grid-template-columns: 1fr; }
    .tf-form-grid .span-2 { grid-column: auto; }
    .tf-metrics article { padding: 14px; }
    .tf-project-score { text-align: right; }
    .tf-danger-zone { align-items: flex-start; flex-direction: column; }
    .tf-context-help, .tf-setup-card > header { align-items: flex-start; flex-direction: column; }
    .tf-context-help button { margin-right: 0; }
    .tf-setup-card > div, .tf-guide-steps, .tf-glossary { grid-template-columns: 1fr; }
    .tf-assignment-box { grid-template-columns: 1fr; }
    .tf-attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tf-user-facts { grid-template-columns: 1fr 1fr; }
    .tf-role-list article { flex-wrap: wrap; }
    .tf-role-list .tf-actions { width: 100%; justify-content: flex-start; margin-right: 45px; }
    .tf-choice-grid, .tf-permission-grid { grid-template-columns: 1fr; }
}

/* TaskFlow design system v3 ------------------------------------------------ */
@font-face {
    font-family: Vazirmatn;
    src: url('./fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: Vazirmatn;
    src: url('./fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-style: normal;
    font-weight: 600 900;
    font-display: swap;
}
:root {
    --font-sans: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
    --bg: #f4f6fa;
    --surface: #fff;
    --surface-soft: #f8f9fc;
    --text: #172033;
    --muted: #667085;
    --border: #e3e7ef;
    --primary: #4865df;
    --primary-dark: #3853c5;
    --danger: #c4322b;
    --success: #12805c;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 5px 18px rgba(24, 32, 51, .055);
    --shadow-lg: 0 28px 80px rgba(20, 30, 55, .16);
}
html { font-size: 16px; }
body { font-family: var(--font-sans); font-size: 14px; line-height: 1.75; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(72, 101, 223, .25); outline-offset: 2px; }
.btn, .tf-button { min-height: 44px; border-radius: 11px; font-size: 13px; font-weight: 700; line-height: 1.25; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.btn:active, .tf-button:active { transform: translateY(1px); }
.input, select, textarea, .tf-filters input, .tf-filters select, .tf-form input, .tf-form select, .tf-form textarea, .tf-inline-form input, .tf-inline-form select, .tf-modal-card input, .tf-modal-card select, .tf-modal-card textarea { min-height: 46px; padding: 10px 13px; border-color: #d6dce7; border-radius: 11px; color: var(--text); font-size: 13px; line-height: 1.5; }
textarea, .tf-modal-card textarea { min-height: 92px; resize: vertical; }
select[multiple] { padding: 8px; }
::placeholder { color: #a0a8b7; opacity: 1; }

/* Authentication */
body:has(.auth-page) .topbar, body:has(.auth-page) .footer { display: none; }
body:has(.auth-page) { background: #eef1f7; }
.auth-page { display: grid; min-height: 100dvh; padding: 28px; place-items: center; background: radial-gradient(circle at 13% 15%, rgba(87, 111, 224, .16), transparent 32%), radial-gradient(circle at 90% 85%, rgba(24, 130, 101, .1), transparent 25%), #f3f5f9; }
.auth-shell { display: grid; width: min(1050px, 100%); min-height: 650px; grid-template-columns: minmax(380px, .88fr) minmax(460px, 1.12fr); overflow: hidden; border: 1px solid rgba(221, 227, 238, .9); border-radius: 26px; background: #fff; box-shadow: 0 28px 90px rgba(33, 43, 72, .16); }
.auth-panel { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(38px, 5vw, 64px); background: #fff; }
.auth-brand { display: flex; align-items: center; gap: 11px; width: max-content; margin-bottom: 55px; }
.auth-brand > span { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #536fe3, #354eba); color: #fff; box-shadow: 0 10px 25px rgba(72, 101, 223, .22); font-weight: 900; }
.auth-brand div { display: grid; }
.auth-brand strong { color: #18223a; font-size: 17px; line-height: 1.4; }
.auth-brand small { color: #8992a5; font-size: 11px; }
.auth-heading { margin-bottom: 26px; }
.auth-heading > span, .auth-aside-copy > span { display: block; margin-bottom: 5px; color: var(--primary); font-size: 12px; font-weight: 800; }
.auth-heading h1 { margin: 0 0 7px; color: #172033; font-size: clamp(28px, 3vw, 35px); letter-spacing: -.035em; }
.auth-heading p { max-width: 410px; margin: 0; color: #737e91; font-size: 13px; }
.auth-panel form { display: grid; gap: 17px; margin: 0; }
.field { gap: 7px; }
.field label { color: #3f4a60; font-size: 13px; font-weight: 700; }
.password-field { position: relative; }
.password-field .input { padding-left: 72px; }
.password-field button { position: absolute; top: 50%; left: 8px; min-width: 55px; padding: 6px 8px; transform: translateY(-50%); border-radius: 8px; background: #f1f3f7; color: #647087; cursor: pointer; font-size: 11px; font-weight: 700; }
.auth-submit { justify-content: space-between; margin-top: 6px; padding-inline: 17px; box-shadow: 0 10px 25px rgba(72, 101, 223, .2); }
.auth-submit i { font-size: 20px; font-style: normal; font-weight: 400; }
.auth-register, .auth-support { margin: 21px 0 0; color: #7d8799; text-align: center; font-size: 12px; }
.auth-register a { color: var(--primary); font-weight: 800; }
.auth-support { margin-top: 10px; color: #9aa2b1; font-size: 11px; }
.auth-aside { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(42px, 5.4vw, 70px); background: radial-gradient(circle at 10% 10%, rgba(122, 145, 255, .32), transparent 28%), linear-gradient(145deg, #18243f, #293d83); color: #fff; }
.auth-aside::after { position: absolute; right: -130px; bottom: -160px; width: 360px; height: 360px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; content: ''; }
.auth-aside-warm { background: radial-gradient(circle at 15% 12%, rgba(137, 154, 255, .28), transparent 30%), linear-gradient(145deg, #1b2744, #34467f); }
.auth-aside-copy { position: relative; z-index: 1; max-width: 480px; }
.auth-aside-copy > span { color: #b9c5ff; }
.auth-aside-copy h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.45; letter-spacing: -.04em; }
.auth-aside-copy p { margin: 0; color: #c9d3eb; font-size: 14px; line-height: 2; }
.auth-preview { position: relative; z-index: 1; margin-top: 35px; padding: 20px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 18px; background: rgba(255, 255, 255, .1); box-shadow: 0 22px 50px rgba(8, 15, 36, .2); backdrop-filter: blur(8px); }
.auth-preview-head { display: flex; align-items: center; gap: 9px; }
.auth-preview-head > span { width: 10px; height: 10px; border-radius: 50%; background: #7ee2b8; box-shadow: 0 0 0 5px rgba(126, 226, 184, .12); }
.auth-preview-head b { font-size: 13px; }
.auth-preview-head em { margin-right: auto; color: #cbd5ff; font-size: 12px; font-style: normal; }
.auth-preview-progress { height: 7px; margin: 14px 0 17px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .13); direction: ltr; }
.auth-preview-progress span { display: block; width: 65%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c96ff, #8be3bc); }
.auth-preview-steps { display: grid; gap: 8px; }
.auth-preview-steps article { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; background: rgba(10, 20, 48, .18); }
.auth-preview-steps i { display: grid; width: 27px; height: 27px; flex: none; place-items: center; border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; color: #bcc8e6; font-size: 11px; font-style: normal; }
.auth-preview-steps div { display: grid; }
.auth-preview-steps b { font-size: 11px; }
.auth-preview-steps small { color: #aebbd7; font-size: 9px; }
.auth-preview-steps .done i { border-color: transparent; background: #279a72; color: #fff; }
.auth-preview-steps .active { background: rgba(103, 130, 242, .2); }
.auth-preview-steps .active i { border-color: transparent; background: #637deb; color: #fff; }
.auth-aside-note { position: absolute; z-index: 1; right: clamp(42px, 5.4vw, 70px); bottom: 26px; color: #8291b8; font-size: 10px; }
.auth-benefits { position: relative; z-index: 1; display: grid; gap: 13px; margin: 36px 0 0; padding: 0; list-style: none; color: #d3dbed; }
.auth-benefits li { display: flex; align-items: center; gap: 10px; }
.auth-benefits i { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: rgba(93, 203, 157, .17); color: #8ce1bd; font-style: normal; }

/* Workspace shell */
body:has(.tf-app) { overflow-x: hidden; background: #f4f6fa; }
.tf-app { --tf-navy: #18223a; --tf-blue: #4865df; --tf-soft: #f4f6fa; --tf-line: #e3e7ef; grid-template-columns: 276px minmax(0, 1fr); background: var(--tf-soft); font-size: 14px; }
.tf-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.tf-sidebar { position: sticky; top: 0; height: 100dvh; padding: 23px 17px 18px; background: linear-gradient(180deg, #172138, #1b2948); box-shadow: -7px 0 24px rgba(14, 22, 40, .08); }
.tf-product { gap: 12px; min-height: 52px; padding: 0 7px 18px; }
.tf-product > span { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(145deg, #647ff0, #4059c9); font-size: 13px; }
.tf-product strong { font-size: 18px; letter-spacing: -.02em; }
.tf-product small, .tf-user small { font-size: 11px; }
.tf-nav { gap: 3px; padding: 8px 0 12px; scrollbar-width: thin; }
.tf-nav-label { padding: 20px 13px 7px; color: #72819f; font-size: 10px; letter-spacing: 0; }
.tf-nav button { min-height: 44px; gap: 12px; padding: 10px 13px; border-radius: 11px; color: #b8c3d9; font-size: 13px; font-weight: 600; }
.tf-nav button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tf-nav button:first-of-type svg, .tf-nav button:nth-of-type(2) svg { fill: none; }
.tf-nav button:hover { background: rgba(107, 130, 229, .11); color: #eef2ff; }
.tf-nav button.is-active { background: linear-gradient(90deg, rgba(93, 119, 232, .24), rgba(93, 119, 232, .12)); box-shadow: inset -3px 0 #7890f5; color: #fff; }
.tf-user { min-height: 59px; padding: 14px 7px 0; }
.tf-user > span { width: 39px; height: 39px; background: linear-gradient(145deg, #40557e, #2a3b60); font-size: 13px; }
.tf-user strong { font-size: 12px; }
.tf-main { min-width: 0; padding: 0 0 70px; }
.tf-commandbar { position: sticky; z-index: 40; top: 0; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 0; padding: 10px clamp(22px, 3vw, 42px); border-bottom: 1px solid rgba(224, 228, 237, .9); background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); }
.tf-command-context, .tf-command-actions, .tf-profile-button { display: flex; align-items: center; }
.tf-command-context { gap: 11px; }
.tf-command-context > div { display: grid; }
.tf-command-context small { color: #9099aa; font-size: 10px; line-height: 1.4; }
.tf-command-context strong { color: #202a3d; font-size: 15px; line-height: 1.6; }
.tf-command-actions { gap: 7px; }
.tf-icon-button { position: relative; display: grid; width: 42px; height: 42px; flex: none; place-items: center; border: 1px solid #e3e7ef; border-radius: 11px; background: #fff; color: #5e697e; cursor: pointer; }
.tf-icon-button:hover { border-color: #ccd4e6; background: #f8f9fc; color: var(--tf-blue); }
.tf-icon-button svg, .tf-profile-button svg, .tf-mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tf-notification-button b, .tf-mobile-bell b { position: absolute; top: -4px; left: -4px; display: grid; min-width: 19px; height: 19px; padding: 0 4px; place-items: center; border: 2px solid #fff; border-radius: 99px; background: #e54848; color: #fff; font-size: 9px; line-height: 1; }
.tf-command-divider { width: 1px; height: 28px; margin: 0 5px; background: #e5e8ef; }
.tf-profile-button { gap: 9px; min-width: 165px; padding: 4px 4px 4px 9px; border-radius: 12px; background: transparent; color: #263149; cursor: pointer; text-align: right; }
.tf-profile-button:hover { background: #f5f6f9; }
.tf-profile-button > span { display: grid; width: 35px; height: 35px; flex: none; place-items: center; border-radius: 10px; background: #e8ecfb; color: #4059c9; font-weight: 900; }
.tf-profile-button div { display: grid; min-width: 0; }
.tf-profile-button strong { max-width: 110px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tf-profile-button small { color: #929bad; font-size: 9px; }
.tf-profile-button svg { width: 17px; height: 17px; margin-right: auto; color: #8d96a7; }
.tf-menu-button { display: none; }
.tf-sidebar-backdrop, .tf-mobile-nav { display: none; }
.tf-view { max-width: 1460px; padding: 34px clamp(22px, 3vw, 42px) 0; }
.tf-page-head { align-items: center; margin-bottom: 24px; }
.tf-page-head > div:first-child > span, .tf-editor-head > div > span { margin-bottom: 3px; font-size: 11px; letter-spacing: 0; }
.tf-page-head h1 { margin-bottom: 4px; font-size: clamp(25px, 2.7vw, 34px); }
.tf-page-head p, .tf-card-head p, .tf-editor-head p { color: #737d90; font-size: 13px; }
.tf-button { padding: 10px 16px; }
.tf-button.tiny { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.tf-link, .tf-context-help button, .tf-guide-steps button, .tf-setup-card > header button { min-height: 32px; padding: 5px 8px; border-radius: 8px; font-size: 11px; }
.tf-card, .tf-project-card, .tf-setup-card { border-radius: 16px; box-shadow: var(--shadow-sm); }
.tf-card-head { min-height: 76px; padding: 17px 20px; }
.tf-card-head h2 { font-size: 17px; }
.tf-row { min-height: 70px; padding: 12px 20px; }
.tf-row strong { font-size: 13px; }
.tf-row small { font-size: 11px; }
.tf-metrics { gap: 14px; margin-bottom: 18px; }
.tf-metrics article { min-height: 92px; padding: 18px; border-radius: 16px; }
.tf-metrics i { width: 46px; height: 46px; border-radius: 13px; font-size: 15px; }
.tf-metrics span { font-size: 12px; }
.tf-metrics strong { font-size: 28px; line-height: 1.35; }
.tf-setup-card > header { min-height: 69px; padding: 13px 18px; }
.tf-setup-card > header span { font-size: 10px; }
.tf-setup-card > header strong { font-size: 14px; }
.tf-setup-card > div > button { min-height: 69px; padding: 13px 16px; }
.tf-setup-card > div > button strong { font-size: 11px; }
.tf-setup-card > div > button small { font-size: 10px; }
.tf-context-help { min-height: 50px; padding: 11px 14px; border-radius: 12px; font-size: 12px; line-height: 1.8; }
.tf-filters { gap: 10px; margin-bottom: 20px; padding: 13px; border-radius: 14px; }
.tf-project-grid { gap: 15px; }
.tf-project-card { padding: 19px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tf-project-card h3 { font-size: 17px; }
.tf-project-card .tf-code, .tf-project-card footer { font-size: 11px; }
.tf-status { min-height: 24px; padding: 4px 9px; font-size: 10px; }
.tf-progress { height: 7px; }
.tf-progress-row b { font-size: 11px; }
.tf-task-column { padding: 13px; border-radius: 15px; }
.tf-task-column > header h2 { font-size: 14px; }
.tf-task-column > header span { font-size: 11px; }
.tf-task-card { gap: 9px; padding: 15px; border-radius: 13px; }
.tf-task-card h3 { font-size: 14px; }
.tf-task-card p, .tf-task-card small { font-size: 11px; }
.tf-type, .tf-independent { font-size: 10px; }
.tf-column-empty { font-size: 12px; }
.tf-template-item { min-height: 66px; }
.tf-template-item strong, .tf-template-stages h3 { font-size: 13px; }
.tf-template-item small, .tf-template-stages p, .tf-template-stages small { font-size: 11px; }
.tf-template-editor { padding: 22px; }
.tf-stage-actions button, .tf-actions button { min-height: 32px; padding: 4px; font-size: 11px; }
.tf-entity-list article, .tf-user-list article { min-height: 65px; }
.tf-entity-list strong, .tf-user-list strong { font-size: 13px; }
.tf-entity-list small, .tf-user-list small { font-size: 11px; }
.tf-user-list article form select { min-height: 38px; font-size: 11px; }
.tf-user-list article form button { min-height: 36px; padding: 6px 10px; font-size: 10px; }
.tf-form label, .tf-modal-card label { gap: 6px; font-size: 12px; }
.tf-project-hero { padding: 28px; border-radius: 19px; }
.tf-project-kicker, .tf-project-score span { font-size: 11px; }
.tf-project-hero h1 { font-size: 30px; }
.tf-project-hero p { font-size: 12px; }
.tf-back { min-height: 35px; padding: 5px 0; font-size: 12px; }
.tf-member-pills > span { min-height: 36px; font-size: 11px; }
.tf-stage h3 { font-size: 14px; }
.tf-stage > p, .tf-dependency, .tf-stage-task { font-size: 11px; }
.tf-timeline strong { font-size: 12px; }
.tf-timeline small { font-size: 10px; }
.tf-notification { min-height: 76px; grid-template-columns: 38px 1fr; padding: 15px 19px; }
.tf-notification > i { width: 36px; height: 36px; }
.tf-notification strong { font-size: 13px; }
.tf-notification p { font-size: 11px; }
.tf-notification small { font-size: 10px; }
.tf-table-row { min-height: 56px; font-size: 11px; }
.tf-table-row.tf-table-head { font-size: 10px; }
.tf-task-summary, .tf-task-description { font-size: 12px; }
.tf-assignment-box label strong, .tf-report-list > h3 { font-size: 12px; }
.tf-assignment-box label small, .tf-report-list article strong, .tf-report-list article small, .tf-attachment-grid a { font-size: 10px; }
.tf-report-list article p { font-size: 11px; }
.tf-guide-steps h2 { font-size: 14px; }
.tf-guide-steps p, .tf-glossary span, .tf-guide-copy { font-size: 11px; }
.tf-glossary strong { font-size: 12px; }
.tf-danger-zone strong { font-size: 14px; }
.tf-danger-zone p { font-size: 11px; }
.tf-dialog { border-radius: 20px; }
.tf-modal-card { gap: 17px; padding: 24px; }
.tf-modal-card > header h2 { font-size: 20px; }
.tf-modal-card > header p { font-size: 12px; }
.tf-modal-card > header button { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #f3f5f8; font-size: 22px; }
.tf-target-box > strong { font-size: 12px; }
.tf-target-box > p, .tf-modal-card label small { font-size: 10px; }
.tf-toast { top: 84px; left: 24px; min-width: 260px; max-width: 420px; padding: 13px 16px; border-radius: 12px; font-size: 12px; }

@media (max-width: 980px) {
    .auth-shell { min-height: 600px; grid-template-columns: minmax(350px, .95fr) minmax(380px, 1.05fr); }
    .auth-panel, .auth-aside { padding: 42px; }
    .auth-brand { margin-bottom: 40px; }
    .tf-app { display: block; padding-bottom: 68px; }
    .tf-sidebar { position: fixed; z-index: 90; right: 0; width: 276px; transform: translateX(105%); transition: transform .22s ease; }
    .tf-app.sidebar-open .tf-sidebar { transform: translateX(0); }
    .tf-sidebar-backdrop { position: fixed; z-index: 80; inset: 0; border: 0; background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
    .tf-app.sidebar-open .tf-sidebar-backdrop { display: block; }
    .tf-menu-button { display: grid; }
    .tf-view { padding: 26px 20px 0; }
    .tf-mobile-nav { position: fixed; z-index: 60; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; display: grid; height: 62px; grid-template-columns: repeat(4, 1fr); padding: 5px; border: 1px solid rgba(220, 225, 235, .95); border-radius: 17px; background: rgba(255, 255, 255, .94); box-shadow: 0 14px 40px rgba(22, 31, 54, .17); backdrop-filter: blur(15px); }
    .tf-mobile-nav button { display: grid; min-width: 0; place-items: center; border-radius: 12px; background: transparent; color: #7c8699; cursor: pointer; font-size: 9px; font-weight: 700; }
    .tf-mobile-nav button > svg, .tf-mobile-bell > svg { width: 20px; height: 20px; }
    .tf-mobile-nav button.is-active { background: #edf1ff; color: #405ed4; }
    .tf-mobile-bell { position: relative; display: grid; place-items: center; }
    .tf-mobile-bell b { top: -7px; left: -10px; }
}

@media (max-width: 760px) {
    .auth-page { padding: 0; place-items: stretch; background: #fff; }
    .auth-shell { display: block; width: 100%; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
    .auth-panel { min-height: 100dvh; justify-content: flex-start; padding: 28px 22px max(32px, env(safe-area-inset-bottom)); }
    .auth-brand { margin-bottom: clamp(45px, 11vh, 82px); }
    .auth-heading h1 { font-size: 30px; }
    .auth-aside { display: none; }
    .auth-panel form { gap: 16px; }
    .input, select, textarea, .tf-filters input, .tf-filters select, .tf-form input, .tf-form select, .tf-form textarea, .tf-inline-form input, .tf-inline-form select, .tf-modal-card input, .tf-modal-card select, .tf-modal-card textarea { min-height: 48px; font-size: 14px; }
    .btn, .tf-button { min-height: 46px; font-size: 13px; }
    .tf-commandbar { min-height: 64px; padding: 8px 14px; }
    .tf-command-context { gap: 9px; }
    .tf-command-context small { display: none; }
    .tf-command-context strong { font-size: 14px; }
    .tf-command-actions { gap: 5px; }
    .tf-command-actions .tf-notification-button { display: none; }
    .tf-command-divider, .tf-profile-button div, .tf-profile-button > svg { display: none; }
    .tf-profile-button { min-width: auto; padding: 0; }
    .tf-profile-button > span { width: 40px; height: 40px; }
    .tf-icon-button { width: 40px; height: 40px; }
    .tf-view { padding: 22px 14px 0; }
    .tf-page-head { align-items: stretch; flex-direction: column; gap: 15px; margin-bottom: 20px; }
    .tf-page-head h1 { font-size: 25px; }
    .tf-page-head p { font-size: 12px; }
    .tf-page-head > .tf-button, .tf-page-head > .tf-head-actions { width: 100%; }
    .tf-head-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .tf-page-head > .tf-button { display: flex; }
    .tf-metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
    .tf-metrics article { min-height: 82px; gap: 10px; padding: 13px; }
    .tf-metrics i { width: 39px; height: 39px; }
    .tf-metrics span { font-size: 10px; }
    .tf-metrics strong { font-size: 23px; }
    .tf-dashboard-grid, .tf-split, .tf-workflow-layout, .tf-task-columns, .tf-project-grid, .tf-stage-flow { grid-template-columns: 1fr; }
    .tf-card-head { min-height: 70px; padding: 15px; }
    .tf-row { min-height: 66px; padding: 11px 15px; }
    .tf-setup-card > div { grid-template-columns: 1fr 1fr; }
    .tf-setup-card > div > button { min-height: 73px; padding: 11px; }
    .tf-context-help { align-items: flex-start; flex-direction: column; gap: 5px; }
    .tf-context-help button { margin-right: 0; }
    .tf-filters, .tf-inline-form { grid-template-columns: 1fr; }
    .tf-filters .tf-button { width: 100%; }
    body.task-filters-open { overflow: hidden; }
    .tf-task-filter-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding: 10px; }
    .tf-task-search input { min-height: 46px; font-size: 13px; }
    .tf-task-filter-toggle { min-height: 48px; padding-inline: 12px; }
    .tf-task-filter-toggle span { display: none; }
    .tf-task-scope { grid-column: 1 / -1; display: grid; min-width: 0; grid-template-columns: repeat(3, 1fr); }
    .tf-task-scope span { min-height: 39px; }
    .tf-task-status { max-width: calc(100% - 20px); margin: 0 10px 10px; }
    .tf-task-status span { min-height: 38px; padding-inline: 13px; }
    .tf-task-active-filters { padding: 0 10px 10px; }
    .tf-task-filter-backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
    .tf-task-filter-panel { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: min(86dvh, 720px); overflow-y: auto; border-width: 1px 0 0; border-radius: 22px 22px 0 0; box-shadow: 0 -18px 55px rgba(15,23,42,.24); }
    .tf-task-filter-panel > header { position: sticky; z-index: 2; top: 0; padding: 16px 17px; background: #fff; }
    .tf-task-filter-grid { grid-template-columns: 1fr; padding: 17px; }
    .tf-task-filter-grid input, .tf-task-filter-grid select { min-height: 48px; font-size: 14px; }
    .tf-task-filter-panel > footer { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; padding: 12px 17px max(12px, env(safe-area-inset-bottom)); background: #fff; }
    .tf-template-list { max-height: min(55dvh, 390px); }
    .tf-template-controls { grid-template-columns: 1fr; }
    .tf-template-sort select { min-height: 43px; font-size: 11px; }
    .tf-project-hero { padding: 21px; }
    .tf-project-hero h1 { font-size: 24px; }
    .tf-project-score { min-width: 0; text-align: right; }
    .tf-stage-flow { padding: 13px; }
    .tf-member-pills { padding: 14px; }
    .tf-user-list article { align-items: flex-start; flex-wrap: wrap; }
    .tf-user-list article form { width: 100%; margin: 6px 45px 0 0; }
    .tf-user-list article form select { flex: 1; }
    .tf-guide-steps, .tf-glossary { grid-template-columns: 1fr; }
    .tf-danger-zone { align-items: stretch; flex-direction: column; }
    .tf-dialog, .app-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
    .tf-modal-card, .app-dialog-card { padding: 20px 17px max(20px, env(safe-area-inset-bottom)); }
    .tf-form-grid { grid-template-columns: 1fr; }
    .tf-form-grid .span-2 { grid-column: auto; }
    .tf-assignment-choice .tf-filter-segment { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
    .tf-assignment-choice .tf-filter-segment span { min-height: 43px; padding-inline: 8px; white-space: normal; text-align: center; }
    .tf-modal-card > footer, .app-dialog-card > footer { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; padding-top: 12px; background: #fff; }
    .tf-assignment-box { grid-template-columns: 1fr; }
    .tf-toast { top: 74px; right: 14px; left: 14px; min-width: 0; max-width: none; }
}

@media (max-width: 390px) {
    .auth-panel { padding-inline: 18px; }
    .tf-view { padding-inline: 11px; }
    .tf-metrics { grid-template-columns: 1fr; }
    .tf-metrics article { min-height: 74px; }
    .tf-setup-card > div { grid-template-columns: 1fr; }
    .tf-mobile-nav { right: 8px; left: 8px; }
}

/* Installable app and device notification controls */
.auth-remember { display: flex; align-items: flex-start; gap: 10px; padding: 2px 1px; color: #38445a; cursor: pointer; }
.auth-remember input { width: 18px; height: 18px; margin-top: 3px; accent-color: #3157d5; }
.auth-remember span { display: grid; gap: 1px; }
.auth-remember strong { font-size: 13px; font-weight: 700; }
.auth-remember small { color: #7d8799; font-size: 10px; }
.pwa-install-card { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; width: min(560px, calc(100vw - 48px)); grid-template-columns: 52px 1fr; gap: 14px; padding: 17px; border: 1px solid #dfe4ee; border-radius: 20px; background: rgba(255,255,255,.98); box-shadow: 0 22px 70px rgba(20,31,58,.2); backdrop-filter: blur(18px); }
.pwa-install-card[hidden], .pwa-update-card[hidden], .pwa-offline[hidden] { display: none !important; }
.pwa-install-card img { border-radius: 13px; box-shadow: 0 8px 22px rgba(49,87,213,.2); }
.pwa-install-card h2 { margin: 0; color: #1c2639; font-size: 15px; }
.pwa-install-card p { margin: 3px 0 0; color: #727d90; font-size: 11px; line-height: 1.8; }
.pwa-install-card ol { grid-column: 1 / -1; margin: 9px 18px 0 0; padding: 0 18px 0 0; color: #4d586d; font-size: 11px; line-height: 2; }
.pwa-install-actions { display: flex; grid-column: 1 / -1; gap: 8px; justify-content: flex-end; }
.pwa-update-card { position: fixed; z-index: 110; bottom: 22px; left: 22px; display: flex; align-items: center; gap: 16px; padding: 12px 15px; border-radius: 14px; background: #192338; color: #fff; box-shadow: 0 16px 45px rgba(18,27,48,.25); font-size: 12px; }
.pwa-update-card button { padding: 7px 12px; border: 0; border-radius: 9px; background: #fff; color: #3157d5; font: inherit; font-weight: 800; cursor: pointer; }
.pwa-offline { position: fixed; z-index: 130; top: 0; right: 0; left: 0; padding: 7px 14px; background: #9a3412; color: #fff; text-align: center; font-size: 11px; }
.tf-pwa-settings { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 17px 19px; }
.tf-pwa-settings > div:first-child { display: flex; align-items: center; gap: 12px; }
.tf-pwa-settings h2, .tf-pwa-settings p { margin: 0; }
.tf-pwa-settings h2 { font-size: 14px; }
.tf-pwa-settings p { color: #737e92; font-size: 11px; }
.tf-pwa-settings p[data-state="success"] { color: #15803d; }
.tf-pwa-settings p[data-state="error"] { color: #b42318; }
.tf-pwa-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: #edf1ff; color: #4969e8; font-size: 17px; }

@media (max-width: 760px) {
    .pwa-install-card { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
    .pwa-install-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .pwa-update-card { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; justify-content: space-between; }
    .tf-pwa-settings { align-items: stretch; flex-direction: column; }
    .tf-pwa-settings .tf-head-actions { width: 100%; }
    .tf-template-guide-list, .tf-template-guide-upload { grid-template-columns: 1fr; }
    .tf-template-guide-upload .tf-button { width: 100%; }
}

/* Stage ordering controls support drag and keyboard/touch buttons. */
.tf-sort-controls { display: inline-flex; align-items: center; gap: 4px; }
.tf-sort-controls button { border: 1px solid #d6dce8; border-radius: 6px; background: transparent; color: inherit; padding: 4px 8px; min-height: 30px; cursor: pointer; }
.tf-sort-controls .tf-stage-drag { cursor: grab; font-size: 20px; touch-action: none; }
.tf-sort-controls button:focus-visible { outline: 2px solid #3157d5; outline-offset: 2px; }
[data-sort-step].is-dragging { opacity: .45; }
[data-stage-sort].is-saving-order { pointer-events: none; opacity: .65; }
.tf-sort-hint { color: #64748b; font-size: 12px; padding: 12px 0; }
.tf-stage > header { flex-wrap: wrap; gap: 6px; }
