/* TaskerPro design system ------------------------------------------------ */
:root {
    --tp-bg: #f5f6f8;
    --tp-surface: #ffffff;
    --tp-surface-2: #fafbfc;
    --tp-border: #e5e7eb;
    --tp-border-strong: #d1d5db;
    --tp-text: #161b22;
    --tp-muted: #6b7280;
    --tp-faint: #9ca3af;

    --tp-primary: #7000ff;
    --tp-primary-hover: #5e00d6;
    --tp-primary-soft: #f0e7ff;
    --tp-brand-gradient: linear-gradient(135deg, #7000ff, #ff3366, #ff6b00);

    --tp-todo: #8b93a1;
    --tp-progress: #2f74e0;
    --tp-progress-soft: #e7f0fd;
    --tp-done: #1f9d57;
    --tp-done-soft: #e4f6ec;
    --tp-blocker: #e0483d;
    --tp-blocker-soft: #fdeae8;

    --tp-prio-low: #8b93a1;
    --tp-prio-medium: #2f74e0;
    --tp-prio-high: #e08a00;
    --tp-prio-urgent: #e0483d;

    --tp-radius: 10px;
    --tp-radius-sm: 7px;
    --tp-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --tp-shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
    --tp-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --tp-display: 'Outfit', var(--tp-font);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--tp-bg);
    color: var(--tp-text);
    font-family: var(--tp-font);
    font-size: 14px;
    line-height: 1.5;
}

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

/* Top nav ----------------------------------------------------------------- */
/* Shell + sidebar --------------------------------------------------------- */
.tp-shell { display: flex; align-items: stretch; min-height: 100vh; }
.tp-sidebar {
    position: sticky; top: 0; height: 100vh; width: 216px; flex: none;
    background: var(--tp-surface); border-right: 1px solid var(--tp-border);
    display: flex; flex-direction: column; padding: 16px 12px;
}
.tp-brand { display: flex; align-items: center; gap: 9px; font-family: var(--tp-display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: var(--tp-text); padding: 6px 8px 14px; }
.tp-brand:hover { color: var(--tp-text); }
.tp-brand-logo { width: 28px; height: 28px; border-radius: 8px; display: block; }
.tp-side-links { display: flex; flex-direction: column; gap: 2px; }
.tp-side-link {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: var(--tp-radius-sm);
    color: var(--tp-muted); font-weight: 500; font-size: 14px;
}
.tp-side-link:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-side-link.is-active { background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 600; }
.tp-ico { width: 18px; height: 18px; flex: none; }
.tp-side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--tp-border); }
.tp-side-user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tp-username { font-weight: 600; color: var(--tp-text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-signout { color: var(--tp-muted); font-size: 12px; }
.tp-avatar {
    width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none;
    background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 700; font-size: 12px;
}
.tp-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Layout ------------------------------------------------------------------ */
.tp-main { flex: 1; min-width: 0; padding: 24px 28px 56px; }
@media (max-width: 760px) {
    .tp-shell { flex-direction: column; }
    .tp-sidebar { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
    .tp-brand { padding: 6px 8px; }
    .tp-side-links { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .tp-side-user { margin-top: 0; padding-top: 0; border-top: none; }
    .tp-main { padding: 18px 16px 40px; }
}
.tp-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.tp-page-title { font-family: var(--tp-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.tp-page-sub { color: var(--tp-muted); margin: 2px 0 0; }

/* Buttons ----------------------------------------------------------------- */
.tp-btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    padding: 8px 14px; border-radius: var(--tp-radius-sm); border: 1px solid var(--tp-border-strong);
    background: var(--tp-surface); color: var(--tp-text); font-weight: 600; font-size: 13px;
    font-family: inherit; transition: background .12s, border-color .12s;
}
.tp-btn:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-btn-primary { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; }
.tp-btn-primary:hover { background: var(--tp-primary-hover); border-color: var(--tp-primary-hover); color: #fff; }
.tp-btn-success { background: var(--tp-done); border-color: var(--tp-done); color: #fff; }
.tp-btn-success:hover { background: #1a8a4c; border-color: #1a8a4c; color: #fff; }
.tp-updates-list { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.tp-update { background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 7px 9px; }
.tp-update-body { font-size: 13px; word-break: break-word; }
.tp-update-when { font-size: 11px; color: var(--tp-muted); margin-top: 2px; }
.tp-btn-danger { color: var(--tp-blocker); border-color: var(--tp-border-strong); }
.tp-btn-danger:hover { background: var(--tp-blocker-soft); border-color: var(--tp-blocker); }
.tp-btn-sm { padding: 5px 10px; font-size: 12px; }
.tp-btn:disabled, .tp-btn:disabled:hover { opacity: .45; cursor: not-allowed; background: var(--tp-surface); color: var(--tp-muted); }
.tp-btn-ghost { border-color: transparent; background: transparent; color: var(--tp-muted); }
.tp-btn-ghost:hover { background: var(--tp-surface-2); }
.tp-btn-done { color: var(--tp-done); border-color: var(--tp-border-strong); }
.tp-btn-done:hover { background: var(--tp-done-soft); border-color: var(--tp-done); }
.tp-time-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: var(--tp-muted);
    background: var(--tp-surface-2); border: 1px solid var(--tp-border);
}
.tp-entries { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tp-entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-entry .tp-entry-date { width: auto; padding: 5px 8px; font-size: 12px; }
.tp-entry .tp-entry-min { width: 84px; padding: 5px 8px; }
.tp-section { border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 14px 16px; }
.tp-section + .tp-section { margin-top: 14px; }
.tp-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }

/* Cards ------------------------------------------------------------------- */
.tp-card {
    background: var(--tp-surface); border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius); box-shadow: var(--tp-shadow);
}
.tp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* Project card */
.tp-project { display: block; padding: 18px; position: relative; overflow: hidden; }
.tp-project::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--tp-primary)); }
.tp-project:hover { box-shadow: var(--tp-shadow-lg); transform: translateY(-1px); transition: .15s; }
.tp-project-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.tp-project-logo { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--tp-surface-2); border: 1px solid var(--tp-border); }
.tp-project-logo-fallback { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; background: var(--accent, var(--tp-primary)); }
.tp-project-name { font-weight: 700; font-size: 15px; color: var(--tp-text); margin: 0; }
.tp-project-desc { color: var(--tp-muted); font-size: 13px; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-project-stats { display: flex; gap: 14px; font-size: 12px; color: var(--tp-muted); }
.tp-project-stats b { color: var(--tp-text); }

/* Badges ------------------------------------------------------------------ */
.tp-badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: .01em; cursor: default;
}
.tp-badge-todo { background: #eef0f3; color: #525b67; }
.tp-badge-inprogress { background: var(--tp-progress-soft); color: var(--tp-progress); }
.tp-badge-done { background: var(--tp-done-soft); color: var(--tp-done); }
.tp-badge.is-clickable { cursor: pointer; }
.tp-badge.is-clickable:hover { filter: brightness(.96); }

.tp-prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.tp-prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--p, var(--tp-faint)); }
.tp-prio-low { --p: var(--tp-prio-low); color: var(--tp-prio-low); }
.tp-prio-medium { --p: var(--tp-prio-medium); color: var(--tp-prio-medium); }
.tp-prio-high { --p: var(--tp-prio-high); color: var(--tp-prio-high); }
.tp-prio-urgent { --p: var(--tp-prio-urgent); color: var(--tp-prio-urgent); }

.tp-blocker-tag {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; background: var(--tp-blocker-soft); color: var(--tp-blocker);
}
.tp-due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tp-due-ok { background: var(--tp-surface-2); color: var(--tp-muted); border: 1px solid var(--tp-border); }
.tp-due-soon { background: #fff2e2; color: var(--tp-prio-high); }
.tp-due-over { background: var(--tp-blocker-soft); color: var(--tp-blocker); }

/* Forms ------------------------------------------------------------------- */
.tp-field { margin-bottom: 14px; }
.tp-label { display: block; font-weight: 600; font-size: 12px; color: var(--tp-muted); margin-bottom: 6px; }
.tp-input, .tp-select, .tp-textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--tp-border-strong); border-radius: var(--tp-radius-sm);
    font-family: inherit; font-size: 14px; color: var(--tp-text); background: var(--tp-surface);
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus { outline: none; border-color: var(--tp-primary); box-shadow: 0 0 0 3px var(--tp-primary-soft); }
.tp-textarea { resize: vertical; min-height: 96px; }
.tp-row { display: flex; gap: 12px; }
.tp-row > * { flex: 1; }

/* Empty state ------------------------------------------------------------- */
.tp-empty { text-align: center; padding: 60px 20px; color: var(--tp-muted); }
.tp-empty h3 { color: var(--tp-text); margin: 0 0 6px; }

/* Toggle switch ----------------------------------------------------------- */
.tp-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.tp-switch input { opacity: 0; width: 0; height: 0; }
.tp-switch span { position: absolute; inset: 0; background: var(--tp-border-strong); border-radius: 22px; transition: .15s; cursor: pointer; }
.tp-switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.tp-switch input:checked + span { background: var(--tp-blocker); }
.tp-switch input:checked + span::before { transform: translateX(16px); }

/* Modal ------------------------------------------------------------------- */
.tp-modal-backdrop {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 50;
    display: none; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto;
}
.tp-modal-backdrop.is-open { display: flex; }
.tp-modal {
    background: var(--tp-surface); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow-lg);
    width: 100%; max-width: 540px; max-height: calc(100vh - 96px); display: flex; flex-direction: column;
}
.tp-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--tp-border); }
.tp-modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.tp-modal-x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--tp-muted); cursor: pointer; }
.tp-modal-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 220px); }
.tp-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--tp-border); }
.tp-input-group { display: flex; gap: 8px; }
.tp-input-group .tp-input { flex: 1; }
.tp-color-row { display: flex; align-items: center; gap: 10px; }
.tp-color-swatch { width: 38px; height: 38px; border-radius: var(--tp-radius-sm); border: 1px solid var(--tp-border-strong); padding: 0; cursor: pointer; background: none; }
.tp-alert { background: var(--tp-blocker-soft); color: var(--tp-blocker); padding: 10px 12px; border-radius: var(--tp-radius-sm); margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.tp-card-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; opacity: 0; transition: .12s; }
.tp-project:hover .tp-card-actions { opacity: 1; }
.tp-icon-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--tp-border); background: var(--tp-surface); color: var(--tp-muted); cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.tp-icon-btn:hover { background: var(--tp-surface-2); color: var(--tp-text); }

