  :root {
    /* Тёмная тема (по умолчанию) */
    --bg: #14161a;
    --panel: #1c1f26;
    --panel-2: #222630;
    --line: #2c313c;
    --line-soft: #262b34;
    --ink: #e8eaed;
    --ink-dim: #9aa1ad;
    --ink-faint: #6b7280;
    --accent: #2a82e8;          /* #0065D0, осветлён для тёмного фона */
    --accent-ink: #ffffff;      /* текст на акцентной кнопке */
    --accent-soft: #16263a;
    --green: #4fa87a;
    --green-soft: #1e2f27;
    --red: #c8625a;
    --red-soft: #2f1f1d;
    --blue: #5b8bb5;
    --blue-soft: #1c2733;
    --amber: #d9a441;
    --amber-soft: #322814;
    --brand-grad: linear-gradient(135deg, #2a82e8, #0065d0);
    --radius: 10px;
    --mono: 'Tilda Sans', 'Inter', -apple-system, system-ui, sans-serif;
    --sans: 'Tilda Sans', 'Inter', -apple-system, system-ui, sans-serif;
  }
  [data-theme="light"] {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --panel-2: #eef1f6;
    --line: #dde2ea;
    --line-soft: #e8ecf2;
    --ink: #1a1f2b;
    --ink-dim: #5a6473;
    --ink-faint: #97a0ae;
    --accent: #0065d0;          /* фирменный */
    --accent-ink: #ffffff;
    --accent-soft: #e3eefb;
    --green: #1f9d63;
    --green-soft: #e2f4ea;
    --red: #d24b42;
    --red-soft: #fbe7e5;
    --blue: #3a7bbf;
    --blue-soft: #e6effa;
    --amber: #b07d10;
    --amber-soft: #fbf0d8;
    --brand-grad: linear-gradient(135deg, #2a82e8, #0065d0);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  .app { display: flex; min-height: 100vh; }

  /* Sidebar */
  .sidebar {
    width: 220px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 22px;
  }
  .brand .brand-logo { height: 30px; width: auto; display: block; }
  .brand .brand-logo-light { display: none; }            /* тёмный логотип — для светлой темы */
  [data-theme="light"] .brand .brand-logo-dark { display: none; }
  [data-theme="light"] .brand .brand-logo-light { display: block; }
  .nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: 8px;
    color: var(--ink-dim); cursor: pointer; font-weight: 500;
    transition: background .12s, color .12s;
    user-select: none;
  }
  .nav-item:hover { background: var(--panel-2); color: var(--ink); }
  .nav-item.active { background: var(--accent-soft); color: var(--accent); }
  .nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
  .nav-spacer { flex: 1; }
  .theme-toggle {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px; border-radius: 8px; cursor: pointer; user-select: none;
    color: var(--ink-dim); font-weight: 500; font-size: 13px;
    transition: background .12s, color .12s;
  }
  .theme-toggle:hover { background: var(--panel-2); color: var(--ink); }
  .theme-toggle svg { width: 16px; height: 16px; }
  .theme-toggle .ico-moon { display: none; }
  [data-theme="light"] .theme-toggle .ico-moon { display: inline-flex; }
  [data-theme="light"] .theme-toggle .ico-sun { display: none; }
  .theme-toggle .tt-label { flex: 1; }
  .theme-toggle .tt-track {
    width: 34px; height: 19px; border-radius: 20px; background: var(--line);
    position: relative; transition: background .15s; flex-shrink: 0;
  }
  .theme-toggle .tt-knob {
    position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
    background: var(--ink-dim); transition: transform .15s, background .15s;
  }
  [data-theme="light"] .theme-toggle .tt-track { background: var(--accent); }
  [data-theme="light"] .theme-toggle .tt-knob { transform: translateX(15px); background: #fff; }
  .nav-foot { font-size: 11px; color: var(--ink-faint); padding: 8px 0 0; line-height: 1.4; text-align: left; }
  .user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 11px; border-radius: 8px; cursor: pointer; user-select: none;
    border: 1px solid var(--line-soft); margin-top: 4px;
    transition: background .12s, border-color .12s;
  }
  .user-card:hover { background: var(--panel-2); border-color: var(--line); }
  .user-av {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 650; font-size: 13px;
    background: var(--brand-grad); color: #fff; overflow: hidden; background-size: cover; background-position: center;
  }
  .user-meta { display: flex; flex-direction: column; min-width: 0; }
  .user-hi { font-size: 11px; color: var(--ink-faint); }
  .user-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Main */
  .main { flex: 1; min-width: 0; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 30px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: var(--bg);
    backdrop-filter: blur(8px); z-index: 5;
  }
  .topbar h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
  .topbar .crumb { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
  .topbar-av {
    display: none; width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    place-items: center; font-weight: 650; font-size: 13px; font-family: var(--sans);
    background: var(--brand-grad); color: #fff; border: none; cursor: pointer;
    overflow: hidden; background-size: cover; background-position: center;
  }
  .content { padding: 26px 30px 60px; max-width: 1180px; }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--panel-2); color: var(--ink); font-family: var(--sans);
    font-size: 13px; font-weight: 550; cursor: pointer; transition: all .12s;
  }
  .btn:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); background: color-mix(in srgb, var(--panel-2) 90%, var(--ink)); }
  .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .btn.primary:hover { background: #0072e6; }
  .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-dim); }
  .btn.ghost:hover { color: var(--ink); background: var(--panel-2); }
  .btn svg { width: 15px; height: 15px; }
  .btn.sm { padding: 0 12px; height: 36px; font-size: 12px; }

  /* Cards / KPIs */
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
  .kpi {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px;
  }
  .kpi .label { font-size: 12px; color: var(--ink-dim); display: flex; align-items: center; gap: 7px; }
  .kpi .label .dot { width: 7px; height: 7px; border-radius: 50%; }
  .kpi .value { font-size: 25px; font-weight: 680; margin-top: 9px; letter-spacing: -0.02em; font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .kpi .meta { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }
  .kpi .meta.up { color: var(--green); }
  .kpi .meta.warn { color: var(--accent); }

  .section-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
  .section-head h2 { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
  .section-head .hint { font-size: 12px; color: var(--ink-faint); }

  /* Two-col dashboard */
  .dash-row { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
  .panel-box {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px;
  }
  .panel-box h3 { font-size: 13px; font-weight: 600; color: var(--ink-dim); margin-bottom: 16px; text-transform: uppercase; letter-spacing: .04em; }

  /* Bar chart */
  .chart { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
  .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
  .bar-stack { width: 100%; max-width: 38px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
  .bar {
    width: 100%; border-radius: 3px 3px 0 0; transition: opacity .15s; cursor: default;
    min-height: 2px;
  }
  .bar.paid { background: var(--green); }
  .bar.due { background: var(--accent); opacity: .85; }
  .bar-col:hover .bar { opacity: 1; }
  .bar-label { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }
  .legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--ink-dim); }
  .legend span { display: flex; align-items: center; gap: 6px; }
  .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

  /* Client income list */
  .client-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
  .client-row:last-child { border-bottom: none; }
  .client-av { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 650; font-size: 12px; flex-shrink: 0; font-family: var(--mono); }
  .client-row .nm { flex: 1; font-weight: 520; }
  .client-row .amt { font-family: var(--mono); font-weight: 600; }
  .client-bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
  .client-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

  /* Table */
  .table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .filters { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .flt-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .flt-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .search {
    flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; height: 36px;
  }
  .search input { background: none; border: none; color: var(--ink); font-family: var(--sans); font-size: 13px; width: 100%; outline: none; }
  .search svg { width: 15px; height: 15px; color: var(--ink-faint); }
  .tk-searchbar { margin-bottom: 14px; }
  select.flt {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink-dim); padding: 0 10px; height: 36px; font-family: var(--sans); font-size: 13px; cursor: pointer; outline: none;
  }
  table { width: 100%; border-collapse: collapse; }
  thead th {
    text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px;
    border-bottom: 1px solid var(--line); background: var(--panel-2);
  }
  thead th.num, td.num { text-align: right; }
  tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr { transition: background .1s; }
  tbody tr:hover { background: var(--panel-2); }
  #d-rows tr[data-id], #tk-rows tr[data-id] { cursor: pointer; }
  .t-title { font-weight: 540; }
  .t-date { font-size: 11px; color: var(--ink-faint); margin-bottom: 2px; font-variant-numeric: tabular-nums; display: none; }
  .t-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
  .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .amt-cell { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

  /* Таблица «Все задачи» в Сводке: всё в одну строку, лишнее — троеточием */
  .sw-table { table-layout: fixed; }
  .sw-table thead th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sw-table .cbcol { width: 44px; }
  .sw-table .c-task { width: auto; }
  .sw-table .c-co { width: 23%; }
  .sw-table .col-date { width: 110px; white-space: nowrap; }
  .sw-table .c-pay { width: 170px; white-space: nowrap; }
  .sw-table .c-sum { width: 130px; white-space: nowrap; }
  /* обрезка длинного текста в одну строку (название и компания) */
  .sw-table .c-task .t-title {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sw-table .c-task .t-sub {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sw-table .c-co .company-tag {
    max-width: 100%; overflow: hidden;
  }
  .sw-table .c-co .company-tag { white-space: nowrap; }
  .sw-table .c-co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sw-table .c-date { color: var(--ink-dim); }

  /* Таблица «Задачи»: десктоп */
  .tk-table { width: 100%; border-collapse: collapse; }
  .btn.full-w { width: 100%; justify-content: center; }
  .tk-break { display: none; }
  @media (min-width: 861px) {
    .tk-table .tk-co { width: 22%; }
    .tk-table .tk-date1, .tk-table .tk-date2 { width: 120px; white-space: nowrap; }
    .tk-table .tk-status { width: 150px; white-space: nowrap; }
    .tk-table .tk-sum { width: 130px; white-space: nowrap; }
  }

  /* Pills */
  .pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 540;
  }
  .pill .pdot { width: 6px; height: 6px; border-radius: 50%; }
  .pill.s-work { background: var(--accent-soft); color: var(--accent); }
  .pill.s-done { background: var(--green-soft); color: var(--green); }
  .pill.s-cancel { background: var(--line); color: var(--ink-dim); }  /* используется invStatusMeta.draft */
  .pill.p-unpaid { background: var(--blue-soft); color: var(--blue); }
  .pill.p-partial { background: var(--amber-soft); color: var(--amber); }
  .pill.p-paid { background: var(--green-soft); color: var(--green); }

  .company-tag { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
  .company-tag .av { flex-shrink: 0; }
  .sw-table .c-co .co-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .company-tag .av { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 650; font-family: var(--mono); }
  [data-theme="light"] .company-tag .av,
  [data-theme="light"] .client-av,
  [data-theme="light"] .co-card .av {
    background: color-mix(in srgb, currentColor 15%, #fff) !important;
  }

  /* Companies grid */
  .co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
  .co-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: border-color .12s; }
  .co-card:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
  .co-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .co-card .av { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-weight: 680; font-family: var(--mono); }
  .co-card .nm { font-weight: 600; font-size: 15px; }
  .co-card .person { font-size: 12px; color: var(--ink-faint); }
  .co-stats { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .co-stats .s .v { font-family: var(--mono); font-weight: 650; font-size: 16px; }
  .co-stats .s .l { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

  /* Invoice */
  .inv-sheet { background: #fbfaf7; color: #1a1a1a; border-radius: var(--radius); padding: 38px 42px; max-width: 720px; box-shadow: 0 8px 40px rgba(0,0,0,.4); }
  .inv-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 24px; border-bottom: 2px solid #1a1a1a; }
  .inv-head .ttl { font-size: 30px; font-weight: 720; letter-spacing: -0.02em; }
  .inv-head .num { font-family: var(--mono); color: #555; margin-top: 4px; }
  .inv-meta { text-align: right; font-size: 13px; color: #444; line-height: 1.7; }
  .inv-parties { display: flex; justify-content: space-between; margin: 26px 0; gap: 30px; }
  .inv-parties .blk h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #888; margin-bottom: 6px; }
  .inv-parties .blk p { font-size: 13px; line-height: 1.6; color: #222; }
  table.inv-tbl { width: 100%; margin: 10px 0; }
  table.inv-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #888; padding: 9px 0; border-bottom: 1px solid #ddd; }
  table.inv-tbl th.r, table.inv-tbl td.r { text-align: right; }
  table.inv-tbl td { padding: 11px 0; border-bottom: 1px solid #eee; font-size: 13px; color: #222; }
  table.inv-tbl td.r { font-family: var(--mono); }
  .inv-tot { margin-left: auto; width: 260px; margin-top: 16px; }
  .inv-tot .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #444; }
  .inv-tot .row.grand { border-top: 2px solid #1a1a1a; margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 700; color: #1a1a1a; }
  .inv-tot .row .mono { font-family: var(--mono); }

  .hidden { display: none !important; }
  .view { animation: fade .25s ease; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  .empty-note { color: var(--ink-faint); font-size: 13px; padding: 30px; text-align: center; }

  /* Checkboxes + bulk bar */
  .cb { width: 16px; height: 16px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; transition: all .12s; vertical-align: middle; }
  .cb:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
  .cb:checked { background: var(--accent); border-color: var(--accent); }
  .cb:checked::after { content: ''; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  th.cbcol, td.cbcol { width: 38px; padding-left: 16px; padding-right: 0; }
  tbody tr.sel { background: var(--accent-soft); }
  tbody tr.sel:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--ink)); }

  .bulkbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 11px 16px; border-bottom: 1px solid var(--line);
    background: var(--accent-soft);
  }
  .bulkbar .cnt { font-weight: 600; color: var(--accent); font-size: 13px; }
  .bulkbar .sep { width: 1px; height: 20px; background: var(--line); }
  .bulkbar .grp { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-dim); }
  .bulkbar select.flt { padding: 5px 9px; font-size: 12px; }
  .bulkbar .spacer { flex: 1; }
  .period-range { display: flex; align-items: center; gap: 6px; }
  .period-range input[type="date"] {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink-dim); padding: 0 9px; height: 36px; font-family: var(--sans); font-size: 13px; outline: none; cursor: pointer;
    color-scheme: dark;
  }
  [data-theme="light"] .period-range input[type="date"] { color-scheme: light; }
  .period-range span { color: var(--ink-faint); font-size: 12px; }
  .annot {
    background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--accent);
    border-radius: 8px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 18px;
    display: flex; gap: 9px; align-items: flex-start;
  }
  .annot svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

  /* Настройки */
  .settings-tabs {
    display: flex; gap: 4px; margin-bottom: 20px; max-width: 560px;
    background: var(--panel-2); padding: 4px; border-radius: 10px; border: 1px solid var(--line);
  }
  .stab {
    flex: 1; padding: 9px 14px; border-radius: 7px; border: none; cursor: pointer;
    background: transparent; color: var(--ink-dim);
    font-family: var(--sans); font-size: 13px; font-weight: 550; white-space: nowrap;
    transition: background .12s, color .12s;
  }
  .stab:hover { color: var(--ink); }
  .stab.active { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .stab-theme { display: none; }   /* «Оформление» — только в мобильной версии */
  .settings-panels { max-width: 560px; }
  .settings-panel { display: none; }
  .settings-panel.active { display: block; animation: fade .2s ease; }
  .panel-box .field + .field { margin-top: 14px; }
  .avatar-col { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .avatar-big {
    width: 84px; height: 84px; border-radius: 18px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 680; font-size: 28px;
    background: var(--brand-grad); color: #fff; overflow: hidden;
    background-size: cover; background-position: center;
  }
  .avatar-buttons { display: flex; gap: 8px; }
  .btn:disabled { opacity: .45; cursor: not-allowed; }
  .btn:disabled:hover { background: transparent; border-color: transparent; color: var(--ink-dim); }
  .settings-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 18px; }
  .save-note { font-size: 12px; flex-basis: 100%; }   /* надпись — на отдельной строке под кнопками */
  .save-note:empty { display: none; }
  .save-note.ok { color: var(--green); }
  .save-note.err { color: var(--red); }
  /* поле пароля с кнопкой показа */
  .pw-wrap { position: relative; }
  .pw-wrap input { width: 100%; padding-right: 40px; }
  .pw-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--ink-faint); cursor: pointer;
    padding: 6px; border-radius: 6px; display: grid; place-items: center;
  }
  .pw-eye:hover { color: var(--ink); background: var(--panel-2); }
  .pw-eye svg { width: 17px; height: 17px; }
  /* блок смены темы */
  .theme-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; padding: 4px 0; }
  .theme-row-label { font-size: 14px; font-weight: 540; }
  .theme-row .tt-track { width: 40px; height: 22px; border-radius: 20px; background: var(--line); position: relative; transition: background .15s; flex-shrink: 0; }
  .theme-row .tt-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-dim); transition: transform .15s, background .15s; }
  .theme-row.on .tt-track { background: var(--accent); }
  .theme-row.on .tt-knob { transform: translateX(18px); background: #fff; }

  /* Модальное окно */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 50; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  }
  .modal-overlay.open { display: flex; animation: fade .2s ease; }
  .modal {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
  }
  .modal.modal-wide { max-width: 820px; }
  .modal.modal-wide .modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; align-items: start; }
  .modal.modal-wide .co-col-full { grid-column: 1 / -1; }
  .modal.modal-wide .co-col:first-child { border-right: 1px solid var(--line-soft); padding-right: 26px; }
  .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
  .modal-head h3 { font-size: 16px; font-weight: 620; }
  .modal-x { background: none; border: none; color: var(--ink-faint); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
  .modal-x:hover { background: var(--panel-2); color: var(--ink); }
  .modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
  .field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
  .field label { font-size: 12px; color: var(--ink-dim); font-weight: 540; }
  .field input, .field select, .field textarea {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink); padding: 0 11px; height: 40px; font-family: var(--sans); font-size: 14px; outline: none;
    width: 100%; min-width: 0;
  }
  .field textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.4; }
  .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
  .field input[type="date"], .field input[type="time"] { color-scheme: dark; -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; }
  input[type="date"], input[type="time"] { text-align: left; -webkit-appearance: none; appearance: none; }
  input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
  [data-theme="light"] .field input[type="date"], [data-theme="light"] .field input[type="time"] { color-scheme: light; }
  .field-row { display: flex; gap: 12px; }
  /* Интеграции */
  .settings-panel .panel-box + .panel-box { margin-top: 16px; }
  .int-hint { font-size: 12px; color: var(--ink-faint); margin: 6px 0 10px; line-height: 1.4; }
  .int-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 540; cursor: pointer; margin-bottom: 12px; }
  .int-label { display: block; font-size: 12px; color: var(--ink-dim); font-weight: 540; margin-top: 14px; margin-bottom: 6px; }
  .day-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
  .day-chip { width: 42px; padding: 7px 0; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink-dim); font-family: var(--sans); font-size: 13px; font-weight: 540; cursor: pointer; transition: all .12s; }
  .day-chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .day-chip:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
  .cost-line {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--accent-soft); border-radius: 8px;
  }
  .cost-line span:first-child { font-size: 13px; color: var(--ink-dim); }
  .cost-val { font-size: 18px; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
  .modal-foot { display: flex; gap: 10px; padding: 14px 20px 20px; }
  .modal-foot .btn { height: 44px; width: 100%; justify-content: center; }

  /* Инфо о задаче */
  .info-title { font-size: 18px; font-weight: 650; line-height: 1.3; margin-bottom: 14px; }
  .info-grid { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border-radius: 10px; overflow: hidden; border: 1px solid var(--line-soft); }
  .info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: var(--panel); }
  .info-row .k { font-size: 13px; color: var(--ink-dim); flex-shrink: 0; }
  .info-row .v { font-size: 13px; font-weight: 540; text-align: right; }
  .info-row .v.sum { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .info-comment { margin-top: 14px; }
  .info-comment .k { font-size: 12px; color: var(--ink-dim); margin-bottom: 6px; }
  .info-comment .text { font-size: 13px; line-height: 1.5; color: var(--ink); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; }
  .info-comment .text.empty { color: var(--ink-faint); font-style: italic; }
  .info-foot { flex-direction: column; }
  .info-foot .btn-danger { height: 44px; }
  .info-row .v { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
  .v-edit-btn {
    width: 24px; height: 24px; flex-shrink: 0; border: none; background: transparent;
    color: var(--ink-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .v-edit-btn:hover { color: var(--accent); }
  .v-edit-btn svg { width: 14px; height: 14px; }
  .info-row .v input[type="date"], .info-row .v input[type="number"] {
    background: var(--bg); border: 1px solid var(--accent); border-radius: 6px;
    color: var(--ink); padding: 4px 8px; font-family: var(--sans); font-size: 13px; width: 110px; text-align: right; outline: none;
  }
  .info-comment textarea {
    width: 100%; resize: vertical; min-height: 60px; background: var(--bg); border: 1px solid var(--line-soft);
    border-radius: 8px; padding: 10px 12px; color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.5; outline: none;
  }
  .info-comment textarea:focus { border-color: var(--accent); }
  .info-status-btn { cursor: pointer; }

  /* Создание счёта: список позиций */
  .iv-items { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border:1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
  .iv-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: var(--panel); cursor: pointer; }
  .iv-item:hover { background: var(--panel-2); }
  .iv-item .cb { flex: 0 0 18px; width: 18px; height: 18px; }
  .iv-item-name { flex: 1; font-size: 13px; }
  .iv-item-sum { font-size: 13px; font-weight: 600; color: var(--ink-dim); }
  /* Список счетов: ширины колонок */
  .inv-list .c-date { width: 110px; white-space: nowrap; }
  .inv-list .iv-date { width: 110px; white-space: nowrap; }
  .inv-list .iv-num { width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .inv-list .iv-co { width: 18%; }
  .inv-list .iv-status { width: 130px; white-space: nowrap; }
  .inv-list .iv-act { width: 200px; }
  .inv-list .inv-pdf { white-space: nowrap; }
  /* Планшет: номер счёта прячем, компания получает остаток места — дата/статус/сумма/действия гарантированно не сжимаются */
  @media (max-width: 1280px) and (min-width: 861px) {
    .inv-list .iv-num, .inv-list .th-num { display: none; }
    .inv-list .iv-date, .inv-list .th-date { width: 110px; }
    .inv-list .iv-status, .inv-list .th-status { width: 120px; }
    .inv-list .iv-sum { width: 120px; }
    .inv-list .iv-act { width: 200px; }
    .inv-list .iv-co { width: calc(100% - 550px); min-width: 32px; }
  }
  /* Кликабельная плашка статуса счёта */
  .pill-btn { background: none; border: none; padding: 0; margin: 0; cursor: pointer; font: inherit; line-height: 0; }
  .pill-btn .pill { line-height: normal; transition: filter .12s, box-shadow .12s; }
  .pill-btn:hover .pill { filter: brightness(1.08); box-shadow: 0 0 0 1px currentColor inset; }
  /* Блок действий счёта: PDF + редактировать + удалить */
  .inv-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
  .inv-actions .inv-pdf { flex-shrink: 0; }
  .inv-edit-del { display: flex; gap: 8px; }
  .inv-edit:hover { color: var(--accent); border-color: var(--accent); }
  .inv-del:hover { color: var(--red); border-color: var(--red); }
  /* Всплывающее меню выбора статуса */
  .status-menu {
    position: absolute; z-index: 60; background: var(--panel);
    border: 1px solid var(--line); border-radius: 10px; padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.32); display: flex; flex-direction: column; gap: 3px; min-width: 160px;
  }
  .status-menu button { display: flex; align-items: center; background: none; border: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
  .status-menu button:hover { background: var(--panel-2); }
  .status-menu button.cur { background: var(--accent-soft); }

  /* Создание компании: секции и динамические поля */
  .co-section-h { font-size: 12px; font-weight: 600; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .co-modal-body > .co-section-h:first-child { margin-top: 0; padding-top: 0; border-top: none; }
  .field-label-sep { display: block; font-size: 12px; color: var(--ink-dim); font-weight: 540; margin: 14px 0 8px; }
  .rate-list, .contact-list { display: flex; flex-direction: column; gap: 8px; }
  .rate-row, .contact-row { display: flex; gap: 8px; align-items: center; }
  .rate-row input, .contact-row input, .contact-row select {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink); padding: 0 11px; height: 40px; font-family: var(--sans); font-size: 14px; outline: none;
  }
  .rate-row .rate-unit { flex: 1; }
  .rate-row .rate-price { width: 130px; }
  .contact-row .ct-type { width: 130px; flex-shrink: 0; }
  .contact-row .ct-fixed { width: 130px; flex-shrink: 0; height: 40px; display: flex; align-items: center; padding: 0 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-dim); font-size: 13px; }
  .contact-row .ct-label { width: 160px; flex-shrink: 0; }
  .contact-row .ct-value { flex: 1; }
  .rate-row input:focus, .contact-row input:focus, .contact-row select:focus { border-color: var(--accent); }
  .icon-btn { width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-faint); border-radius: 8px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
  .icon-btn svg { width: 15px; height: 15px; }
  .icon-btn:hover { color: var(--red); border-color: var(--red); }
  .add-line { margin-top: 10px; }

  /* Страница компании */
  .back-btn { margin-bottom: 18px; }
  .co-page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
  .co-page-head .av { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-weight: 680; font-size: 22px; font-family: var(--mono); flex-shrink: 0; }
  .co-page-name { font-size: 20px; font-weight: 680; letter-spacing: -0.01em; }
  .co-page-req { font-size: 13px; color: var(--ink-dim); margin-top: 4px; }
  .co-page-contact { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
  .co-tabs { max-width: 360px; margin-bottom: 18px; }
  .co-page-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
  .co-page-top .back-btn { margin-bottom: 0; }
  .btn-danger { color: var(--red); border-color: transparent; background: transparent; }
  .btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
  .arch-badge { display: inline-block; margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--ink-faint); background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; vertical-align: middle; }
  .co-switch { display: inline-flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 18px; }
  .co-sw { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: none; border-radius: 7px; background: transparent; color: var(--ink-dim); font-family: var(--sans); font-size: 13px; font-weight: 550; cursor: pointer; }
  .co-sw svg { width: 15px; height: 15px; }
  .co-sw.active { background: var(--panel); color: var(--accent); }
  .co-card.archived { opacity: .6; }
  .modal-foot .btn-danger { width: auto; }
  #co-modal-foot { justify-content: flex-end; }
  #co-modal-foot .btn { width: auto; }
  #co-modal-foot #co-archive, #co-modal-foot #co-delete { margin-right: 0; }
  #co-modal-foot #co-save { margin-left: auto; }

  /* Мобильная строка «Выбрать все» — скрыта на десктопе */
  .mobile-selectall { display: none; }

  /* Мобильные вкладки и CTA — скрыты на десктопе */
  .mtabs { display: none; }
  .mobile-cta { display: none; }
  .flt-toggle { display: none; }

  @media (max-width: 860px) {
    .sidebar { display: none; }
    .content { padding: 18px 16px 100px; }
    .topbar { padding: 16px; position: static; }   /* шапку не закрепляем */
    .topbar #top-actions { display: none; }   /* кнопка уезжает вниз, в фикс. CTA */
    .topbar-av { display: grid; }   /* аватар-переход в настройки в шапке */

    /* Широкая модалка (компания) — в один столбец, вертикальный скролл */
    .modal.modal-wide { max-width: 460px; }
    .modal.modal-wide .modal-body { grid-template-columns: 1fr; gap: 14px; }
    .modal.modal-wide .co-col:first-child { border-right: none; padding-right: 0; }

    /* Вкладки-меню после шапки — закреплены сверху */
    .mtabs {
      display: flex; gap: 4px; padding: 8px 12px;
      border-bottom: 1px solid var(--line); background: var(--panel);
      position: sticky; top: 0; z-index: 6; overflow-x: auto;
    }
    .mtab {
      flex: 1 0 auto; white-space: nowrap;
      padding: 9px 14px; border-radius: 8px; border: none;
      background: transparent; color: var(--ink-dim);
      font-family: var(--sans); font-size: 13px; font-weight: 550; cursor: pointer;
    }
    .mtab.active { background: var(--accent-soft); color: var(--accent); }

    /* KPI 2×2 на мобильном */
    .kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .kpi .value { font-size: 20px; }
    .dash-row { grid-template-columns: 1fr; }

    /* Фильтры — в аккордеоне */
    .flt-toggle {
      display: flex; align-items: center; gap: 8px; width: 100%;
      padding: 13px 16px; border: none; border-bottom: 1px solid var(--line);
      background: var(--panel); color: var(--ink); font-family: var(--sans);
      font-size: 13px; font-weight: 550; cursor: pointer;
    }
    .flt-toggle svg { width: 15px; height: 15px; }
    .flt-toggle .chev { margin-left: auto; transition: transform .2s; }
    .flt-toggle.open .chev { transform: rotate(180deg); }
    .filters { flex-direction: column; align-items: stretch; display: none; }
    .filters.open { display: flex; }
    .flt-group { flex-direction: column; align-items: stretch; }
    .flt-group select.flt, .flt-group .btn { width: 100%; }

    /* Bulk-бар выбора задач: сетка 2×3, всё на всю ширину */
    .bulkbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
    .bulkbar .sep, .bulkbar .spacer { display: none; }
    .bulkbar .cnt { order: 1; display: flex; align-items: center; }
    .bulkbar #bulk-cancel { order: 2; }
    .bulkbar #bulk-pay { order: 3; }
    .bulkbar #bulk-apply { order: 4; }
    .bulkbar #d-excel { order: 5; }
    .bulkbar #d-toinvoice { order: 6; }
    .bulkbar .btn { width: 100%; justify-content: center; }
    .bulkbar select.flt { width: 100%; height: 36px; }
    .period-range { justify-content: space-between; }
    .period-range input[type="date"] { flex: 1; }

    /* iOS не зумит при фокусе, если шрифт контролов ≥16px */
    input, select, textarea { font-size: 16px !important; }

    /* Фиксированная кнопка снизу с белым градиентом */
    .mobile-cta {
      display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
      padding: 26px 16px 16px; pointer-events: none;
      background: linear-gradient(to top, var(--bg) 0%, var(--bg) 55%, transparent 100%);
    }
    .mobile-cta .btn { width: 100%; justify-content: center; height: 46px; font-size: 14px; pointer-events: auto; }

    /* Таблица задач Сводки → карточки: 2 контейнера (чекбокс | информация) */
    #d-rows, #ct-rows, #d-rows tbody, #ct-rows tbody { display: block; }
    #d-rows tr, #ct-rows tr {
      display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
      position: relative;
      padding: 16px 14px 16px 46px;   /* слева место под чекбокс */
      border-bottom: 1px solid var(--line-soft);
    }
    #d-rows tr.sel, #ct-rows tr.sel { background: var(--accent-soft); }
    #d-rows td, #ct-rows td { padding: 0; border: none; text-align: left; }

    /* контейнер 1: чекбокс — закреплён слева */
    #d-rows .cbcol, #ct-rows .cbcol { position: absolute; left: 14px; top: 18px; width: 20px; padding: 0; }
    #d-rows .cbcol .cb, #ct-rows .cbcol .cb { margin: 0; }

    /* контейнер 2: информация, всё слева на одной вертикали */
    #d-rows .c-task, #ct-rows .c-task { order: 1; flex: 0 0 100%; text-align: left; }
    #d-rows .c-task .t-title, #ct-rows .c-task .t-title {
      font-size: 16px; font-weight: 650; line-height: 1.25; text-align: left;
      white-space: normal; overflow-wrap: anywhere;
      display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    #d-rows .c-task .t-date, #ct-rows .c-task .t-date { display: none; }
    #d-rows .t-sub, #ct-rows .t-sub { display: none; }

    #d-rows .c-pay, #ct-rows .c-pay { order: 2; flex: 0 0 100%; }
    #d-rows .c-pay .pill, #ct-rows .c-pay .pill { font-size: 13px; padding: 5px 12px; }
    .info-row .v .pill { font-size: 13px; padding: 5px 12px; }

    /* нижняя строка: сумма + компания + дата рядом, слева */
    #d-rows .c-sum, #ct-rows .c-sum {
      order: 3; flex: 0 0 auto; text-align: left;
      font-size: 17px; font-weight: 700; white-space: nowrap;
    }
    #d-rows .c-co, #ct-rows .c-co {
      order: 4; flex: 1 1 auto; min-width: 0;
      display: flex; align-items: center; gap: 8px;
      color: var(--ink-dim); font-size: 13px; text-align: left;
    }
    #d-rows .c-co .company-tag, #ct-rows .c-co .company-tag { gap: 7px; flex-shrink: 1; min-width: 0; overflow: hidden; }
    #d-rows .c-co .av, #ct-rows .c-co .av { flex-shrink: 0; }
    #d-rows .c-co .co-name, #ct-rows .c-co .co-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #d-rows .c-co .t-date, #ct-rows .c-co .t-date {
      display: inline; font-size: 13px; color: var(--ink-faint);
      margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; margin-left: auto;
    }
    #d-rows .c-date, #ct-rows .c-date { display: none; }   /* отдельная колонка даты — только десктоп */
    .sw-thead { display: none; }   /* шапка таблицы Сводки на мобильном скрыта */
    .stab-theme { display: block; }   /* вкладка «Оформление» только на мобильном */
    .settings-tabs { max-width: 100%; overflow-x: auto; }
    .stab { flex: 0 0 auto; }
    .mobile-selectall {
      display: flex; align-items: center; gap: 10px;
      padding: 12px 14px; border-bottom: 1px solid var(--line);
      font-size: 13px; font-weight: 540; color: var(--ink-dim); cursor: pointer;
      user-select: none;
    }

    /* Список счетов → карточки */
    .inv-list, .inv-list tbody, .inv-list tr, .inv-list td { display: block; }
    .inv-list thead, .inv-list .sw-thead { display: none; }
    .inv-list tr {
      display: flex; flex-wrap: wrap; align-items: center;
      gap: 6px 10px; padding: 16px 14px;
      border-bottom: 1px solid var(--line-soft);
    }
    .inv-list tr:hover { background: transparent; }
    .inv-list td { padding: 0; border: none; text-align: left; }
    /* строка 1: дата · номер */
    .inv-list .iv-date { order: 1; width: auto; font-size: 13px; color: var(--ink-faint); }
    .inv-list .iv-num  { order: 2; width: auto; font-size: 13px; color: var(--ink-faint); }
    .inv-list .iv-num::before { content: "·"; margin-right: 8px; }
    /* строка 2: сумма */
    .inv-list .iv-sum  { order: 3; flex: 0 0 100%; width: auto; font-size: 22px; font-weight: 700; }
    /* строка 3: статус · компания */
    .inv-list .iv-status { order: 4; flex: 0 0 auto; width: auto; }
    .inv-list .iv-status .pill { font-size: 13px; padding: 5px 12px; }
    .inv-list .iv-co   { order: 5; flex: 0 1 auto; min-width: 0; width: auto; display: flex; align-items: center; gap: 7px; }
    .inv-list .iv-co::before { content: "·"; margin-right: 3px; color: var(--ink-faint); }
    .inv-list .iv-co .company-tag { min-width: 0; overflow: hidden; }
    .inv-list .iv-co .co-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* строка 4: три кнопки в ряд на всю ширину, равной ширины */
    .inv-list .iv-act { order: 6; flex: 0 0 100%; width: auto; margin-top: 4px; }
    .inv-list .iv-act .inv-actions { display: flex; flex-direction: row; gap: 8px; }
    .inv-list .iv-act .inv-pdf { flex: 1; width: auto; height: 38px; padding: 0; justify-content: center; }
    .inv-list .iv-act .inv-edit-del { flex: 2; display: flex; gap: 8px; }
    .inv-list .iv-act .inv-edit-del .icon-btn { flex: 1; width: auto; height: 38px; }

    /* Список задач → карточки */
    .tk-table, .tk-table tbody, #tk-rows tr { display: block; }
    .tk-thead { display: none; }
    #tk-rows tr {
      display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
      padding: 16px 14px; border-bottom: 1px solid var(--line-soft);
    }
    #tk-rows tr:hover { background: transparent; }
    #tk-rows td { padding: 0; border: none; text-align: left; }
    .tk-title { order: 1; flex: 0 0 100%; }
    .tk-title .t-title {
      font-size: 16px; font-weight: 650; line-height: 1.25;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .tk-sum { order: 2; flex: 0 0 auto; font-size: 20px; font-weight: 700; }
    .tk-status { order: 3; flex: 0 0 auto; margin-left: auto; }
    .tk-status .pill { font-size: 13px; padding: 5px 12px; }
    /* жёсткий разрыв строки: гарантирует, что компания и даты не смешаются со строкой суммы/статуса */
    .tk-break { order: 4; flex: 1 1 100%; height: 0; padding: 0; margin: 0; display: block; }
    .tk-co {
      order: 5; flex: 1 1 0; min-width: 0;
      display: flex; align-items: center; gap: 7px;
      color: var(--ink-dim); font-size: 13px;
    }
    .tk-co .company-tag { min-width: 0; overflow: hidden; }
    .tk-co .co-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tk-date1 {
      order: 6; flex: 0 0 auto;
      font-size: 13px; color: var(--ink-faint); white-space: nowrap;
    }
    .tk-date2 {
      order: 7; flex: 0 0 auto;
      font-size: 13px; color: var(--ink-faint); white-space: nowrap;
    }
    .tk-date2::before { content: " / "; }
  }
