/* Motion foundation. Historical styles supply unported page structure only.
   Values and migration boundaries: docs/DESIGN_MOTION.md. */
/* CRM owns same-document transitions. Native cross-document snapshots also run
   on login redirects and can abort while the authenticated shell is appearing. */
@view-transition { navigation:none; }
:root[data-design="motion"] {
  --motion-font:"Segoe UI Variable","Segoe UI",Arial,sans-serif;
  --motion-glass:linear-gradient(145deg,rgba(252,255,254,.72),rgba(249,253,252,.56));
  --motion-glass-strong:linear-gradient(145deg,rgba(252,255,254,.90),rgba(245,251,250,.82));
  --motion-glass-border:rgba(255,255,255,.72);
  --motion-shadow:0 1px 0 rgba(255,255,255,.66) inset,0 18px 42px rgba(26,67,70,.09);
  --motion-blur:26px;
  --motion-saturation:150%;
  --motion-gutter:clamp(16px,1.5vw,32px);
  --motion-rail:76px;
  --motion-sidebar:232px;
  --motion-header:86px;
  --page-bg:#e6f1f2;
  --surface:#f5fbf8;
  --surface-raised:#f7fcfb;
  --surface-subtle:#e9f3f2;
  --surface-highlight:rgba(255,255,255,.72);
  --text:#152b2f;
  --muted:#50686d;
  --faint:#60777c;
  --border:rgba(62,95,106,.22);
  --border-subtle:rgba(62,95,106,.13);
  --primary:#3478db;
  --primary-hover:#2464c3;
  --primary-dark:var(--primary-hover);
  --primary-soft:#e0ecfc;
  --link:#2464c3;
  --link-hover:#184d9e;
  --active:rgba(62,133,232,.13);
  --focus:rgba(37,108,217,.28);
  --success:#267457;--success-bg:#dff1e8;
  --warning:#906018;--warning-bg:#fff0d3;
  --danger:#b93649;--danger-bg:#fbe5ea;
  --overlay:rgba(16,35,48,.44);
  --radius:20px;--radius-md:12px;--radius-lg:20px;
  --control-height:40px;--control-radius:12px;
  --shadow:var(--motion-shadow);--shadow-sm:var(--motion-shadow);
  --shadow-md:0 24px 64px rgba(26,55,70,.22);
}
:root[data-design="motion"][data-theme="dark"] {
  --motion-glass:linear-gradient(145deg,rgba(10,18,24,.76),rgba(12,22,29,.64));
  --motion-glass-strong:linear-gradient(145deg,rgba(14,25,35,.95),rgba(13,25,36,.91));
  --motion-glass-border:rgba(219,241,255,.14);
  --motion-shadow:0 1px 0 rgba(232,248,255,.045) inset,0 22px 52px rgba(0,0,0,.24);
  --motion-blur:30px;--motion-saturation:145%;
  --page-bg:#132333;
  --surface:#142632;--surface-raised:#1b303e;--surface-subtle:#203847;
  --surface-highlight:rgba(226,245,255,.08);
  --text:#f0f7f7;--muted:#bdcdd2;--faint:#a1b7c0;
  --border:rgba(202,230,245,.24);--border-subtle:rgba(202,230,245,.13);
  --primary:#4b8bec;--primary-hover:#3979dc;--primary-soft:#243e60;
  --link:#a4cbff;--link-hover:#c4dfff;--active:rgba(105,164,249,.18);
  --focus:rgba(131,189,255,.44);
  --success:#85d6b7;--success-bg:#193e35;
  --warning:#f1cd86;--warning-bg:#443721;
  --danger:#ffacb9;--danger-bg:#4a2533;
  --overlay:rgba(3,10,19,.66);
  --shadow-md:0 26px 72px rgba(0,0,0,.44);
}
html[data-design="motion"] { background:var(--page-bg);scroll-padding-top:calc(var(--motion-header) + 12px); }
[data-design="motion"] body { background:transparent;font-family:var(--motion-font);font-size:14px;line-height:1.5;color:var(--text); }
[data-design="motion"] .app-shell { position:relative;isolation:isolate;background:transparent;min-height:100dvh; }
.motion-background { position:fixed;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 5% 5%,#b4deef,transparent 60%),linear-gradient(120deg,#dff2ee,#efebf6); }
.motion-background::before,.motion-background::after { content:"";position:absolute;inset:0;background-position:center;background-size:cover;background-repeat:no-repeat;transition:opacity 320ms ease; }
.motion-background::before { background-image:url("../images/motion/glass-light.c9f192a4cbc4.webp");opacity:1; }
.motion-background::after { background-image:url("../images/motion/glass-dark.4e67c63fd20a.webp");opacity:0; }
[data-theme="dark"] .motion-background { background:linear-gradient(120deg,#102c3c,#18253b 55%,#302d50); }
[data-theme="dark"] .motion-background::before { opacity:0; }
[data-theme="dark"] .motion-background::after { opacity:1; }

/* Shell: one scrolling rail, one sticky command bar, natural page scrolling. */
[data-design="motion"] .sidebar { width:var(--motion-rail);height:100dvh;padding:0 12px 12px;border:0;background:transparent;color:var(--text);backdrop-filter:none;box-shadow:none; }
[data-design="motion"] .sidebar-head { display:flex;align-items:center;min-height:var(--motion-header);flex:0 0 var(--motion-header);padding:0 8px; }
[data-design="motion"] .brand { gap:8px;letter-spacing:-.03em; }
[data-design="motion"] .brand-logo { width:30px;height:34px;flex-basis:30px; }
[data-design="motion"] .brand-wordmark { gap:4px;font-size:17px; }
[data-design="motion"] .brand-wordmark b,[data-design="motion"] .brand-wordmark em { color:var(--text); }
[data-design="motion"] .brand-logo-left { fill:#578fc5; }
[data-design="motion"] .brand-logo-right { fill:#81b9e0; }
[data-design="motion"] .brand-logo-bridge { fill:#467cb7; }
[data-design="motion"] .brand .motion-brand-logo { display:block;width:48px;height:48px;flex:0 0 48px;object-fit:contain; }
[data-design="motion"] .motion-brand-name { color:var(--text);font-size:20px;font-weight:650;letter-spacing:-.035em;line-height:1.2;white-space:nowrap; }
[data-design="motion"] .motion-brand-name:focus-visible { outline:2px solid var(--primary);outline-offset:5px;border-radius:4px; }
[data-design="motion"] .sidebar-nav { min-height:0;flex:1 1 auto;gap:10px;padding:4px 0 12px;scrollbar-width:none;scrollbar-gutter:auto;overscroll-behavior:contain; }
[data-design="motion"] .sidebar-nav::-webkit-scrollbar { display:none; }
[data-design="motion"] .nav-group { gap:6px; }
[data-design="motion"] .nav-link { min-height:44px;padding:9px 11px;border:1px solid transparent;border-radius:14px;color:var(--muted);font-size:13px;box-shadow:none; }
[data-design="motion"] .nav-link:hover { background:var(--active);color:var(--text);transform:none; }
[data-design="motion"] .nav-link.active { color:var(--text);background:var(--active);border-color:var(--motion-glass-border);padding-left:11px;box-shadow:0 1px 0 var(--surface-highlight) inset; }
[data-design="motion"] .nav-link.active::before { display:none; }
[data-design="motion"] .nav-icon,[data-design="motion"] .nav-link.active .nav-icon { color:inherit;flex:0 0 30px;width:30px;font-size:18px; }
[data-design="motion"] .nav-icon .icon-svg { width:30px;height:30px; }
[data-design="motion"] .badge::after,[data-design="motion"] .top-icon b::after { animation:none;display:none; }
[data-design="motion"] .sidebar-utility { flex:0 0 auto;margin:0;padding-top:8px;gap:0; }
[data-design="motion"] body .sidebar-help { display:none; }
[data-design="motion"] .sidebar-user { margin-top:6px;padding:8px 0;border:0;border-radius:0;background:transparent; }
[data-design="motion"] .sidebar-collapse-control { min-height:40px;border-radius:12px; }
[data-design="motion"] body.sidebar-collapsed .sidebar { width:var(--motion-rail);padding-inline:12px; }
[data-design="motion"] body.sidebar-collapsed .sidebar-head { padding:0;justify-content:center; }
[data-design="motion"] body.sidebar-collapsed .nav-link { min-height:46px;padding:8px;justify-content:center;border:0; }
[data-design="motion"] body.sidebar-collapsed .nav-link .badge { display:grid;position:absolute;right:0;top:0;min-width:15px;height:15px;padding:0 3px;font-size:9px; }
@media(min-width:761px) {
  [data-design="motion"] body.sidebar-collapsed .sidebar-user { display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 0; }
  [data-design="motion"] .sidebar-nav { padding-top:max(0px,calc(var(--motion-nav-top,190px) - var(--motion-header)));gap:13px; }
  [data-design="motion"] .nav-group { gap:13px; }
  [data-design="motion"] .nav-link { transform:scale(var(--nav-scale,1));transform-origin:center;transition:transform 140ms ease,color 140ms ease,background 140ms ease; }
  [data-design="motion"] .nav-link:hover { transform:scale(var(--nav-scale,1.2)); }
  [data-design="motion"][data-theme="dark"] .nav-link { color:#e0edff;filter:drop-shadow(0 1px 3px #07152688); }
  [data-design="motion"][data-theme="dark"] .nav-link.active { color:#fff;background:#315e9aa8;box-shadow:0 0 20px #7ebdff25; }
  [data-design="motion"] .sidebar-user { border:0; }
}
[data-design="motion"] .main { margin-left:var(--motion-sidebar);min-width:0;background:transparent; }
[data-design="motion"] body.sidebar-collapsed .main { margin-left:var(--motion-rail); }
[data-design="motion"] .topbar { height:var(--motion-header);gap:20px;padding:0 var(--motion-gutter);border:0;background:transparent;backdrop-filter:none;box-shadow:none; }
.motion-workspace-heading { display:flex;flex-direction:column;min-width:0;gap:1px; }
.motion-workspace-heading>span { max-width:24ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:650;font-size:13px; }
.motion-workspace-heading small { font-size:10px;letter-spacing:.08em;color:var(--muted); }
[data-design="motion"] .global-search { flex:1 1 240px;width:auto;max-width:420px;min-width:140px;height:40px;margin-left:auto;border-color:var(--border-subtle);border-radius:14px;background:color-mix(in srgb,var(--surface) 48%,transparent); }
[data-design="motion"] .global-search input { min-height:0;height:38px;border:0;background:transparent;padding:0;box-shadow:none; }
[data-design="motion"] .topbar-actions { flex-shrink:0;gap:6px;min-height:44px;padding:0;border:0;background:transparent;box-shadow:none; }
[data-design="motion"] .top-icon,[data-design="motion"] .top-user { border:1px solid var(--motion-glass-border);border-radius:50%;background:color-mix(in srgb,var(--surface) 42%,transparent); }
[data-design="motion"] .top-user { width:40px;padding:2px;justify-content:center; }
[data-design="motion"] .top-user-copy,[data-design="motion"] .top-user-chevron { display:none; }
[data-design="motion"] .avatar { border-radius:50%;background:linear-gradient(140deg,#d3bcaa,#52838f);color:#fff; }
[data-design="motion"] .top-user .avatar { width:34px;height:34px; }
[data-design="motion"] .theme-switch { border-radius:999px;background:color-mix(in srgb,var(--surface) 48%,transparent);border:1px solid var(--motion-glass-border); }
[data-design="motion"] .theme-switch-thumb { border-radius:50%; }
[data-design="motion"] .content { width:100%;max-width:2400px;padding:24px var(--motion-gutter) 36px; }
/* A named view-transition element establishes a containing/stacking context.
   Release the page context while its fixed drawer is open above the shell. */
[data-design="motion"] body.client-preview-open .content { view-transition-name:none!important; }
[data-design="motion"] .page-head { margin-bottom:20px;align-items:center;gap:16px; }
[data-design="motion"] .page-head h1 { font-size:24px;line-height:1.2;letter-spacing:-.025em; }
[data-design="motion"] .page-head p { font-size:12px;line-height:1.5;color:var(--muted); }
[data-design="motion"] .legal-footer { display:flex;flex-wrap:wrap;justify-content:center;gap:8px 20px;padding:16px var(--motion-gutter) 24px;color:var(--muted);font-size:11px; }
[data-design="motion"] .legal-footer a { color:inherit; }

/* Shared glass and controls. Floating layers are deliberately denser. */
[data-design="motion"] .panel,[data-design="motion"] .stat { background:var(--motion-glass);border:1px solid var(--motion-glass-border);border-radius:20px;box-shadow:var(--motion-shadow);backdrop-filter:blur(var(--motion-blur)) saturate(var(--motion-saturation)); }
[data-design="motion"] .panel { padding:18px; }
[data-design="motion"] .panel-head h2 { font-size:15px; }
[data-design="motion"] .compact-panel { padding:12px 16px; }
[data-design="motion"] .btn { min-height:40px;padding:8px 13px;border-radius:12px;font-size:12px;background:color-mix(in srgb,var(--surface) 60%,transparent);color:var(--text); }
[data-design="motion"] .btn.primary { background:var(--primary);color:#fff;border-color:var(--primary); }
[data-design="motion"] .btn.primary:hover { background:var(--primary-hover);border-color:var(--primary-hover); }
[data-design="motion"] .btn.danger { color:var(--danger);border-color:var(--danger); }
[data-design="motion"] .btn.small { min-height:34px; }
[data-design="motion"] .input,[data-design="motion"] input:not([type="checkbox"]):not([type="radio"]),[data-design="motion"] select,[data-design="motion"] textarea,[data-design="motion"] .crm-select-trigger { border-radius:12px;min-height:40px;background:color-mix(in srgb,var(--surface) 70%,transparent);color:var(--text);font-size:13px; }
[data-design="motion"] input::placeholder,[data-design="motion"] textarea::placeholder { color:var(--faint);opacity:1; }
[data-design="motion"] .dialog,[data-design="motion"] .crm-select-popover,[data-design="motion"] .review-filter-popover,[data-design="motion"] .client-preview-account-menu { background:var(--motion-glass-strong);backdrop-filter:blur(30px);border-color:var(--motion-glass-border);border-radius:20px;box-shadow:var(--shadow-md); }
[data-design="motion"] .dialog { max-height:calc(100dvh - 32px);overflow:auto; }
[data-design="motion"] .dialog-head h2 { font-size:20px; }
[data-design="motion"] :focus-visible { outline:3px solid var(--primary);outline-offset:3px; }
[data-design="motion"] .btn:disabled { opacity:.55;cursor:not-allowed;transform:none; }

/* Clients pilot. Scroll the document so filters, demo banner and pagination fit
   at short heights and at 200% zoom. No fixed viewport height calculation. */
[data-design="motion"] .main:has(.clients-viewport) { display:block;height:auto;min-height:100dvh;overflow:visible; }
[data-design="motion"] .main:has(.clients-viewport)>.content { display:block;max-width:2400px;min-height:0;overflow:visible;padding:24px var(--motion-gutter) 36px; }
[data-design="motion"] .main:has(.clients-viewport)>.legal-footer { display:flex; }
[data-design="motion"] .clients-viewport { display:block;width:100%;height:auto;min-height:0; }
[data-design="motion"] .clients-page-head .page-actions>.btn { display:inline-flex; }
[data-design="motion"] .client-toolbar { padding:14px 16px 12px;border:1px solid var(--motion-glass-border);border-radius:20px;background:var(--motion-glass);box-shadow:var(--motion-shadow);backdrop-filter:blur(var(--motion-blur)) saturate(var(--motion-saturation)); }
[data-design="motion"] .clients-viewport .filter-bar { display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px; }
[data-design="motion"] .clients-viewport .client-search-control { min-width:0;grid-column:span 2;grid-row:1; }
[data-design="motion"] .clients-viewport .filter-bar>.crm-select { min-width:0;width:100%; }
[data-design="motion"] .clients-viewport .filter-bar>select:not(.crm-select-native) { display:block!important;min-width:0;width:100%; }
[data-design="motion"] .filter-chips { display:flex;flex-wrap:wrap;overflow:visible;gap:8px;margin:12px 0 0;padding-top:12px;border-color:var(--border-subtle); }
[data-design="motion"] .filter-chip { min-height:34px;padding:6px 11px;border:1px solid var(--border-subtle);background:color-mix(in srgb,var(--surface) 36%,transparent);color:var(--muted);font-size:12px; }
[data-design="motion"] .filter-chip.active { background:var(--active);border-color:color-mix(in srgb,var(--primary) 26%,transparent);color:var(--text); }
[data-design="motion"] .filter-chip b { background:color-mix(in srgb,var(--surface) 55%,transparent);color:var(--text);font-variant-numeric:tabular-nums; }
[data-design="motion"] .view-switch { height:40px;background:color-mix(in srgb,var(--surface) 50%,transparent);border-radius:13px;border-color:var(--motion-glass-border); }
[data-design="motion"] .bulk-panel { display:flex;flex-wrap:wrap;gap:10px;margin:12px 0; }
[data-design="motion"] .bulk-panel>.input,[data-design="motion"] .bulk-panel>.crm-select { flex:1 1 170px;min-width:0; }
[data-design="motion"] .client-view { margin-top:16px; }
[data-design="motion"] .clients-viewport .client-list-view,[data-design="motion"] .clients-viewport .client-list-workspace { height:auto;min-height:0; }
[data-design="motion"] .client-table,[data-design="motion"] .client-preview,[data-design="motion"] .client-block { border:1px solid var(--motion-glass-border);border-radius:20px;background:var(--motion-glass);box-shadow:var(--motion-shadow);backdrop-filter:blur(var(--motion-blur)) saturate(var(--motion-saturation)); }
[data-design="motion"] .clients-viewport .client-table { height:auto;max-height:min(900px,76dvh);overflow:auto;scrollbar-width:thin; }
[data-design="motion"] .client-table table { min-width:1000px; }
[data-design="motion"] .client-table th { height:42px;padding:10px 12px;background:var(--surface-raised);font-size:11px;color:var(--muted); }
[data-design="motion"] .client-table td { height:70px;padding:12px;font-size:13px;border-color:var(--border-subtle); }
[data-design="motion"] .client-row:hover { background:var(--active); }
[data-design="motion"] .client-identity strong { font-size:14px;white-space:normal;overflow-wrap:anywhere;line-height:1.4; }
[data-design="motion"] .client-identity small,[data-design="motion"] .cell-note { color:var(--muted);font-size:11px;white-space:normal;overflow-wrap:anywhere; }
[data-design="motion"] .person-compact>span { white-space:normal;overflow-wrap:anywhere; }
[data-design="motion"] .client-table td:has(.person-compact) { min-width:130px; }
[data-design="motion"] .client-monogram { background:color-mix(in srgb,var(--active) 65%,var(--surface));box-shadow:none;color:var(--link); }
[data-design="motion"] .client-preview-card { padding:18px; }
[data-design="motion"] .client-preview-card::before { display:none; }
[data-design="motion"] .client-preview-placeholder,[data-design="motion"] .client-preview-loading,[data-design="motion"] .client-preview-error { min-height:360px; }
[data-design="motion"] .client-preview-identity strong { white-space:normal;overflow-wrap:anywhere;font-size:16px; }
[data-design="motion"] .client-preview-facts dt,[data-design="motion"] .client-preview-facts dd,[data-design="motion"] .client-preview-note p,[data-design="motion"] .client-preview-access>p { font-size:12px;overflow-wrap:anywhere; }
[data-design="motion"] .clients-viewport .client-grid-view { height:auto;overflow:visible;grid-template-columns:repeat(auto-fill,minmax(min(310px,100%),1fr));gap:16px;padding:0; }
[data-design="motion"] .client-block::before,[data-design="motion"] .client-block::after { display:none; }
[data-design="motion"] .client-block { min-height:0; }
[data-design="motion"] .client-block-link { min-height:0;padding:18px; }
[data-design="motion"] .client-block-title strong { white-space:normal;overflow-wrap:anywhere;font-size:15px; }
[data-design="motion"] .client-block-details dd { overflow-wrap:anywhere; }
[data-design="motion"] .client-block-payment { display:inline; }
[data-design="motion"] .client-state-label { font-size:11px; }
[data-design="motion"] .client-block .status-pill { white-space:normal; }

@media(min-width:1321px) {
  [data-design="motion"] .clients-viewport .client-list-workspace { grid-template-columns:minmax(0,1fr) var(--client-preview-width,350px)!important;gap:16px!important;align-items:start!important; }
  [data-design="motion"] .clients-viewport .client-preview { position:sticky!important;top:calc(var(--motion-header) + 16px)!important;height:auto!important;max-height:calc(100dvh - var(--motion-header) - 32px)!important;min-height:360px!important;border-radius:20px!important;box-shadow:var(--motion-shadow)!important; }
}
@media(max-width:1380px) {
  [data-design="motion"] .clients-viewport .client-table { max-height:none;overflow:visible;background:transparent;box-shadow:none;backdrop-filter:none;border:0; }
  [data-design="motion"] .client-table table { min-width:0; }
  [data-design="motion"] .client-table tr { padding:18px;border-radius:20px;background:var(--motion-glass);border:1px solid var(--motion-glass-border);box-shadow:var(--motion-shadow);backdrop-filter:blur(var(--motion-blur)); }
  [data-design="motion"] .client-table td { height:auto;padding:0; }
  [data-design="motion"] .client-table td::before { content:attr(data-label);font-size:11px;color:var(--muted); }
  [data-design="motion"] .client-table td[data-label="Программист"] { display:block; }
}
@media(max-width:1320px) {
  [data-design="motion"] .clients-viewport .client-preview { background:var(--motion-glass-strong);max-width:100vw;border-radius:20px 0 0 20px; }
}
@media(max-width:1100px) {
  .motion-workspace-heading { display:none; }
  [data-design="motion"] .topbar { gap:12px; }
}
@media(min-width:761px) and (max-width:980px) {
  [data-design="motion"] .sidebar,[data-design="motion"] body.sidebar-collapsed .sidebar { width:var(--motion-rail);padding-inline:12px; }
  [data-design="motion"] .main,[data-design="motion"] body.sidebar-collapsed .main { margin-left:var(--motion-rail); }
  [data-design="motion"] .brand-wordmark,[data-design="motion"] body.sidebar-collapsed .brand-wordmark,[data-design="motion"] .nav-link>span:not(.nav-icon),[data-design="motion"] body.sidebar-collapsed .nav-link>span:not(.nav-icon),[data-design="motion"] .sidebar-user-copy,[data-design="motion"] body.sidebar-collapsed .sidebar-user-copy,[data-design="motion"] .sidebar-signout,[data-design="motion"] body.sidebar-collapsed .sidebar-signout { display:none; }
  [data-design="motion"] .sidebar-head,[data-design="motion"] .nav-link,[data-design="motion"] body.sidebar-collapsed .nav-link { padding-inline:0;justify-content:center; }
  [data-design="motion"] .sidebar-user,[data-design="motion"] body.sidebar-collapsed .sidebar-user { display:flex;justify-content:center; }
  [data-design="motion"] .profile-mini-link { display:block; }
}
@media(max-width:760px) {
  :root[data-design="motion"] { --motion-header:64px;--motion-gutter:14px; }
  [data-design="motion"] .sidebar,[data-design="motion"] body.sidebar-collapsed .sidebar { width:min(320px,90vw);padding:0 14px 14px;background:var(--motion-glass-strong); }
  [data-design="motion"] .sidebar-head,[data-design="motion"] body.sidebar-collapsed .sidebar-head { padding:0 8px;justify-content:space-between; }
  [data-design="motion"] body.sidebar-collapsed .brand-wordmark { display:flex; }
  [data-design="motion"] body.sidebar-collapsed .nav-link>span:not(.nav-icon) { display:inline; }
  [data-design="motion"] .nav-link,[data-design="motion"] body.sidebar-collapsed .nav-link { justify-content:flex-start;padding:10px; }
  [data-design="motion"] .nav-icon,[data-design="motion"] .nav-link.active .nav-icon { width:28px;flex-basis:28px; }
  [data-design="motion"] .nav-icon .icon-svg { width:30px;height:30px; }
  [data-design="motion"] body.sidebar-collapsed .nav-link .badge { position:static;margin-left:auto; }
  [data-design="motion"] body.sidebar-collapsed .sidebar-user-copy { display:flex; }
  [data-design="motion"] body.sidebar-collapsed .sidebar-signout { display:grid; }
  [data-design="motion"] body.sidebar-collapsed .sidebar-user { display:grid;grid-template-columns:1fr 36px; }
  [data-design="motion"] body.sidebar-collapsed .profile-mini-link { display:grid;grid-template-columns:38px 1fr; }
  [data-design="motion"] .main,[data-design="motion"] body.sidebar-collapsed .main { margin-left:0; }
  [data-design="motion"] .topbar { gap:8px;padding-inline:10px; }
  [data-design="motion"] .topbar .global-search { display:none; }
  [data-design="motion"] .topbar-actions { margin-left:auto;gap:4px; }
  [data-design="motion"] .content,[data-design="motion"] .main:has(.clients-viewport)>.content { padding:18px 14px 24px; }
  [data-design="motion"] .page-head { align-items:flex-start;flex-direction:column;gap:12px; }
  [data-design="motion"] .clients-page-head .page-actions { display:flex;width:100%;flex-wrap:wrap; }
  [data-design="motion"] .clients-page-head .page-actions>.btn { flex:1 1 auto; }
  [data-design="motion"] .clients-page-actions>button.btn { width:auto;padding:8px 13px;font-size:12px; }
  [data-design="motion"] .client-toolbar { padding:12px; }
  [data-design="motion"] .clients-viewport .filter-bar { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  [data-design="motion"] .clients-viewport .filter-bar .btn.ghost { display:flex!important; }
  [data-design="motion"] .clients-viewport .client-search-control { grid-column:1/-1; }
  [data-design="motion"] .filter-chip { min-height:40px; }
  [data-design="motion"] .btn,[data-design="motion"] .crm-select-trigger { min-height:44px; }
  [data-design="motion"] .client-table td[data-label="Клиент"] { padding-right:64px; }
  [data-design="motion"] .client-table .client-identity { min-width:0;align-items:flex-start; }
  [data-design="motion"] .client-table td[data-label="Программист"] { display:block; }
  [data-design="motion"] .client-preview-card { padding:16px; }
  [data-design="motion"] .client-block-details>div { grid-template-columns:92px minmax(0,1fr); }
  [data-design="motion"] .client-block-foot { grid-template-columns:1fr auto; }
  [data-design="motion"] .client-block-payment { grid-column:1;font-size:12px; }
  [data-design="motion"] .client-block-arrow { grid-column:2;grid-row:1/3; }
  [data-design="motion"] .legal-footer { padding-bottom:calc(90px + env(safe-area-inset-bottom)); }
  [data-design="motion"] .mobile-bottom-nav { background:var(--motion-glass-strong);backdrop-filter:blur(26px); }
}
@media(max-width:380px) {
  [data-design="motion"] .clients-viewport .filter-bar { grid-template-columns:1fr; }
  [data-design="motion"] .client-table tr { grid-template-columns:1fr; }
  [data-design="motion"] .client-table td[data-label="Клиент"] { grid-column:1; }
}
@media(max-height:820px) and (min-width:761px) {
  :root[data-design="motion"] { --motion-header:82px; }
  [data-design="motion"] .sidebar-nav { gap:6px; }
}
@supports not (backdrop-filter:blur(1px)) {
  :root[data-design="motion"] { --motion-glass:var(--surface);--motion-glass-strong:var(--surface-raised); }
}
@media(prefers-reduced-transparency:reduce) {
  :root[data-design="motion"] { --motion-glass:var(--surface);--motion-glass-strong:var(--surface-raised); }
}
@media(prefers-reduced-motion:reduce) {
  .motion-background::before,.motion-background::after { transition:none; }
}
[data-reduced-motion="true"] .motion-background::before,[data-reduced-motion="true"] .motion-background::after { transition:none; }

/* Compact header controls and account disclosure. */
[data-design="motion"] .topbar .top-icon,[data-design="motion"] .topbar .top-user { border:0!important;box-shadow:none!important;background:transparent!important; }
[data-design="motion"] .topbar .top-user .avatar { border:0!important;box-shadow:none!important; }
[data-design="motion"] .topbar .global-search { display:flex;flex:0 0 auto;width:40px;min-width:40px;max-width:420px;height:40px;margin-left:auto;padding:0;gap:0;border:1px solid transparent;background:transparent;overflow:hidden;transition:width 320ms cubic-bezier(.2,.82,.2,1),background 180ms ease,border-color 180ms ease; }
[data-design="motion"] .topbar .global-search.is-open { width:min(420px,38vw);background:var(--motion-glass-strong);border-color:var(--motion-glass-border); }
.motion-search-toggle,.motion-search-close { display:grid;place-items:center;width:38px;height:38px;padding:0;flex:0 0 38px;border:0;background:transparent;color:var(--text);cursor:pointer; }
.motion-search-toggle .icon-svg { width:20px;height:20px; }
.motion-search-close { font-size:22px; }
[data-design="motion"] .topbar .global-search input[name="q"] { flex:1;min-width:0;width:0;padding:0;opacity:0;visibility:hidden;pointer-events:none;transform:translateX(8px);transition:opacity 180ms ease,transform 220ms ease; }
[data-design="motion"] .topbar .global-search.is-open input[name="q"] { width:100%;opacity:1;visibility:visible;pointer-events:auto;transform:none; }
.global-search:not(.is-open) .motion-search-close { visibility:hidden; }
.motion-profile { position:relative; }
.motion-profile-menu { position:absolute;right:0;top:calc(100% + 12px);z-index:100;width:260px;max-width:calc(100vw - 24px);padding:6px;border:1px solid var(--motion-glass-border);border-radius:18px;background:var(--motion-glass-strong);backdrop-filter:blur(26px);box-shadow:var(--shadow-md);animation:motion-profile-enter 180ms ease; }
.motion-profile-identity { display:flex;flex-direction:column;gap:3px;padding:12px 12px 14px;margin-bottom:4px;border-bottom:1px solid var(--border-subtle); }
.motion-profile-identity strong { font-size:14px;overflow-wrap:anywhere; }
.motion-profile-identity small { color:var(--muted);font-size:12px;overflow-wrap:anywhere; }
.motion-profile-menu>a,.motion-profile-menu>form>button { display:flex;width:100%;min-height:40px;align-items:center;padding:9px 12px;border:0;border-radius:10px;background:transparent;color:var(--text);text-align:left;font-size:13px; }
.motion-profile-menu>a:hover,.motion-profile-menu>form>button:hover { background:var(--active); }
.motion-profile-menu>form { margin:4px 0 0;padding-top:4px;border-top:1px solid var(--border-subtle); }
.motion-profile-menu>form>button { color:var(--danger); }
@keyframes motion-profile-enter { from {opacity:0;transform:translateY(-6px)} to {opacity:1;transform:none} }
@media(max-width:760px) {
  [data-design="motion"] .topbar .global-search.is-open { width:min(320px,calc(100vw - 204px)); }
  [data-design="motion"] .topbar .global-search.is-open input[name="q"] { font-size:12px; }
  [data-design="motion"] .topbar:has(.global-search.is-open) .theme-switch { display:none; }
  [data-design="motion"] .topbar:has(.global-search.is-open) .global-search { width:calc(100vw - 160px); }
}
@media(prefers-reduced-motion:reduce) { [data-design="motion"] .nav-link,[data-design="motion"] .global-search,[data-design="motion"] .global-search input[name="q"] { transition:none; } [data-design="motion"] .sidebar .nav-link { transform:none!important; } .motion-profile-menu { animation:none; } }
[data-reduced-motion="true"] .sidebar .nav-link { transform:none!important;transition:none; }
[data-reduced-motion="true"] .global-search,[data-reduced-motion="true"] .global-search input[name="q"] { transition:none; }
[data-reduced-motion="true"] .motion-profile-menu { animation:none; }

/* Indicate the actual clickable record without moving the surrounding glass. */
[data-design="motion"] :is(.task-rows,.today-list,.recent-client-rows,.attention-compact)>a {
  border-radius:12px;outline:1px solid transparent;outline-offset:2px;
  transition:background-color 150ms ease,outline-color 150ms ease;
}
[data-design="motion"] :is(.task-rows,.today-list,.recent-client-rows,.attention-compact)>a:is(:hover,:focus-visible) {
  background:color-mix(in srgb,var(--text) 6%,transparent);
  outline-color:color-mix(in srgb,var(--text) 24%,transparent);
}
[data-design="motion"] .client-block:is(:hover,:focus-within),
[data-design="motion"] .client-row:is(:hover,:focus-within),
[data-design="motion"] .motion-team-card:is(:hover,:focus-visible) {
  outline:1px solid color-mix(in srgb,var(--text) 24%,transparent);outline-offset:-1px;
}

@media(min-width:761px) {
  [data-design="motion"] .sidebar-nav {
    position:absolute;top:50%;left:0;width:100%;transform:translateY(-50%);
    flex:none;max-height:calc(100dvh - 132px);padding:12px;overflow:auto;
  }
  [data-design="motion"] .nav-group { flex-shrink:0; }
  [data-design="motion"][data-theme="dark"] .nav-link { color:#f2f8ff;filter:drop-shadow(0 0 4px #bedcff35); }
  [data-design="motion"][data-theme="light"] .nav-link { color:#24466e; }
}
[data-design="motion"] :is(.task-rows,.today-list,.recent-client-rows,.attention-compact)>a {
  border:0;box-shadow:none;outline-offset:-1px;padding-inline:10px;
}
[data-design="motion"] :is(.task-rows,.today-list,.recent-client-rows,.attention-compact)>a:is(:hover,:focus-visible) { box-shadow:none;border:0; }
[data-design="motion"] :is(.motion-search-toggle,.notification-control,.top-user) { transition:transform 160ms ease,background-color 160ms ease,box-shadow 160ms ease; }
[data-design="motion"] .topbar :is(.motion-search-toggle,.notification-control,.top-user):is(:hover,:focus-visible) {
  transform:scale(1.12);background:color-mix(in srgb,var(--text) 9%,transparent);box-shadow:0 0 18px #a4ceff35;border:0;
}
.crm-select-chevron,.crm-select-check { display:grid;place-items:center;flex-shrink:0; }
.crm-select-chevron svg,.crm-select-check svg { display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
[data-design="motion"] [data-client-modal] .icon-btn[data-client-modal-close] { display:grid;place-items:center;width:36px;height:36px;padding:0;flex:0 0 36px;border:0;border-radius:10px;background:transparent; }
[data-design="motion"] [data-client-modal] .icon-btn[data-client-modal-close]:hover { background:var(--active); }
[data-design="motion"] [data-client-modal] .client-api-later input[type="checkbox"]::before { top:3px;left:3px;box-shadow:none; }
[data-design="motion"] [data-client-modal]>.crm-select-popover-portal { z-index:2500!important; }
@media(prefers-reduced-motion:reduce) { [data-design="motion"] .topbar :is(.motion-search-toggle,.notification-control,.top-user) { transition:none;transform:none!important; } }
[data-reduced-motion="true"] .topbar :is(.motion-search-toggle,.notification-control,.top-user) { transition:none;transform:none!important; }

/* Keep legal links at the document bottom, including short pages. */
[data-design="motion"] .main,
[data-design="motion"] .main:has(.clients-viewport) { display:flex;flex-direction:column;min-height:100dvh; }
[data-design="motion"] .main>.topbar { flex-shrink:0; }
[data-design="motion"] .main>.content { flex:1 0 auto; }
[data-design="motion"] .main>.legal-footer { flex-shrink:0;margin-top:auto; }
@media(min-width:761px) {
  [data-design="motion"] .sidebar .nav-icon .icon-svg { width:28px;height:28px; }
  [data-design="motion"] body.sidebar-collapsed .nav-link { min-height:44px; }
}