/* Closed-projects drawer (dashboard) ------------------------------------- */
.tp-closed { margin-top: 28px; }
.tp-closed-toggle { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; color: var(--tp-muted); font-family: var(--tp-display); font-size: 14px; font-weight: 600; padding: 6px 0; }
.tp-closed-toggle:hover { color: var(--tp-text); }
.tp-closed-toggle svg { transition: transform .15s; color: var(--tp-faint); }
.tp-closed.is-open .tp-closed-toggle svg { transform: rotate(90deg); }
.tp-closed-count { background: var(--tp-surface-2); color: var(--tp-faint); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--tp-border); }
.tp-closed-list { display: none; margin-top: 12px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); overflow: hidden; }
.tp-closed.is-open .tp-closed-list { display: block; }
.tp-closed-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--tp-border); }
.tp-closed-row:first-child { border-top: none; }
.tp-closed-row:hover { background: var(--tp-surface-2); }
.tp-closed-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stats bar (project detail) --------------------------------------------- */
.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.tp-stat { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 14px 16px; }
.tp-stat-num { font-size: 24px; font-weight: 800; }
.tp-stat-label { font-size: 12px; color: var(--tp-muted); font-weight: 600; }
.tp-stat-blocker .tp-stat-num { color: var(--tp-blocker); }

/* Tabs -------------------------------------------------------------------- */
.tp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tp-border); margin-bottom: 16px; }
.tp-tab { padding: 8px 14px; border: none; background: none; color: var(--tp-muted); font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; }
.tp-tab.is-active { color: var(--tp-primary); border-bottom-color: var(--tp-primary); }

