﻿/* AK-47 TELEPORT brand layer (docs/design-system.md).
   Identity of tele-port.me: electric blue gradient (#4F9BFF → #0064E6), signal orange (#FF7900),
   deep navy ink (#142949 / #010A19), airy sky surfaces. Loaded last on every page, after page stylesheets,
   so the whole panel speaks one language. Fonts are self-hosted (CSP: 'self' only). */

@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url("fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --tp-blue-1: #4f9bff;
    --tp-blue: #0878ef;
    --tp-blue-2: #0064e6;
    --tp-blue-3: #0050bd;
    --tp-orange: #ff7900;
    --tp-orange-1: #ff9a3d;
    --tp-orange-2: #e86a00;
    --tp-navy: #142949;
    --tp-night: #010a19;
    --tp-slate: #526b87;
    --tp-sky: #f3f9fd;
    --tp-mist: #e3edf6;
    --tp-grad: linear-gradient(135deg, var(--tp-blue-1) 0%, var(--tp-blue-2) 100%);
    --tp-grad-cta: linear-gradient(135deg, var(--tp-orange-1) 0%, var(--tp-orange) 55%, var(--tp-orange-2) 100%);

    --if-font: "Onest", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --if-font-display: "Onest", "Segoe UI Variable Display", "Segoe UI", -apple-system, system-ui, sans-serif;
    --if-ink: #0d1d36;
    --if-ink-2: var(--tp-navy);
    --if-muted: var(--tp-slate);
    --if-faint: #8197ad;
    --if-line: #dfe8f2;
    --if-line-soft: #ebf1f7;
    --if-bg: #f2f6fb;
    --if-surface: #ffffff;
    --if-surface-2: #f6f9fd;
    --if-accent: var(--tp-blue);
    --if-accent-2: var(--tp-blue-2);
    --if-accent-soft: #e9f3ff;
    --if-accent-ring: rgba(8, 120, 239, .2);
    --if-gold: var(--tp-orange);
    --if-gold-soft: #fff1e3;
    --if-success: #12a06e;
    --if-danger: #e5484d;
    --if-warning: #e08a00;
    --if-radius-sm: 10px;
    --if-radius: 14px;
    --if-radius-lg: 20px;
    --if-shadow-xs: 0 1px 2px rgba(20, 41, 73, .05);
    --if-shadow-sm: 0 1px 2px rgba(20, 41, 73, .04), 0 6px 18px -8px rgba(20, 41, 73, .10);
    --if-shadow: 0 2px 6px rgba(20, 41, 73, .05), 0 18px 40px -16px rgba(20, 41, 73, .20);
    --if-shadow-lg: 0 34px 80px -28px rgba(1, 10, 25, .42), 0 10px 24px -12px rgba(1, 10, 25, .20);
    --if-ease: cubic-bezier(.2, .8, .2, 1);
    --if-sidebar: #04112a;
    --if-sidebar-2: #0a2250;
    --if-sidebar-text: #b6c7dc;
    --if-sidebar-strong: #ffffff;
    --text: var(--if-ink); --text-muted: var(--if-muted); --bg: var(--if-bg); --surface: var(--if-surface); --border: var(--if-line);
}
html[data-theme="dark"] {
    --if-ink: #eaf1fa;
    --if-ink-2: #cfdcec;
    --if-muted: #93a8c0;
    --if-faint: #6f85a0;
    --if-line: #1f3150;
    --if-line-soft: #18284a;
    --if-bg: #050d1d;
    --if-surface: #0b1830;
    --if-surface-2: #0f1f3b;
    --if-accent: #4f9bff;
    --if-accent-2: #7ab4ff;
    --if-accent-soft: #10284d;
    --if-accent-ring: rgba(79, 155, 255, .28);
    --if-gold: #ff9a3d;
    --if-gold-soft: #33210d;
    --if-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --if-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
    --if-shadow-lg: 0 34px 80px -28px rgba(0, 0, 0, .75);
    --if-sidebar: #020814;
    --if-sidebar-2: #071733;
}