/* Task rows --------------------------------------------------------------- */
.tp-task { border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); margin-bottom: 8px; background: var(--tp-surface); }
.tp-task.is-blocker { border-left: 3px solid var(--tp-blocker); }
.tp-task-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.tp-task-chevron { background: none; border: none; cursor: pointer; color: var(--tp-faint); font-size: 12px; transition: transform .12s; }
.tp-task.is-open .tp-task-chevron { transform: rotate(90deg); }
.tp-task-title { font-weight: 600; flex: 1; }
.tp-task-title.is-done { text-decoration: line-through; color: var(--tp-muted); }
.tp-task-panel { display: none; padding: 0 14px 14px 38px; border-top: 1px solid var(--tp-border); }
.tp-task.is-open .tp-task-panel { display: block; }
.tp-md { font-size: 14px; line-height: 1.6; }
.tp-md h1, .tp-md h2, .tp-md h3 { margin: .6em 0 .3em; }
.tp-md p { margin: .5em 0; }
.tp-md code { background: var(--tp-surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.tp-md pre { background: var(--tp-surface-2); padding: 12px; border-radius: var(--tp-radius-sm); overflow-x: auto; }
.tp-thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tp-thumb { width: 72px; height: 72px; border-radius: var(--tp-radius-sm); object-fit: cover; border: 1px solid var(--tp-border); cursor: pointer; }
.tp-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 60; display: none; align-items: center; justify-content: center; padding: 40px; }
.tp-lightbox.is-open { display: flex; }
.tp-lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--tp-radius); }
.tp-thumb-grid > div { position: relative; display: inline-block; line-height: 0; }
.tp-thumb-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--tp-blocker); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: none; }
.tp-thumb-grid > div:hover .tp-thumb-x { display: block; }
.tp-thumb-upload { width: 72px; height: 72px; border-radius: var(--tp-radius-sm); border: 1px dashed var(--tp-border-strong); display: grid; place-items: center; cursor: pointer; color: var(--tp-faint); font-size: 22px; }
.tp-thumb-upload:hover { border-color: var(--tp-primary); color: var(--tp-primary); }
.tp-file-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--tp-border); }
.tp-file-name { font-weight: 600; }
.tp-file-size { color: var(--tp-muted); font-size: 12px; }

/* Board ------------------------------------------------------------------- */
.tp-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}
.tp-col {
    border-radius: var(--tp-radius); overflow: hidden;
    display: flex; flex-direction: column;
    border: 1px solid var(--tp-border);
    border-top: 3px solid var(--accent, var(--tp-primary));
    background: color-mix(in srgb, var(--accent, var(--tp-primary)) 6%, var(--tp-surface-2));
}
.tp-col-head {
    display: flex; align-items: center; gap: 9px; padding: 12px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent, var(--tp-primary)) 18%, var(--tp-border));
    background: color-mix(in srgb, var(--accent, var(--tp-primary)) 13%, var(--tp-surface));
}
.tp-col-accent { width: 9px; height: 9px; border-radius: 50%; background: var(--accent, var(--tp-primary)); flex: none; }
.tp-col-logo { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--tp-border); background: var(--tp-surface); }
.tp-col-logo-fallback { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; background: var(--accent, var(--tp-primary)); }
.tp-col-title { font-weight: 700; font-size: 13px; flex: 1; color: var(--tp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-col-count { font-size: 12px; color: var(--tp-muted); }
.tp-col-menu { background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 18px; line-height: 1; padding: 0 6px; border-radius: var(--tp-radius-sm); flex: none; }
.tp-col-menu:hover { color: var(--tp-text); background: var(--tp-surface-2); }
.tp-completed-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--tp-border); }
.tp-completed-row:last-child { border-bottom: none; }
.tp-completed-title { font-size: 13px; font-weight: 600; }
.tp-completed-meta { display: flex; align-items: baseline; gap: 12px; flex: none; }
.tp-completed-when { font-size: 12px; color: var(--tp-muted); white-space: nowrap; }
.tp-completed-time { font-size: 12px; font-weight: 700; color: var(--tp-primary); white-space: nowrap; }
.tp-col-body { padding: 10px; overflow-y: auto; max-height: 56vh; }
.tp-tcard { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 11px; margin-bottom: 9px; box-shadow: var(--tp-shadow); cursor: pointer; }
.tp-tcard.is-blocker { border-left: 3px solid var(--tp-blocker); }
.tp-tcard.is-critical { border-color: var(--tp-blocker); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tp-blocker) 28%, transparent); }
.tp-tcard-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.tp-tcard-title.is-done { text-decoration: line-through; color: var(--tp-muted); }
.tp-tcard-meta { display: flex; align-items: center; gap: 8px; }

/* Organizations ----------------------------------------------------------- */
.tp-org-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tp-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; cursor: pointer;
    border: 1px solid var(--tp-border-strong); border-radius: 20px; background: var(--tp-surface);
    color: var(--tp-muted); font-weight: 600; font-size: 12px; font-family: inherit;
}
.tp-chip:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-chip.is-active { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; }
.tp-chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tp-org-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 700; background: var(--tp-surface-2); color: var(--tp-muted);
    border: 1px solid var(--tp-border);
}

/* Reports ----------------------------------------------------------------- */
.tp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tp-cal-head { text-align: center; font-size: 11px; font-weight: 700; color: var(--tp-faint); padding-bottom: 2px; }
.tp-cal-cell { min-height: 78px; border-radius: 8px; border: 1px solid var(--tp-border); padding: 6px 8px; display: flex; flex-direction: column; }
.tp-cal-cell.is-empty { border: none; background: transparent !important; }
.tp-cal-day { font-size: 12px; font-weight: 700; color: var(--tp-text); }
.tp-cal-cell.is-click { cursor: pointer; }
.tp-cal-cell.is-click:hover { outline: 2px solid var(--tp-primary); outline-offset: -2px; }
.tp-cal-cell.is-today { outline: 2px solid var(--tp-primary); outline-offset: -2px; }
.tp-cal-cell.is-today .tp-cal-day { color: var(--tp-primary); }
.tp-cal-min { margin-top: auto; font-size: 11px; font-weight: 700; color: var(--tp-text); }
.tp-cal-marks { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; align-items: flex-start; }
.tp-cal-mark { font-size: 10px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.tp-cal-mark.time { color: var(--tp-text); }
.tp-cal-mark.done { color: var(--tp-done); }
.tp-cal-mark.plan { color: var(--tp-muted); }
.tp-cal-mark.due { color: var(--tp-blocker); }
.tp-cal-mark.absent { color: #0f766e; }
.tp-cal-cell.is-absent { background: repeating-linear-gradient(135deg, #f0fdfa, #f0fdfa 6px, #e6f7f4 6px, #e6f7f4 12px); border-color: #99e0d6; }
.tp-day-absent { color: #0f766e; }
.tp-day-card.tp-day-absence { --acc: #14b8a6; }
.tp-cal-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.tp-cal-legend .tp-cal-mark { font-size: 11px; }

/* Day-detail popup (calendar) -------------------------------------------- */
.tp-day-detail { margin-bottom: 4px; }
.tp-day-sec { margin-bottom: 12px; }
.tp-day-sec-h { font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.tp-day-done { color: var(--tp-done); }
.tp-day-time { color: var(--tp-text); }
.tp-day-plan { color: var(--tp-muted); }
.tp-day-due { color: var(--tp-blocker); }
.tp-day-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0 3px 20px; }
.tp-day-task { cursor: pointer; border-radius: 6px; padding-right: 8px; }
.tp-day-task:hover { background: var(--tp-surface-2); }
/* Calendar cell: project logos + colored split of the day's logged time */
.tp-cal-cell { position: relative; padding-bottom: 12px !important; }
.tp-cal-logos { display: flex; gap: 3px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.tp-cal-logos img, .tp-cal-logo-dot { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; flex: none; }
.tp-cal-logo-dot { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 800; }
.tp-cal-logo-more { font-size: 10px; font-weight: 700; color: var(--tp-muted); }
.tp-cal-projbar { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 4px; border-radius: 3px; overflow: hidden; display: flex; background: var(--tp-border); }
.tp-cal-projbar span { display: block; height: 100%; }
/* Day popup: project hours */
.tp-day-hero { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tp-day-hero-num { font-family: var(--tp-display); font-size: 26px; font-weight: 700; line-height: 1; }
.tp-day-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--tp-surface-2); }
.tp-day-bar span { display: block; height: 100%; min-width: 4px; }
.tp-day-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 12px; font-size: 12px; }
.tp-day-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.tp-day-logo { border-radius: 7px; object-fit: cover; flex: none; display: inline-block; }
.tp-day-logo-ph { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.tp-day-cards { display: flex; flex-direction: column; gap: 8px; }
.tp-day-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--tp-radius-sm); border: 1px solid var(--tp-border); border-left: 4px solid var(--acc); background: color-mix(in srgb, var(--acc) 7%, var(--tp-surface)); }
.tp-day-card-main { flex: 1; min-width: 0; }
.tp-day-card-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-day-card-sub { font-size: 12px; color: var(--tp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-day-card-time { font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--acc) 16%, transparent); white-space: nowrap; }
.tp-day-addhead { font-size: 11px; font-weight: 700; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--tp-border); padding-top: 14px; margin-bottom: 12px; }
.tp-report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.tp-bar-row { display: grid; grid-template-columns: 148px 1fr 64px; align-items: center; gap: 10px; margin-bottom: 11px; }
.tp-bar-label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.tp-bar-logo { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; flex: none; }
.tp-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-bar-track { height: 10px; background: var(--tp-surface-2); border-radius: 999px; overflow: hidden; }
.tp-bar-fill { height: 100%; border-radius: 999px; min-width: 3px; }
.tp-bar-val { font-size: 12px; font-weight: 700; color: var(--tp-muted); text-align: right; }

/* Kanban (daily lanes) ---------------------------------------------------- */
.tp-kanban {
    display: flex; gap: 14px; align-items: stretch;
    height: calc(100vh - 168px);
    overflow: hidden;
}
.tp-kan-col { flex: 1 1 0; min-width: 0; height: 100%; background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); display: flex; flex-direction: column; }
.tp-kan-col.is-over { outline: 2px dashed var(--tp-primary); outline-offset: -2px; }
.tp-kan-head {
    display: flex; align-items: center; justify-content: space-between; padding: 11px 14px;
    font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--tp-border);
    border-top: 3px solid var(--tp-faint); border-radius: var(--tp-radius) var(--tp-radius) 0 0;
}
.tp-kan-todo { border-top-color: var(--tp-todo); }
.tp-kan-dotoday { border-top-color: var(--tp-progress); }
.tp-kan-completed { border-top-color: var(--tp-done); }
.tp-kan-next { border-top-color: var(--tp-prio-high); }
.tp-kan-count { color: var(--tp-muted); font-weight: 600; }
.tp-kan-time { color: var(--tp-primary); font-weight: 700; font-size: 12px; white-space: nowrap; }
.tp-kan-head-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-kan-head-right { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-kan-head-add { background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 18px; line-height: 1; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.tp-kan-head-add:hover { background: var(--tp-primary-soft); color: var(--tp-primary); }
.tp-kan-cards { padding: 10px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 0; overflow-y: auto; }
.tp-kan-card { position: relative; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 11px; box-shadow: var(--tp-shadow); cursor: grab; }
.tp-kan-proj { padding-right: 18px; }
.tp-kan-dots { position: absolute; top: 5px; right: 5px; background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 16px; line-height: 1; padding: 1px 5px; border-radius: 6px; }
.tp-kan-dots:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-kan-rename { width: 100%; margin-bottom: 8px; font-size: 13px; }
#td_blockerbtn.is-on { border-color: var(--tp-blocker); color: var(--tp-blocker); background: color-mix(in srgb, var(--tp-blocker) 8%, transparent); }
.tp-kan-card:active { cursor: grabbing; }
.tp-kan-card.is-blocker { border-left: 3px solid var(--tp-blocker); }
.tp-kan-card.is-dragging { opacity: .45; }
.tp-kan-proj { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--tp-muted); margin-bottom: 6px; }
.tp-kan-proj img { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }
.tp-kan-proj-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tp-kan-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.tp-kan-title.is-done { text-decoration: line-through; color: var(--tp-muted); }
.tp-kan-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-today-badge { font-size: 11px; font-weight: 700; color: var(--tp-primary); background: var(--tp-primary-soft); padding: 1px 6px; border-radius: 4px; }
/* Critical ---------------------------------------------------------------- */
.tp-critical-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--tp-blocker) 12%, var(--tp-surface)); border: 1px solid var(--tp-blocker); border-radius: var(--tp-radius); padding: 9px 14px; margin-bottom: 18px; }
.tp-critical-label { font-family: var(--tp-display); font-weight: 800; color: var(--tp-blocker); font-size: 13px; white-space: nowrap; }
.tp-critical-items { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.tp-critical-item { display: inline-flex; align-items: center; gap: 2px; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 13px; }
.tp-critical-link { color: var(--tp-text); }
.tp-critical-link:hover { color: var(--tp-blocker); }
.tp-critical-link strong { color: var(--tp-blocker); }
.tp-critical-clear-form { margin: 0; display: inline-flex; }
.tp-critical-clear { background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 16px; line-height: 1; padding: 0 5px; }
.tp-critical-clear:hover { color: var(--tp-blocker); }
.tp-critical-tag { background: var(--tp-blocker); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; line-height: 1.4; }
.tp-kan-card.is-critical { border-color: var(--tp-blocker); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tp-blocker) 28%, transparent); }
#td_criticalbtn.is-on-crit { border-color: var(--tp-blocker); color: var(--tp-blocker); background: color-mix(in srgb, var(--tp-blocker) 8%, transparent); }
/* Docs -------------------------------------------------------------------- */
.tp-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tp-folder { display: block; background: var(--tp-surface); border: 1px solid var(--tp-border); border-top: 3px solid var(--accent, var(--tp-primary)); border-radius: var(--tp-radius); padding: 14px; box-shadow: var(--tp-shadow); }
.tp-folder:hover { border-color: var(--accent, var(--tp-primary)); }
.tp-folder-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.tp-folder-head img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; flex: none; }
.tp-folder-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tp-folder-name { font-weight: 700; color: var(--tp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-folder-counts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--tp-muted); }
.tp-folder-counts .is-on { color: var(--tp-done); font-weight: 700; }
.tp-docs-cols { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.tp-docs-side { min-width: 0; }
.tp-file-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--tp-border); }
.tp-file-row:last-child { border-bottom: none; }
.tp-file-name { flex: 1; color: var(--tp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-file-name:hover { color: var(--tp-primary); }
.tp-link-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--tp-border); }
.tp-link-item:last-child { border-bottom: none; }
.tp-link-a { flex: 1; color: var(--tp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-link-a:hover { color: var(--tp-primary); }
.tp-icon-x { background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 16px; line-height: 1; padding: 0 4px; flex: none; }
.tp-icon-x:hover { color: var(--tp-blocker); }
@media (max-width: 900px) { .tp-docs-cols { grid-template-columns: 1fr; } }
.tp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-table thead th { text-align: left; font-size: 11px; font-weight: 700; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; border-bottom: 1px solid var(--tp-border); background: var(--tp-surface-2); }
.tp-table th.tp-num, .tp-table td.tp-num { text-align: right; width: 1%; white-space: nowrap; color: var(--tp-muted); font-variant-numeric: tabular-nums; padding-right: 20px; }
.tp-table tbody tr { cursor: pointer; border-bottom: 1px solid var(--tp-border); }
.tp-table tbody tr:last-child { border-bottom: none; }
.tp-table tbody tr:hover { background: var(--tp-surface-2); }
.tp-table td { padding: 11px 16px; color: var(--tp-text); }
.tp-table-proj { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tp-table-proj img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: none; }

/* Amount + row-action columns (Invoices/Expenses tables) */
.tp-table th.tp-amt, .tp-table td.tp-amt { text-align: right; white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; padding-right: 22px; }
.tp-table td.tp-amt { font-weight: 700; color: var(--tp-text); }
.tp-table th.tp-amt { color: var(--tp-muted); }
.tp-table th.tp-actions, .tp-table td.tp-actions { text-align: right; white-space: nowrap; width: 1%; padding-left: 8px; }
.tp-inv-badge { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 5px; background: var(--tp-primary-soft); color: var(--tp-primary); text-decoration: none; vertical-align: middle; }
.tp-inv-badge.is-ocr { background: #fff2d6; color: #a76a00; }

/* Invoices: gradient summary stats */
.tp-inv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tp-inv-stat { border-radius: var(--tp-radius); padding: 15px 18px; color: #fff; box-shadow: var(--tp-shadow); }
.tp-inv-stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .92; font-weight: 700; }
.tp-inv-stat .v { font-size: 24px; font-weight: 800; margin-top: 5px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tp-inv-stat.g-inv { background: linear-gradient(135deg, #7000ff, #a855f7); }
.tp-inv-stat.g-exp { background: linear-gradient(135deg, #ff3d68, #ff7a00); }
.tp-inv-stat.g-net { background: linear-gradient(135deg, #159a4f, #10b981); }
.tp-inv-stat.g-net.is-neg { background: linear-gradient(135deg, #c02626, #ff3d68); }
.tp-inv-stat.g-cnt { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
@media (max-width: 760px) { .tp-inv-stats { grid-template-columns: repeat(2, 1fr); } }
.tp-kan-empty { color: var(--tp-faint); font-size: 12px; text-align: center; padding: 16px 0; border: 1px dashed var(--tp-border); border-radius: var(--tp-radius-sm); }
.tp-kan-add { padding: 8px 10px 10px; }
.tp-kan-add-btn { width: 100%; background: none; border: 1px dashed var(--tp-border); border-radius: var(--tp-radius-sm); color: var(--tp-muted); font-size: 12px; font-weight: 600; padding: 8px; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.tp-kan-add-btn:hover { color: var(--tp-primary); border-color: var(--tp-primary); background: color-mix(in srgb, var(--tp-primary) 7%, transparent); }
.tp-kan-add-form { display: none; flex-direction: column; gap: 6px; }
.tp-kan-add-form.is-open { display: flex; }
.tp-kan-add-form .tp-input { font-size: 13px; padding: 7px 8px; }
.tp-menu { position: fixed; z-index: 300; min-width: 188px; max-height: min(70vh, 480px); overflow-y: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); box-shadow: var(--tp-shadow); padding: 5px; display: none; }
.tp-menu.is-open { display: block; }
.tp-menu button { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-size: 13px; padding: 7px 10px; border-radius: 6px; color: var(--tp-text); }
.tp-menu button:hover { background: var(--tp-surface-2); }
.tp-menu-sep { height: 1px; background: var(--tp-border); margin: 5px 4px; }
.tp-menu-danger { color: var(--tp-blocker); }
.tp-pickdrop { position: relative; }
.tp-pickdrop-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); background: var(--tp-surface); cursor: pointer; font-size: 13px; color: var(--tp-text); }
.tp-pickdrop-current { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.tp-pickdrop-current.is-placeholder { color: var(--tp-muted); }
.tp-pickdrop-caret { color: var(--tp-muted); flex: none; }
.tp-pickdrop-current img, .tp-pickdrop-item img { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; flex: none; }
.tp-pickdrop-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tp-pickdrop-list { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 264px; overflow-y: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); box-shadow: var(--tp-shadow); padding: 5px; z-index: 10; }
.tp-pickdrop-list.is-open { display: block; }
.tp-pickdrop-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 9px; border-radius: 6px; font-size: 13px; color: var(--tp-text); }
.tp-pickdrop-item:hover { background: var(--tp-surface-2); }
.tp-pickdrop-item.is-active { background: var(--tp-surface-2); }
.tp-pickdrop-item.is-selected { font-weight: 600; }
.tp-pickdrop-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pickdrop-search { position: sticky; top: -5px; z-index: 1; display: block; width: 100%; box-sizing: border-box; margin: -5px -5px 5px; width: calc(100% + 10px); padding: 9px 11px; border: none; border-bottom: 1px solid var(--tp-border); background: var(--tp-surface); font-size: 13px; color: var(--tp-text); outline: none; border-radius: var(--tp-radius-sm) var(--tp-radius-sm) 0 0; }
.tp-pickdrop-empty { display: none; padding: 8px 9px; font-size: 13px; color: var(--tp-muted); }
.tp-pickdrop-empty.is-shown { display: block; }
.tp-pickdrop-native { position: absolute !important; left: 50%; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }
.tp-pickdrop-inline { min-width: 240px; }
.tp-plan-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
@media (max-width: 1100px) { .tp-plan-grid { grid-template-columns: repeat(2, 1fr); } }
.tp-plan-day { background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 10px; display: flex; flex-direction: column; }
.tp-plan-day.is-today { border-color: var(--tp-primary); }
.tp-plan-day-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.tp-plan-blocks { display: flex; flex-direction: column; gap: 6px; min-height: 38px; margin-bottom: 8px; }
.tp-plan-block { position: relative; background: color-mix(in srgb, var(--tp-primary) 10%, var(--tp-surface)); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 7px 8px; }
.tp-plan-block-time { font-weight: 700; font-size: 12px; }
.tp-plan-block-note { font-size: 11px; color: var(--tp-muted); margin-top: 2px; word-break: break-word; padding-right: 12px; }
.tp-plan-del { position: absolute; top: 3px; right: 3px; margin: 0; }
.tp-plan-x { background: none; border: none; cursor: pointer; color: var(--tp-muted); font-size: 14px; line-height: 1; padding: 0 3px; }
.tp-plan-x:hover { color: var(--tp-blocker); }
.tp-plan-empty { color: var(--tp-faint); text-align: center; font-size: 12px; padding: 8px 0; }
.tp-plan-add { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.tp-plan-time { font-size: 12px; padding: 6px 7px; width: 100%; }
.tp-plan-note { font-size: 12px; padding: 5px 6px; }
.tp-plan-day.is-off { background: repeating-linear-gradient(135deg, var(--tp-surface-2), var(--tp-surface-2) 8px, color-mix(in srgb, var(--tp-muted) 8%, var(--tp-surface-2)) 8px, color-mix(in srgb, var(--tp-muted) 8%, var(--tp-surface-2)) 16px); }
.tp-plan-off { background: color-mix(in srgb, #f59e0b 14%, var(--tp-surface)); border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--tp-border)); border-radius: var(--tp-radius-sm); padding: 7px 8px; margin-bottom: 6px; }
.tp-plan-off-kind { font-weight: 700; font-size: 12px; }
.tp-plan-off-time { font-size: 11px; color: var(--tp-muted); }
.tp-plan-off-actions { display: flex; gap: 4px; margin-top: 6px; }
.tp-plan-off-actions .tp-btn { font-size: 11px; padding: 2px 8px; }

/* Utilities --------------------------------------------------------------- */
.tp-muted { color: var(--tp-muted); }
.tp-flex { display: flex; align-items: center; gap: 10px; }
.tp-spacer { flex: 1; }
.tp-modal-open { overflow: hidden; }
.tp-dialog-backdrop {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 80;
    display: none; align-items: flex-start; justify-content: center; padding: 48px 16px;
}
.tp-dialog-backdrop.is-open { display: flex; }
.tp-entry-view { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tp-entry-view .tp-entry-when { font-weight: 600; }
.tp-entry-view .tp-entry-mins { color: var(--tp-muted); margin-right: auto; }
@media (max-width: 1000px) {
    .tp-kanban { overflow-x: auto; height: auto; padding-bottom: 8px; }
    .tp-kan-col { flex: 0 0 260px; min-width: 260px; height: 70vh; }
}
@media (max-width: 760px) {
    .tp-cal-cell { min-height: 52px; padding: 4px 5px; }
    .tp-cal-mark { font-size: 9px; }
    .tp-cal-legend { gap: 8px; }
}
.tp-link-row { display: flex; gap: 14px; font-size: 13px; margin-top: 4px; }

/* Dialog messages keep their line breaks. */
#tpDialogBody { white-space: pre-line; }

/* Create-invoice line editor */
.tp-gen-lines { border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); overflow: hidden; }
.tp-gen-line { display: grid; grid-template-columns: 28px minmax(180px, 3fr) 70px 64px 100px 84px 90px 34px; gap: 6px; align-items: center; padding: 6px 8px; border-top: 1px solid var(--tp-border); }
.tp-gen-line .tp-input { padding: 7px 8px; font-size: 13px; }
.tp-gen-head { background: #1450E6; color: #fff; font-size: 12px; font-weight: 700; border-top: none; }
.tp-gen-no { color: var(--tp-muted); font-weight: 700; font-size: 12px; text-align: center; }
.tp-gen-sum { text-align: right; font-weight: 700; font-size: 13px; }
@media (max-width: 760px) { .tp-gen-line { grid-template-columns: 22px 1fr 60px 70px; } .tp-gen-line > :nth-child(4), .tp-gen-line > :nth-child(6), .tp-gen-head > :nth-child(4), .tp-gen-head > :nth-child(6) { display: none; } }
.tp-gen-print { margin-top: 14px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 10px 12px; background: var(--tp-surface-2); }
.tp-gen-print summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.tp-gen-print[open] summary { margin-bottom: 10px; }

/* Sortable, numbered tables (data-sortable) */
.tp-table th.tp-rownum, .tp-table td.tp-rownum { width: 34px; color: var(--tp-faint); font-weight: 700; font-size: 12px; text-align: right; padding-right: 6px; }
.tp-table th.tp-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tp-table th.tp-sortable:hover { color: var(--tp-primary); }
.tp-table th.tp-sortable::after { content: " ↕"; color: var(--tp-faint); font-size: 11px; }
.tp-table th.tp-sortable[data-dir="asc"]::after { content: " ↑"; color: var(--tp-primary); }
.tp-table th.tp-sortable[data-dir="desc"]::after { content: " ↓"; color: var(--tp-primary); }
@keyframes tpFlash { 0%, 60% { background: color-mix(in srgb, var(--tp-primary) 16%, transparent); } 100% { background: transparent; } }
.tp-row-flash td { animation: tpFlash 3.5s ease-out; }
.tp-inv-badge.is-missing { background: var(--tp-blocker-soft); color: var(--tp-blocker); border-color: #f3c3be; }
.tp-inv-badge.is-created { background: var(--tp-done-soft); color: var(--tp-done); border-color: transparent; }
.tp-ra-list { border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); max-height: 320px; overflow: auto; }
.tp-ra-row { display: grid; grid-template-columns: 26px 2fr 1.5fr 1.2fr; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--tp-border); font-size: 13px; }
.tp-ra-row:first-child { border-top: none; }

/* ── Sign-in / sign-up ───────────────────────────────────────────────────── */
.tp-auth-body { min-height: 100vh; margin: 0; background: radial-gradient(1200px 600px at 10% -10%, rgba(112,0,255,.18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255,107,0,.16), transparent 60%), var(--tp-bg); display: flex; align-items: center; justify-content: center; }
.tp-auth { width: 100%; max-width: 420px; padding: 32px 18px; }
.tp-auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-family: var(--tp-display); font-weight: 800; font-size: 26px; }
.tp-auth-card { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: 16px; box-shadow: var(--tp-shadow-lg); padding: 28px 26px; }
.tp-auth-title { font-family: var(--tp-display); font-size: 24px; margin: 0 0 4px; }
.tp-auth-sub { color: var(--tp-muted); margin: 0 0 18px; font-size: 14px; }
.tp-auth-btn { width: 100%; justify-content: center; margin-top: 20px; padding: 12px; font-size: 15px; display: flex; text-align: center; text-decoration: none; box-sizing: border-box; }
.tp-auth-error { background: var(--tp-blocker-soft); color: var(--tp-blocker); border-radius: var(--tp-radius-sm); padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.tp-auth-switch { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--tp-muted); }
.tp-auth-foot { text-align: center; color: var(--tp-muted); font-size: 12px; margin-top: 18px; }
.tp-workspace { display: block; margin: 4px 0 14px; padding: 6px 10px; border-radius: var(--tp-radius-sm); background: var(--tp-surface-2); border: 1px solid var(--tp-border); font-size: 12px; font-weight: 600; color: var(--tp-muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-workspace:hover { color: var(--tp-primary); }

/* ── Settings (workspace) ────────────────────────────────────────────────── */
.tp-flash { background: var(--tp-done-soft); color: var(--tp-done); border-radius: var(--tp-radius-sm); padding: 10px 14px; font-weight: 600; margin-bottom: 14px; }
.tp-flash.is-error { background: var(--tp-blocker-soft); color: var(--tp-blocker); }
.tp-invite-link { padding: 14px 16px; margin-bottom: 16px; border-left: 4px solid var(--tp-primary); }
.tp-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tp-settings-card { padding: 18px; }
.tp-settings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.tp-settings-head h2 { font-family: var(--tp-display); font-size: 17px; margin: 0; }
.tp-settings-section { margin-bottom: 26px; }
.tp-settings-sub { font-size: 14px; margin: 16px 0 8px; }
.tp-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tp-surface-2); color: var(--tp-muted); }
.tp-role.is-owner { background: var(--tp-primary-soft); color: var(--tp-primary); }
.tp-role.is-admin { background: var(--tp-progress-soft); color: var(--tp-progress); }
.tp-empty-device { display: flex; gap: 14px; align-items: center; padding: 18px; }
.tp-tama-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--tp-brand-gradient); display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none; }
.tp-pair-code { font-family: var(--tp-display); font-size: 38px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; padding: 14px 0; background: var(--tp-brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Notes ───────────────────────────────────────────────────────────────── */
.tp-notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tp-note-card { padding: 16px; border-top: 4px solid var(--acc); display: flex; flex-direction: column; }
.tp-note-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tp-note-kind { font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tp-surface-2); }
.tp-note-kind.is-meeting { background: var(--tp-progress-soft); color: var(--tp-progress); }
.tp-note-voice { font-weight: 700; color: var(--tp-primary); }
.tp-note-title { font-family: var(--tp-display); font-size: 17px; margin: 10px 0 6px; }
.tp-note-body { font-size: 13.5px; color: var(--tp-text); flex: 1; max-height: 220px; overflow: hidden; }
.tp-note-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }

/* ── Recordings ──────────────────────────────────────────────────────────── */
.tp-powered { font-size: 12px; color: var(--tp-muted); margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--tp-surface-2); border: 1px solid var(--tp-border); white-space: nowrap; }
.tp-powered strong { background: var(--tp-brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-rec-box { padding: 16px; margin-bottom: 18px; }
.tp-rec-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tp-rec-btn { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: var(--tp-brand-gradient); display: flex; align-items: center; justify-content: center; box-shadow: var(--tp-shadow); flex: none; }
.tp-rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: all .15s; }
.tp-rec-btn.is-on { animation: tpPulse 1.2s infinite; }
.tp-rec-btn.is-on .tp-rec-dot { border-radius: 4px; }
@keyframes tpPulse { 0% { box-shadow: 0 0 0 0 rgba(255,51,102,.5); } 70% { box-shadow: 0 0 0 14px rgba(255,51,102,0); } 100% { box-shadow: 0 0 0 0 rgba(255,51,102,0); } }
.tp-rec-state { font-weight: 700; font-size: 15px; }
.tp-rec-sub { font-size: 12.5px; }
.tp-rec-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tp-surface-2); }
.tp-rec-status.is-uploaded, .tp-rec-status.is-transcribing { background: var(--tp-progress-soft); color: var(--tp-progress); }
.tp-rec-status.is-done { background: var(--tp-done-soft); color: var(--tp-done); }
.tp-rec-status.is-failed { background: var(--tp-blocker-soft); color: var(--tp-blocker); }
.tp-rec-transcript { white-space: pre-wrap; background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 12px; max-height: 320px; overflow: auto; font-size: 14px; }

/* Table search (every data-sortable table) + create-in-place in pickers */
.tp-table-search { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.tp-table-search .tp-input { max-width: 320px; padding: 8px 11px; font-size: 13px; }
.tp-table-search span { font-size: 12px; }
.tp-pickdrop-create { display: block; width: 100%; text-align: left; margin-top: 4px; padding: 9px 10px; border: 1px dashed var(--tp-border-strong); border-radius: 7px; background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 700; font-size: 13px; cursor: pointer; }
.tp-pickdrop-create:hover { background: color-mix(in srgb, var(--tp-primary) 14%, white); }

/* AI suggestions ("create project X?") */
.tp-suggestions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tp-suggestion { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--tp-radius); background: linear-gradient(90deg, color-mix(in srgb, #7000ff 9%, white), color-mix(in srgb, #ff6b00 7%, white)); border: 1px solid color-mix(in srgb, var(--tp-primary) 25%, var(--tp-border)); }
.tp-suggestion-ico { font-size: 20px; }

/* People */
.tp-person-dot { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--tp-brand-gradient); color: #fff; font-weight: 800; font-size: 12px; align-items: center; justify-content: center; margin-right: 9px; vertical-align: middle; }
.tp-mentions { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow: auto; }
.tp-mention { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; padding: 9px 10px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); text-decoration: none; color: var(--tp-text); font-size: 13.5px; }
.tp-mention:hover { border-color: var(--tp-primary); }

/* Tabs (instead of stacked tables) */
.tp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tp-border); margin-bottom: 18px; overflow-x: auto; }
.tp-tab { background: none; border: none; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--tp-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tp-tab:hover { color: var(--tp-text); }
.tp-tab.is-active { color: var(--tp-primary); border-bottom-color: var(--tp-primary); }
.tp-tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--tp-surface-2); font-size: 11px; color: var(--tp-muted); }

/* ---- External sign-in (Google / Apple) ---- */
a.tp-auth-brand { text-decoration: none; color: inherit; }
.tp-auth-foot a { color: inherit; opacity: .85; }
.tp-auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--tp-muted, #6b7280); font-size: 12.5px; }
.tp-auth-or::before, .tp-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--tp-border, #e5e7eb); }
.tp-auth-ext { display: grid; gap: 8px; }
.tp-auth-ext-btn { display: flex !important; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; border: 1px solid var(--tp-border, #e5e7eb); color: #161b22; font-weight: 600; text-decoration: none; }
.tp-auth-ext-btn:hover { background: #f8f9fb; }
.tp-auth-apple { background: #000; color: #fff; border-color: #000; }
.tp-auth-apple:hover { background: #1f1f1f; }

/* Transcribe7 logo in "Powered by" badges */
.tp-t7-logo { width: 16px; height: 16px; vertical-align: -3px; margin: 0 3px 0 4px; display: inline-block; }

/* ---- Brand sidebar + gradient page heroes (done log / hours first) ---------------------- */
/* Sidebar stays light; the brand gradient is only an accent (active item + thin top bar). */
.tp-sidebar { position: relative; }
.tp-sidebar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tp-brand-gradient); }
.tp-sidebar .tp-side-link.is-active { background: var(--tp-brand-gradient); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(255, 51, 102, .18); }
.tp-sidebar .tp-side-link.is-active svg { color: #fff; stroke: #fff; }

.tp-hero {
    background: var(--tp-brand-gradient);   /* same as the app header: #7000ff → #ff3366 → #ff6b00 */
    color: #fff; border-radius: 0 0 22px 22px; margin: -24px -28px 22px; padding: 22px 28px 20px;
    box-shadow: 0 10px 30px rgba(112, 0, 255, .18);
}
.tp-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tp-hero-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.tp-hero-big { font-family: var(--tp-display); font-size: 52px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tp-hero-big small { font-size: 22px; font-weight: 700; opacity: .85; }
.tp-hero-sub { font-size: 14px; opacity: .92; }
.tp-hero-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tp-hero-btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 9px; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; }
.tp-hero-btn:hover { background: rgba(255,255,255,.26); color: #fff; }
.tp-hero-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.tp-hero-tile { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 14px; }
.tp-hero-tile .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-hero-tile .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.tp-cal-hours { font-family: var(--tp-display); font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--tp-text); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
    .tp-hero { margin: -18px -16px 18px; padding: 18px 16px; }
    .tp-hero-big { font-size: 40px; }
}

/* ---- People: person picker (Owner/Admin), initials chips, Team page ---- */
.tp-person-pick { position: relative; }
.tp-person-btn { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; }
.tp-person-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; max-height: 360px; overflow: auto;
    background: var(--tp-surface); color: var(--tp-text); border: 1px solid var(--tp-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; }
.tp-person-pick.is-open .tp-person-menu { display: block; }
.tp-person-menu a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13.5px; font-weight: 500; }
.tp-person-menu a:hover { background: var(--tp-surface-2); }
.tp-person-menu a.is-active { background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 600; }
.tp-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pchip { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 800;
    letter-spacing: .02em; line-height: 1; box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
.tp-pchip.is-all { background: linear-gradient(135deg, #7000ff, #0ea5e9); font-size: 13px; }
.tp-pchip.is-sm { width: 18px; height: 18px; font-size: 8.5px; box-shadow: 0 0 0 1.5px var(--tp-surface); }
.tp-pchip.is-lg { width: 34px; height: 34px; font-size: 13px; box-shadow: none; }
.tp-cal-people { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.tp-team-person { display: flex; align-items: center; gap: 10px; }
.tp-team-person small { display: block; color: var(--tp-muted); font-size: 12px; }
.tp-team-table tbody tr { cursor: pointer; }
.tp-team-table tbody tr:hover td { background: var(--tp-surface-2); }
.tp-person-note { font-size: 12.5px; opacity: .92; margin-top: 4px; }