/* ---------- Base ---------- */
:root { font-family: var(--if-font); font-feature-settings: "ss01", "cv01"; }
body { font-family: var(--if-font); letter-spacing: -.003em; }
.has-sidebar { background:
    radial-gradient(900px 420px at 100% -8%, rgba(79, 155, 255, .13), transparent 62%),
    radial-gradient(700px 360px at 30% -12%, rgba(255, 121, 0, .05), transparent 60%), var(--if-bg); background-attachment: fixed; }
html[data-theme="dark"] .has-sidebar { background:
    radial-gradient(900px 420px at 100% -8%, rgba(79, 155, 255, .14), transparent 62%), var(--if-bg); }
h1, h2, h3, h4 { font-family: var(--if-font-display); letter-spacing: -.025em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-weight: 720; }
::selection { background: rgba(8, 120, 239, .18); color: inherit; }
a { color: var(--tp-blue); }
a:hover { color: var(--tp-blue-2); }
html[data-theme="dark"] a { color: #7ab4ff; }
.eyebrow { color: var(--tp-orange); letter-spacing: .16em; }
.eyebrow::before { background: linear-gradient(90deg, var(--tp-orange), rgba(255, 121, 0, 0)); width: 22px; }
hr { border: 0; height: 1px; background: var(--if-line); }

/* Scrollbars: thin and quiet */
* { scrollbar-width: thin; scrollbar-color: rgba(82, 107, 135, .35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(82, 107, 135, .28); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(82, 107, 135, .5); }

/* ---------- Surfaces ---------- */
section, .settings-card, .panel { border-color: var(--if-line); border-radius: var(--if-radius-lg); box-shadow: var(--if-shadow-sm); }
section { position: relative; }
.heading { margin-bottom: 28px; }
.heading h1 { gap: 12px; }
.heading p { color: var(--if-muted); }
.kpi-tile { border-radius: 18px; border-color: var(--if-line); background: linear-gradient(160deg, #fff 0%, var(--if-surface-2) 100%); }
.kpi-tile:hover { box-shadow: var(--if-shadow); border-color: #cfe0f4; }
html[data-theme="dark"] .kpi-tile { background: linear-gradient(160deg, var(--if-surface) 0%, var(--if-surface-2) 100%); }
.kpi-value strong, .kpi-count strong { font-weight: 800; }

/* ---------- Buttons ---------- */
button:not([class]), .button, button.secondary, button.danger {
    min-height: 42px; padding: 10px 18px; border-radius: 12px; font-weight: 650; letter-spacing: 0;
    color: #fff; background: var(--tp-grad); background-size: 140% 140%; background-position: 0% 50%;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 1px 2px rgba(0, 80, 189, .25), 0 8px 20px -10px rgba(0, 100, 230, .55);
    transition: transform .18s var(--if-ease), box-shadow .18s var(--if-ease), background-position .4s var(--if-ease), color .15s, border-color .15s;
}
button:not([class]):hover, .button:hover {
    color: #fff; background-position: 100% 50%; transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 4px rgba(0, 80, 189, .25), 0 14px 28px -12px rgba(0, 100, 230, .6);
}
button:not([class]):active, .button:active { transform: translateY(0) scale(.99); }
.button.cta, button.cta { background: var(--tp-grad-cta); box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 10px 24px -12px rgba(255, 121, 0, .75); color: #fff; }
.button.cta:hover, button.cta:hover { color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 16px 30px -12px rgba(255, 121, 0, .8); }
.button.secondary, button.secondary, a.secondary {
    color: var(--tp-navy); background: var(--if-surface); border: 1px solid var(--if-line); box-shadow: var(--if-shadow-xs);
}
.button.secondary:hover, button.secondary:hover { color: var(--tp-blue-2); background: var(--if-surface); border-color: #b9d4f3; box-shadow: 0 8px 18px -12px rgba(0, 100, 230, .4); }
.button.danger, button.danger { background: linear-gradient(135deg, #f0686c, #d93a3f); color: #fff; box-shadow: 0 8px 18px -10px rgba(217, 58, 63, .6); }
button:disabled, .button.disabled, button[disabled] { opacity: .55; cursor: not-allowed; filter: saturate(.6); }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--if-accent-ring); }
.link-button { color: var(--tp-blue); }
html[data-theme="dark"] button:not([class]), html[data-theme="dark"] .button:not(.secondary):not(.danger):not(.cta) { background: var(--tp-grad); color: #fff; }
html[data-theme="dark"] button.secondary, html[data-theme="dark"] .button.secondary { background: var(--if-surface-2); color: var(--if-ink-2); border-color: var(--if-line); }
html[data-theme="dark"] .button.cta:not(.secondary), html[data-theme="dark"] button.cta:not(.secondary) { background: var(--tp-grad-cta); color: #fff; }
html[data-theme="dark"] .button.danger:not(.secondary), html[data-theme="dark"] button.danger:not(.secondary) { background: linear-gradient(135deg, #f0686c, #d93a3f); color: #fff; }

/* ---------- Fields ---------- */
label { color: var(--tp-navy); font-weight: 640; }
html[data-theme="dark"] label { color: var(--if-ink-2); }
input, textarea, select {
    border: 1px solid #d5e1ee; border-radius: 12px; background-color: var(--if-surface); color: var(--if-ink);
    box-shadow: 0 1px 1px rgba(20, 41, 73, .03) inset; font-family: inherit;
}
input, textarea { padding: 11px 14px; }
select { min-height: 42px; padding: 9px 36px 9px 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230878EF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input:hover, textarea:hover, select:hover { border-color: #b4cbe4; }
input:focus, textarea:focus, select:focus { border-color: var(--tp-blue); box-shadow: 0 0 0 4px var(--if-accent-ring); background-color: var(--if-surface); }
input[type="search"] { padding-left: 38px; background: var(--if-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23526B87' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
input[type="file"] { padding: 8px; border-style: dashed; border-width: 1.5px; background: var(--if-surface-2); cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 9px; background: var(--tp-grad); color: #fff; font: 650 13.5px var(--if-font); cursor: pointer; }
input[type="file"]:hover { border-color: var(--tp-blue); background: var(--if-accent-soft); }
input:invalid:not(:placeholder-shown):not(:focus):not([type="checkbox"]):not([type="radio"]) { border-color: #f1a6a8; }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background-color: var(--if-surface-2); border-color: var(--if-line); }

/* Checkboxes and radios: drawn by hand, crisp at any zoom, same height as the text line. */
/* Components that hide their input (menus, colour and kind pickers) keep it invisible: they set opacity/position, never shown here. */
input:is([type="checkbox"], [type="radio"]) {
    -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 19px; height: 19px; margin: 0; padding: 0;
    vertical-align: -4px; cursor: pointer; border: 1.6px solid #b7c9dd; background-color: var(--if-surface);
    background-repeat: no-repeat; background-position: center; background-size: 0 0;
    box-shadow: 0 1px 2px rgba(20, 41, 73, .06);
    transition: background-color .16s var(--if-ease), background-size .16s var(--if-ease), border-color .16s, box-shadow .16s, transform .12s;
}
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"] { border-radius: 50%; }
input:is([type="checkbox"], [type="radio"]):hover { border-color: var(--tp-blue); }
input:is([type="checkbox"], [type="radio"]):active { transform: scale(.92); }
input[type="checkbox"]:checked {
    border-color: var(--tp-blue-2); background-color: var(--tp-blue); background-size: 12px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.3l2.4 2.4 5.2-5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), var(--tp-grad);
    box-shadow: 0 4px 10px -4px rgba(0, 100, 230, .65);
}
input[type="checkbox"]:indeterminate {
    border-color: var(--tp-blue-2); background-size: 10px 10px, 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5h6' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"), var(--tp-grad);
}
input[type="radio"]:checked {
    border-color: var(--tp-blue-2); background-size: 100% 100%;
    background-image: radial-gradient(circle, #fff 0 3.6px, transparent 4.2px), var(--tp-grad);
    box-shadow: 0 4px 10px -4px rgba(0, 100, 230, .65);
}
input:is([type="checkbox"], [type="radio"]):checked { background-size: 12px 12px, 100% 100%; }
input[type="radio"]:checked { background-size: 100% 100%, 100% 100%; }
input:is([type="checkbox"], [type="radio"]):focus-visible { outline: none; box-shadow: 0 0 0 4px var(--if-accent-ring); }
input:is([type="checkbox"], [type="radio"]):disabled { opacity: .45; cursor: not-allowed; }
html[data-theme="dark"] input:is([type="checkbox"], [type="radio"]):not(:checked) { background-color: var(--if-surface-2); border-color: #34507a; }
/* Page stylesheets set width:auto or 100% on checkboxes (accounts, leads, outreach, filters); a hand-drawn
   box has no intrinsic size, so it would collapse to a sliver or stretch like a text field. Anchored on
   main because page stylesheets load after this file. */
.accounts-list-controls input[type="checkbox"], .accounts-table input[type="checkbox"],
.outreach-source-enabled input[type="checkbox"], .project-form-actions .checkbox-row input[type="checkbox"],
main :not(.meeting-kind-option, .project-color-option) > input:is([type="checkbox"], [type="radio"]):not([role="switch"]):not(.switch):not(.sr-only) {
    width: 19px; min-width: 19px; max-width: 19px; height: 19px; min-height: 19px; flex: 0 0 19px; }
label > input:is([type="checkbox"], [type="radio"]) { margin: 0 9px 0 0; vertical-align: -4px; }
/* A checkbox label is always «box + text» in one line; in a filter grid it sits on the fields' line. */
main label.checkbox-row { display: flex; flex-direction: row; align-items: center; gap: 0; }
main .lead-no-task-filter { min-height: 48px; align-self: end; margin: 0; }
/* Switch: <input type="checkbox" role="switch"> or class="switch" */
input[type="checkbox"]:is([role="switch"], .switch) {
    width: 40px; height: 23px; border-radius: 999px; border: 0; background-color: #c9d7e6; background-size: 17px 17px;
    background-position: 3px center;
    background-image: radial-gradient(circle, #fff 0 7.6px, rgba(1, 10, 25, .18) 8px, transparent 8.6px);
    transition: background-position .2s var(--if-ease), background-color .2s;
}
input[type="checkbox"]:is([role="switch"], .switch):checked {
    background-color: var(--tp-blue); background-size: 17px 17px, 100% 100%; background-position: calc(100% - 3px) center, center;
    background-image: radial-gradient(circle, #fff 0 7.6px, transparent 8.2px), var(--tp-grad);
}

/* ---------- Tables ---------- */
table { border-collapse: separate; border-spacing: 0; }
th { color: var(--tp-slate); font-size: 11px; font-weight: 750; letter-spacing: .09em; background: var(--if-surface-2); border-bottom: 1px solid var(--if-line); }
thead th:first-child { border-top-left-radius: 12px; } thead th:last-child { border-top-right-radius: 12px; }
td { border-bottom: 1px solid var(--if-line-soft); }
tbody tr:hover > td { background: rgba(8, 120, 239, .035); }
tbody tr:has(input[type="checkbox"]:checked) > td { background: rgba(8, 120, 239, .06); }
html[data-theme="dark"] th { background: var(--if-surface-2); }
/* Tables everywhere: a compact rhythm so most registers fit a 1280 px screen. Words are never broken
   mid-way (usernames, phones); a register that is still wider scrolls inside its own block. */
main table { font-size: 13.5px; }
main th, main td { padding-left: 10px; padding-right: 10px; }
main th { letter-spacing: .05em; font-size: 10.5px; white-space: normal; line-height: 1.3; vertical-align: bottom; }
/* Wide tables that still scroll inside their block show a quiet edge shadow instead of a cut. */
.table-wrap, .inbox-table-wrap, .lead-table-wrap, .outreach-table-wrap {
    background: linear-gradient(90deg, var(--if-surface) 30%, rgba(255, 255, 255, 0)) left / 24px 100% no-repeat local,
        linear-gradient(270deg, var(--if-surface) 30%, rgba(255, 255, 255, 0)) right / 24px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(20, 41, 73, .14), transparent) left / 10px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(20, 41, 73, .14), transparent) right / 10px 100% no-repeat scroll; }
/* A label with an «i» hint keeps text and hint on one line and the control full width below,
   so a row of filters stays aligned. */
main label:has(> .hint) { display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 6px; }
label:has(> .hint) > :is(select, textarea, input:not([type="checkbox"]):not([type="radio"])) { flex: 1 0 100%; }
label:has(> .hint) > .hint { position: static; margin: 0; transform: none; }
/* Accounts table: ten columns must fit a 1280–1440 px screen without sideways scrolling. */
.accounts-health-table th, .accounts-health-table td { padding: 12px 9px; }
.accounts-health-table th { letter-spacing: .05em; font-size: 10.5px; white-space: normal; line-height: 1.3; vertical-align: bottom; }
.accounts-health-table th:first-child, .accounts-health-table td:first-child { width: 34px; padding-left: 12px; padding-right: 4px; }
/* Only the status column may wrap a long technical error code (telegram_session_revoked). */
.accounts-health-table td:nth-child(3) { max-width: 160px; overflow-wrap: anywhere; }
.accounts-health-table .account-channel { min-width: 180px; }
.accounts-health-table .status-pill { white-space: nowrap; }
/* Inbox, Requests, Leads: each register fits the content width at 1280 px with the menu open
   (about 965 px). The old fixed minimum widths are gone; long text wraps or is clamped to two lines,
   the row name is the link that opens the record, so no separate «Открыть» column is needed.
   Page stylesheets load after this file, so every rule here is anchored on main to win. */
main :is(.inbox-table, .lead-table, .outreach-table) { min-width: 0; }
main :is(.inbox-table, .lead-table) .status-pill { white-space: normal; border-radius: 10px; line-height: 1.3; max-width: 170px; }
main .inbox-message { max-width: none; min-width: 210px; }
main .inbox-message > span:not([class]) { max-width: none; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: break-word; }
main .inbox-message > .reply-label { display: inline-block; max-width: none; margin: 0 0 4px; }
main .inbox-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
main .inbox-state .unread-badge { min-width: 26px; height: 26px; padding: 0 7px; font-size: 13px; }
main :is(.inbox-name, .lead-name, .outreach-name) { color: var(--tp-navy); }
main :is(.inbox-name, .lead-name, .outreach-name):hover { color: var(--tp-blue); text-decoration: underline; text-underline-offset: 3px; }
main .lead-identity small .lead-meeting-inline-icon { width: 22px; height: 22px; margin-left: 4px; }
main .lead-identity small:has(> .lead-number) { white-space: nowrap; }
main .outreach-error { max-width: none; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
main .outreach-handle { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
html[data-theme="dark"] main :is(.inbox-name, .lead-name, .outreach-name) { color: #8cc4ff; }
html[data-theme="dark"] tbody tr:hover > td { background: rgba(79, 155, 255, .06); }

/* ---------- Pills, badges, messages ---------- */
.status-pill { border-radius: 999px; padding: 4px 11px; font-weight: 700; letter-spacing: .01em; }
.notice { background: #ecfaf3; border-color: #c4ecd8; border-left-color: var(--if-success); color: #0e5a3e; border-radius: 14px; }
.warning { background: #fff5e8; border-color: #ffdcb2; border-left-color: var(--tp-orange); color: #6b3a00; border-radius: 14px; }
html[data-theme="dark"] .notice { background: #0b2a22; border-color: #134535; color: #a8ebcd; }
html[data-theme="dark"] .warning { background: #2f1c06; border-color: #4f2f0a; color: #ffd29c; }
.hint { border-color: #c5d8ee; color: var(--tp-blue); font-family: var(--if-font-display); font-style: normal; font-weight: 800; }
.hint:hover, .hint:focus-visible, .hint.is-open { background: var(--tp-grad); border-color: transparent; }
.hint-pop, .hint-float, .toast { background: #081a3a; border-color: rgba(79, 155, 255, .18); }
.hint-float .hint-link, .hint-pop .hint-link { color: #8cc0ff; }
html[data-theme="dark"] .hint-float, html[data-theme="dark"] .hint-pop { background: #eef5ff; color: var(--tp-navy); }
html[data-theme="dark"] .hint-float .hint-link { color: var(--tp-blue-2); }
.sidebar-count, .kpi-count.is-alert strong { font-weight: 800; }
.sidebar-count { background: var(--tp-grad-cta); box-shadow: 0 0 0 3px rgba(255, 121, 0, .2); }

/* ---------- Tabs (segmented) ---------- */
.account-tabs, .lead-tabs, .inbox-tabs, .outreach-tabs { padding: 5px; border-radius: 16px; background: #eaf1f9; border-color: transparent; }
.account-tabs a, .lead-tabs a, .inbox-tabs a, .outreach-tabs a { border-radius: 12px; color: var(--tp-slate); font-weight: 680; }
.account-tabs a.is-active, .lead-tabs a.is-active, .inbox-tabs a.is-active, .outreach-tabs a.is-active { color: var(--tp-blue-2); background: #fff; box-shadow: 0 1px 2px rgba(20, 41, 73, .06), 0 6px 14px -8px rgba(0, 100, 230, .35); }
html[data-theme="dark"] .account-tabs, html[data-theme="dark"] .lead-tabs, html[data-theme="dark"] .inbox-tabs, html[data-theme="dark"] .outreach-tabs { background: var(--if-surface-2); }
html[data-theme="dark"] .account-tabs a.is-active, html[data-theme="dark"] .lead-tabs a.is-active { color: #9cc7ff; background: var(--if-surface); }

/* ---------- Sidebar ---------- */
.app-sidebar {
    background:
        radial-gradient(420px 260px at -10% -6%, rgba(79, 155, 255, .32), transparent 60%),
        radial-gradient(300px 240px at 120% 105%, rgba(255, 121, 0, .14), transparent 65%),
        linear-gradient(180deg, var(--if-sidebar-2) 0%, var(--if-sidebar) 58%);
    box-shadow: 1px 0 0 rgba(255, 255, 255, .05), 16px 0 48px -28px rgba(1, 10, 25, .7);
}
html[data-theme="dark"] .app-sidebar { background:
    radial-gradient(420px 260px at -10% -6%, rgba(79, 155, 255, .22), transparent 60%),
    linear-gradient(180deg, var(--if-sidebar-2) 0%, var(--if-sidebar) 58%); }
.sidebar-head { border-bottom-color: rgba(255, 255, 255, .07); }
.sidebar-brand { gap: 12px; }
.sidebar-brand .tp-logo { flex: 0 0 auto; }
.sidebar-brand-copy { display: grid; line-height: 1.02; font-family: var(--if-font-display); }
.sidebar-brand-copy .tp-wordmark { font-size: 19px; font-weight: 850; letter-spacing: .04em; color: #fff; }
.sidebar-brand-copy small { margin-top: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .26em; color: var(--tp-orange-1); }
.sidebar-group, .sidebar-section-title, .sidebar-section-toggle { color: rgba(182, 199, 220, .52); letter-spacing: .12em; }
.sidebar-nav-link { border-radius: 12px; font-weight: 580; }
.sidebar-nav-link:hover { background: rgba(255, 255, 255, .07); }
.sidebar-nav-link.is-active {
    background: linear-gradient(90deg, rgba(79, 155, 255, .34), rgba(79, 155, 255, .08)); color: #fff;
    box-shadow: inset 3px 0 0 var(--tp-orange), 0 8px 22px -14px rgba(79, 155, 255, .8);
}
.sidebar-nav-link.is-active .nav-icon { color: #9cc7ff; }
/* Menu icons: a small spring lift on hover, a soft breathing glow on the active item. */
.sidebar-nav-link .nav-icon { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), color .15s, opacity .15s, filter .2s; }
.sidebar-nav-link:hover .nav-icon { transform: translateY(-2px) scale(1.14) rotate(-6deg); color: #fff; opacity: 1; filter: drop-shadow(0 4px 8px rgba(79, 155, 255, .55)); }
.sidebar-nav-link:active .nav-icon { transform: scale(.94); }
.sidebar-nav-link.is-active .nav-icon { animation: tp-icon-glow 3.2s ease-in-out infinite; }
@keyframes tp-icon-glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(79, 155, 255, 0)); } 50% { filter: drop-shadow(0 0 7px rgba(79, 155, 255, .85)); } }
.sidebar-star { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), color .15s; }
.sidebar-star:hover { transform: rotate(72deg) scale(1.15); }
html[data-sidebar="collapsed"] .sidebar-nav-link.is-active { background: rgba(79, 155, 255, .32); }
html[data-theme="dark"] .sidebar-nav-link.is-active { background: linear-gradient(90deg, rgba(79, 155, 255, .3), rgba(79, 155, 255, .06)); }
.sidebar-star:hover, .sidebar-info:hover { color: var(--tp-orange-1); }
/* Items scrolling under the head or the footer fade out instead of looking cut in half. */
.sidebar-nav { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); }
.sidebar-mobile-trigger { background: var(--tp-grad); color: #fff; border: 0; box-shadow: 0 10px 24px -10px rgba(0, 100, 230, .7); }

/* ---------- Animated logo ---------- */
.tp-logo { display: block; overflow: visible; }
.tp-logo-disc { fill: #fff; }
.tp-logo-orbit { stroke: rgba(79, 155, 255, .45); stroke-width: 14; stroke-dasharray: 2702; stroke-dashoffset: 2702; }
.tp-logo-swoosh, .tp-logo-plane { transform-box: view-box; transform-origin: 500px 500px; }
.tp-logo-swoosh { animation: tp-swoosh-in .9s var(--if-ease) .05s both; }
/* Intro once, then a living mark: the plane drifts, every 9 s it "teleports" (leaves top-right, returns
   bottom-left), the orbit turns slowly, a sheen passes. Kept even with reduced motion (brand request),
   but slower and without the teleport jump. */
.tp-logo-plane { animation: tp-plane-in 1s var(--if-ease) .35s both, tp-plane-life 9s ease-in-out 1.6s infinite; }
.tp-logo-orbit { stroke-dasharray: 90 46; stroke-dashoffset: 0; transform-box: view-box; transform-origin: 500px 500px;
    animation: tp-orbit-in 1s var(--if-ease) .2s both, tp-orbit-spin 24s linear 1.2s infinite; }
.tp-logo-sheen { animation: tp-sheen 6s ease-in-out 2.2s infinite; }
.tp-logo-swoosh { animation: tp-swoosh-in .9s var(--if-ease) .05s both, tp-swoosh-breathe 9s ease-in-out 1.6s infinite; }
@keyframes tp-swoosh-in { from { opacity: 0; transform: rotate(-35deg) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes tp-swoosh-breathe { 0%, 100% { transform: none; } 50% { transform: rotate(-6deg) scale(1.02); } }
@keyframes tp-plane-in { 0% { opacity: 0; transform: translate(-220px, 220px) scale(.4); } 70% { opacity: 1; transform: translate(14px, -14px) scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes tp-plane-life {
    0%, 100% { transform: none; opacity: 1; }
    25% { transform: translate(34px, -40px); }
    50% { transform: translate(-10px, 8px); }
    70% { transform: none; opacity: 1; }
    78% { transform: translate(420px, -420px) scale(.5); opacity: 0; }
    79% { transform: translate(-420px, 420px) scale(.5); opacity: 0; }
    88% { transform: translate(18px, -18px) scale(1.04); opacity: 1; }
}
@keyframes tp-orbit-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tp-orbit-spin { to { transform: rotate(360deg); } }
@keyframes tp-sheen { 0%, 70% { transform: translateX(0); } 100% { transform: translateX(1500px); } }
.sidebar-brand:hover .tp-logo-plane { animation: tp-plane-hop .8s var(--if-ease); }
@keyframes tp-plane-hop { 40% { transform: translate(60px, -60px) scale(.9); opacity: 0; } 41% { transform: translate(-60px, 60px) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.sidebar-brand .tp-logo { filter: drop-shadow(0 6px 14px rgba(79, 155, 255, .45)); }
html[data-sidebar="collapsed"] .sidebar-brand .tp-logo { width: 38px; height: 38px; }

/* ---------- Guest pages: sign in ---------- */
.guest-layout { min-height: 100vh; background:
    radial-gradient(900px 600px at 85% 10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(700px 520px at 0% 100%, rgba(255, 121, 0, .28), transparent 62%),
    linear-gradient(135deg, #3d8fff 0%, #0b6cf0 45%, #0049b8 100%); background-attachment: fixed; }
html[data-theme="dark"] .guest-layout { background: radial-gradient(700px 520px at 0% 100%, rgba(255, 121, 0, .18), transparent 62%), linear-gradient(135deg, #0b2a66, #04112a); }
.guest-layout .app-workspace main { display: grid; place-items: center; min-height: calc(100vh - 140px); margin: 0 auto; padding: 48px 20px 24px; }
.guest-layout .app-workspace > footer { color: rgba(255, 255, 255, .7); border: 0; background: transparent; text-align: center; }
/* No transform, opacity, filter or backdrop-filter on anything that holds the SmartCaptcha iframe:
   its anti-clickjacking check then reports "работа на странице ограничена" and blocks sign-in. */
.tp-auth { width: min(440px, 100%); display: grid; gap: 22px; }
.guest-layout main > *, .guest-layout main > * > *, .guest-layout section { animation: none !important; }
.tp-auth-brand { animation: if-rise .6s var(--if-ease) backwards; }
.tp-auth-brand { display: flex; align-items: center; gap: 14px; color: #fff; justify-content: center; }
.tp-auth-brand .tp-logo { filter: drop-shadow(0 14px 28px rgba(1, 10, 25, .35)); }
.tp-auth-brand strong { display: block; font: 850 26px/1 var(--if-font-display); letter-spacing: .05em; }
.tp-auth-brand small { display: block; margin-top: 6px; font: 800 11px/1 var(--if-font); letter-spacing: .3em; color: #ffd2a6; }
.tp-auth-card { padding: 32px 32px 28px; border-radius: 26px; border: 1px solid #fff; background: #fff;
    box-shadow: 0 40px 90px -30px rgba(1, 10, 25, .55); }
html[data-theme="dark"] .tp-auth-card { background: #0b1830; border-color: rgba(79, 155, 255, .2); }
.tp-auth-card .smart-captcha { min-height: 102px; }
.tp-auth-card h1 { margin: 2px 0 6px; font-size: 26px; }
.tp-auth-card > p { margin: 0 0 22px; color: var(--if-muted); }
.tp-auth-card form { display: grid; gap: 14px; }
.tp-auth-card label { display: grid; gap: 7px; margin: 0; }
.tp-auth-card input { width: 100%; min-height: 48px; font-size: 15px; }
.tp-auth-card button { width: 100%; min-height: 50px; margin-top: 6px; font-size: 15.5px; }
.tp-auth-note { margin: 0; text-align: center; color: rgba(255, 255, 255, .78); font-size: 13px; }
.tp-auth-note::before { content: "🔒 "; }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
    /* premium.css turns every animation off here; the brand mark keeps a calm version. */
    .tp-logo .tp-logo-orbit { animation: tp-orbit-spin 48s linear infinite !important; }
    .tp-logo .tp-logo-plane { animation: tp-plane-float 8s ease-in-out infinite !important; }
    .tp-logo .tp-logo-sheen { animation: tp-sheen 9s ease-in-out infinite !important; }
    .tp-logo .tp-logo-swoosh { animation: none !important; }
    .sidebar-nav-link .nav-icon { transition: color .15s !important; }
}
@keyframes tp-plane-float { 0%, 100% { transform: none; } 50% { transform: translate(30px, -34px); } }
@media (max-width: 760px) { h1 { font-size: 25px; } .tp-auth-card { padding: 24px 20px; border-radius: 22px; } }
@media print { .app-sidebar, .sidebar-mobile-trigger { display: none !important; } body, .has-sidebar { background: #fff !important; } }

