/* =====================================================================
   AUTOPINCODE — тема интерфейса
   ===================================================================== */
   :root {
    --bg: #EDF0EB;
    --surface: #FAFBF8;
    --surface-2: #F2F4EF;
    --side: #0E0F12;
    --side-ink: #A9AFBA;
    --ink: #181B20;
    --ink-2: #454D59;
    --ink-3: #5E6874;
    --ink-inv: #FFFFFF;
    --line: #DCE1D6;
    --line-strong: #C5CBBE;
    --accent: #C6F432;
    --accent-h: #B6E02B;
    --accent-soft: rgba(198, 244, 50, 0.22);
    --accent-deep: #5A7A0A;
    --danger: #C42B2B;
    --danger-soft: #FBE4E1;
    --on-danger: #FFFFFF;
    --ok: #15803D;
    --ok-soft: #DDF3E4;
    --warn: #A15C07;
    --warn-bg: #FBEED0;
    --accent-btn: var(--accent);
    --accent-btn-h: var(--accent-h);
    --pop: var(--surface);
    --brand-solid: #181B20;
    --row-hover: #F1F4EC;
    --shadow-card: 0 1px 2px rgba(24, 27, 32, .04), 0 8px 20px -12px rgba(24, 27, 32, .14);
    --shadow-pop: 0 16px 40px -12px rgba(24, 27, 32, .22);
    --overlay: rgba(14, 15, 18, .5);
    --radius: 12px;
    --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  }
  
  [data-theme="dark"] {
    --bg: #0F1115;
    --surface: #1B1F26;
    --surface-2: #242932;
    --pop: #2B313A;
    --side: #0A0B0E;
    --side-ink: #AEB5C0;
    --ink: #DDE1E6;
    --ink-2: #B0B7C2;
    --ink-3: #8F98A5;
    --ink-inv: #0F1115;
    --line: #2E343E;
    --line-strong: #626D7D;
    --accent-soft: rgba(198, 244, 50, 0.14);
    --accent-deep: #C6F432;
    --accent-btn: #B4D930;
    --accent-btn-h: #A5C92A;
    --danger: #F58B8B;
    --danger-soft: rgba(245, 139, 139, .15);
    --on-danger: #1A0B0B;
    --ok: #4CC47A;
    --ok-soft: rgba(76, 196, 122, .15);
    --warn: #F2B968;
    --warn-bg: rgba(242, 185, 104, .15);
    --brand-solid: #323945;
    --row-hover: #222730;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -14px rgba(0, 0, 0, .7);
    --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, .75);
    --overlay: rgba(4, 5, 7, .66);
  }
  
  html { color-scheme: light; accent-color: var(--ink); }
  html[data-theme="dark"] { color-scheme: dark; accent-color: var(--accent); scrollbar-color: #3A414D transparent; }
  
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg); color: var(--ink); font-family: var(--font);
    font-size: 1rem; line-height: 1.5;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    margin: 0; overflow-x: hidden;
    transition: padding-bottom 0.3s ease;
  }
  
  /* Отступ для body, когда открыт куки-баннер, чтобы он не перекрывал футер */
  body.has-cookie-banner {
    padding-bottom: 80px;
  }
  @media (max-width: 768px) {
    body.has-cookie-banner {
      padding-bottom: 140px;
    }
  }
  
  ::selection { background: var(--accent); color: #0E0F12; }
  :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
  }
  .field {
    width: 100%; padding: .65rem .85rem; font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
    transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
  }
  [data-theme="dark"] .field { background: var(--surface-2); }
  .field::placeholder { color: var(--ink-3); }
  .field:hover { border-color: var(--ink-3); }
  .field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
  .field-sm { width: auto; padding: .4rem .6rem; font-size: .8125rem; }
  .label { display: block; margin-bottom: .35rem; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
  
  input[type="file"] { color: var(--ink-3); font-size: .875rem; }
  input[type="file"]::file-selector-button {
    margin-right: .75rem; padding: .45rem .9rem; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
    transition: background-color .15s, border-color .15s;
  }
  input[type="file"]::file-selector-button:hover { background: var(--accent-soft); border-color: var(--ink-3); }
  
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .6rem 1.1rem; font: inherit; font-size: .875rem; font-weight: 700;
    border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .05s; box-sizing: border-box;
  }
  .btn:active:not(:disabled) { transform: translateY(1px); }
  .btn-primary { background: var(--accent-btn); color: #0E0F12; border-color: rgba(14, 15, 18, .10); }
  .btn-primary:hover { background: var(--accent-btn-h); border-color: rgba(14, 15, 18, .16); }
  .btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
  .btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
  .btn-danger { background: var(--danger); color: var(--on-danger); }
  .btn-danger:hover { filter: brightness(.92); }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8125rem; }
  
  .login-wrap { display: grid; width: 100%; flex: 1 0 auto; min-height: 0 !important; }
  @media (min-width: 900px) { .login-wrap { grid-template-columns: 1.1fr 1fr; } }
  
  /* Добавлена граница, чтобы разделить левую и правую панели */
  .login-brand {
    display: none; position: relative; overflow: hidden; padding: 3rem;
    background: var(--side); color: #F3F5F7; flex-direction: column; justify-content: space-between;
    border-right: 1px solid var(--line); 
  }
  @media (min-width: 900px) { .login-brand { display: flex; } }
  
  .brand { display: flex; align-items: center; gap: .6rem; color: #F3F5F7; }
  .brand-logo { display: block; height: 4rem; width: auto; }
  .login-brand { container-type: inline-size; }
  .login-brand .mark {
    align-self: flex-start; width: max-content; white-space: nowrap;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800; letter-spacing: -.04em; line-height: .9; position: relative; z-index: 1; color: var(--accent);
  }
  @supports (width: 1cqw) { .login-brand .mark { font-size: 13cqw; } }
  .login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
  
  #main-screen:not(.hidden) { display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; }
  #login-screen:not(.hidden) { display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; }
  
  .topbar { position: sticky; top: 0; z-index: 40; background: var(--side); border-bottom: 1px solid rgba(255, 255, 255, .06); }
  .topbar-inner { max-width: 95%; margin: 0 auto; padding: .75rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
  @media (min-width: 900px) { .topbar-inner { flex-wrap: nowrap; padding: 0 1.5rem; height: 64px; } }
  
  #nav-tabs-container { display: flex; flex-wrap: wrap; gap: .25rem; overflow-x: auto; scrollbar-width: none; order: 3; width: 100%; }
  @media (min-width: 900px) { #nav-tabs-container { order: 0; width: auto; flex: 1; } }
  #nav-tabs-container::-webkit-scrollbar { display: none; }
  #nav-tabs-container > * {
    white-space: nowrap; padding: .5rem .9rem; border: 0; border-radius: 8px;
    background: transparent; color: var(--side-ink); font: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s;
  }
  #nav-tabs-container > *:hover { background: rgba(255, 255, 255, .08); color: #F3F5F7; }
  #nav-tabs-container > .active, #nav-tabs-container > [aria-current="page"] { background: rgba(198, 244, 50, .14); color: var(--accent); }
  
  .topbar-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
  
  .balance-inline { display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .10); }
  .balance-inline .caption { font-size: .8125rem; color: var(--side-ink); }
  .balance-inline .amount { font-size: 1.05rem; font-weight: 700; color: #F3F5F7; font-variant-numeric: tabular-nums; }
  .balance-inline .btn { height: 28px; padding: 0 12px; font-size: 0.75rem; border-radius: 6px; margin-left: 4px; }
  
  .lang-menu { position: relative; }
  .topbar .lang-toggle { display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 .6rem; background: rgba(255, 255, 255, .08); color: var(--side-ink); cursor: pointer; border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; transition: background-color .15s; }
  .topbar .lang-toggle:hover { background: rgba(255, 255, 255, .16); }
  .login-panel .lang-toggle { display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 .6rem; background: var(--surface); color: var(--ink-2); cursor: pointer; border: 1px solid var(--line); border-radius: 8px; transition: background-color .15s; }
  .login-panel .lang-toggle:hover { background: var(--surface-2); }
  
  .flag { display: block; width: 24px; height: 16px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
  .flag svg { display: block; width: 100%; height: 100%; }
  .lang-flags { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px; padding: .35rem; background: var(--pop); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
  .lang-flags[hidden] { display: none; }
  .lang-flags button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .6rem; background: none; border: 0; border-radius: 7px; font: inherit; font-size: .875rem; color: inherit; text-align: left; cursor: pointer; }
  .lang-flags button:hover { background: var(--surface-2); }
  .lang-flags button.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
  
  .content { flex: 1 0 auto; max-width: 95%; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; width: 100%; }
  @media (min-width: 900px) { .content { padding: 2rem 1.5rem 3rem; } }
  
  .modal { display: none; position: fixed; z-index: 50; inset: 0; padding: 1rem; background: var(--overlay); backdrop-filter: blur(4px); }
  .modal.active { display: flex; align-items: center; justify-content: center; }
  .modal.active .modal-card { animation: modalIn .18s ease-out; }
  @keyframes modalIn { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
  .modal-card { width: 100%; background: var(--pop); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; box-shadow: var(--shadow-pop); }
  .modal-confirm { max-width: 400px; text-align: center; }
  .modal-rights { max-width: 600px; max-height: 80vh; overflow-y: auto; }
  .icon-badge { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 1rem; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
  .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
  .icon-btn { background: none; border: 0; color: var(--ink-3); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 6px; padding: 0 .35rem; }
  .icon-btn:hover { color: var(--ink); }
  
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
  .skeleton { background-color: var(--line); border-radius: 6px; animation: pulse 1.5s cubic-bezier(.4,0,.6,1) infinite; }
  @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
  .toast-animate { animation: slideInRight .3s ease-out forwards; }
  @media (prefers-reduced-motion: reduce) { .skeleton, .toast-animate, .modal.active .modal-card { animation: none; } * { transition: none !important; } }
  
  select.field, input.field:not(.field-sm) { height: 2.75rem; }
  .btn-xs { padding: .3rem .7rem; font-size: .75rem; border-radius: 6px; white-space: nowrap; }
  .btn-soft-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-soft); }
  .btn-soft-danger:hover { filter: brightness(.97); border-color: var(--danger); }
  
  .data-table { width: 100%; border-collapse: collapse; }
  .data-table th { padding: .7rem 1rem; text-align: left; white-space: nowrap; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .data-table td { padding: .85rem 1rem; font-size: .875rem; vertical-align: middle; }
  .data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  .data-table.no-actions .th-action, .data-table.no-actions .td-action { display: none; }
  #orders-list > tr { border-top: 1px solid var(--line); }
  #orders-list > tr:first-child { border-top: 0; }
  #orders-list > tr:hover { background: var(--row-hover); }
  .text-muted, .sub { color: var(--ink-3); }
  .sub { font-size: .8125rem; line-height: 1.35; }
  
  .dot { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .8125rem; font-weight: 600; }
  .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .st-ok { color: var(--ok); }
  .st-run { color: var(--ink); }
  .pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
  .pill-warn { background: var(--warn-bg); color: var(--warn); }
  .pill-bad { background: var(--danger-soft); color: var(--danger); }
  
  .code { display: inline-flex; align-items: center; gap: .4rem; font-family: ui-monospace, monospace; font-weight: 700; color: var(--ink); }
  .copy-btn { display: grid; place-items: center; padding: .2rem; border: 0; border-radius: 5px; background: none; color: var(--ink-3); cursor: pointer; }
  .copy-btn:hover { background: var(--surface-2); color: var(--ink); }
  
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
  .chips { display: flex; flex-wrap: wrap; gap: .4rem; }
  .chip { padding: .4rem .85rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: .8125rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
  .chip:hover { border-color: var(--ink-3); }
  .chip .n { margin-left: .3rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .chip.active { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); }
  .chip.active .n { color: inherit; opacity: .7; }
  .search { position: relative; display: block; width: 100%; max-width: 19rem; }
  .search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
  .search input { width: 100%; padding: .5rem .75rem .5rem 2.1rem; font-size: .875rem; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line-strong); }
  
  .account { position: relative; }
  .avatar { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; overflow: hidden; border: 2px solid rgba(255, 255, 255, .18); border-radius: 50%; background: var(--side); color: var(--accent); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer; transition: border-color .15s; }
  .avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--accent); }
  .account-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 15rem; padding: .4rem; background: var(--pop); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
  .account-menu[hidden] { display: none; }
  .account-head { padding: .7rem .7rem .8rem; margin-bottom: .35rem; border-bottom: 1px solid var(--line); }
  .account-head .name { font-size: .9375rem; font-weight: 700; color: var(--ink); }
  .account-head .role { font-size: .8125rem; color: var(--ink-3); }
  .lang-row { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; }
  .lang-row .globe { margin-right: .2rem; color: var(--ink-3); }
  .flag-btn { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; opacity: .55; cursor: pointer; transition: opacity .15s, border-color .15s; }
  .flag-btn .flag { width: 28px; height: 19px; }
  .flag-btn:hover { opacity: 1; }
  .flag-btn.active { opacity: 1; border-color: var(--ink); }
  .menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
  .menu-item:hover { background: var(--surface-2); }
  .menu-item.danger { color: var(--danger); }
  .menu-item.danger:hover { background: var(--danger-soft); }
  
  .order-layout { display: grid; gap: 1.5rem; }
  @media (min-width: 900px) { .order-layout { grid-template-columns: 22rem 1fr; } }
  .order-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; padding: 1.5rem; height: 100%; }
  .order-card h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
  .order-fields { display: flex; flex-direction: column; gap: 1.25rem; }
  .model-info { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; height: 100%; }
  .model-info-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .model-info-head h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
  .price-tag { padding: .35rem .85rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); border: 1px solid rgba(90, 122, 10, .25); font-weight: 800; font-size: .875rem; font-variant-numeric: tabular-nums; }
  .model-info-text { max-width: 60ch; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); margin: 0; }
  .model-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin-top: auto; padding: 0; }
  .model-facts > div { padding: 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
  .model-facts dt { font-size: .75rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
  .model-facts dd { margin-top: .25rem; font-size: 1.125rem; font-weight: 800; margin-left: 0; color: var(--ink); }
  
  @media (max-width: 900px) {
    .data-table .c-date, .data-table .c-site, .data-table .c-email { display: none; }
    .topbar-inner { padding: 0.5rem 1rem; height: auto; gap: 0.5rem; }
    .topbar-right { gap: 0.5rem; }
    #nav-tabs-container { order: 3; width: 100%; margin-top: 0.5rem; padding-bottom: 0.25rem; }
    .order-layout { grid-template-columns: 1fr; }
  
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tr { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
    .data-table td { padding: 0; border: none; text-align: left !important; }
  
    #orders-list > tr.row-ok { border-left: 4px solid var(--ok); }
    #orders-list > tr.row-bad { border-left: 4px solid var(--danger); }
    #orders-list > tr.row-wait { border-left: 4px solid var(--warn); }
    #orders-list > tr.row-run { border-left: 4px solid var(--ink); }
  
    .data-table .c-site, .data-table .c-email, .data-table .c-date { display: none !important; }
    .data-table .c-pay { display: block !important; margin: 0.5rem 0; }
    .data-table .c-id { font-size: 0.875rem; color: var(--ink-3); font-weight: 600; margin-bottom: 0.25rem; }
    .data-table .c-model { font-size: 1.25rem; font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; }
    .data-table .c-price { font-size: 1.125rem; font-weight: 700; margin: 0.5rem 0; }
    .data-table .td-action { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; }
    .data-table .td-action .btn { width: 100%; padding: 0.75rem; font-size: 1rem; }
  }
  
  .link { color: var(--accent-deep); font-weight: 700; text-decoration: none; text-underline-offset: 3px; }
  .link:hover { text-decoration: underline; }
  .link-muted { color: var(--ink-3); font-weight: 700; text-decoration: none; transition: color .15s; }
  .link-muted:hover { color: var(--ink); }
  
  .toast { display: flex; align-items: center; gap: .75rem; min-width: 300px; max-width: 380px; padding: .85rem 1.1rem; border-radius: 12px; border-left: 3px solid var(--accent); background: #0E0F12; color: #F3F5F7; box-shadow: var(--shadow-pop); font-size: .875rem; font-weight: 600; line-height: 1.4; }
  .toast svg { flex: none; width: 20px; height: 20px; }
  .toast-success svg { color: var(--accent); }
  .toast-error { border-left-color: #F37B7B; }
  .toast-error svg { color: #F37B7B; }
  
  .balance-inline { position: relative; }
  .balance-inline .hint { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: max-content; max-width: 16rem; padding: .45rem .7rem; border-radius: 8px; background: #262A31; color: #F3F5F7; font-size: .75rem; line-height: 1.35; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
  .balance-inline:hover .hint, .balance-inline:focus-within .hint, .balance-inline:focus .hint { opacity: 1; transform: none; }
  
  .m-only { display: none; }
  @media (max-width: 900px) { .m-only { display: inline; } }
  .took-info { font-size: .75rem; color: var(--ink-3); }
  .took-info b { margin-left: .3rem; font-weight: 600; color: var(--ink); }
  .cancel-reason-badge { display: inline-block; margin-top: .35rem; padding: .2rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 600; background: var(--danger-soft); color: var(--danger); }
  .order-timer { font-variant-numeric: tabular-nums; font-weight: 600; }
  @keyframes rowFlash { from { background: var(--accent-soft); } to { background: transparent; } }
  #orders-list > tr.row-new { animation: rowFlash 2.4s ease-out; }
  @media (prefers-reduced-motion: reduce) { #orders-list > tr.row-new { animation: none; } }
  
  .panel { padding: 1.5rem; }
  .panel-title { margin: 0 0 1.25rem; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
  .panel-sub { margin: .25rem 0 0; font-size: .875rem; color: var(--ink-3); }
  textarea.field { resize: vertical; min-height: 4.5rem; line-height: 1.45; }
  select.field-sm, input.field-sm { height: 2.25rem; }
  
  .kpi { padding: 1.25rem 1.5rem; }
  .kpi-accent { border-top: 3px solid var(--accent); }
  .kpi-label { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
  .kpi-value { margin-top: .35rem; font-size: 1.875rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .kpi-value.is-warn { color: var(--warn); }
  
  .tbl { width: 100%; min-width: 36rem; border-collapse: collapse; }
  .tbl th { padding: .7rem 1rem; text-align: left; white-space: nowrap; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .tbl td { padding: .85rem 1rem; font-size: .875rem; vertical-align: middle; }
  .tbl tbody tr { border-top: 1px solid var(--line); }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl tbody tr:hover { background: var(--row-hover); }
  .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
  
  .check { flex: none; width: 1.15rem; height: 1.15rem; cursor: pointer; accent-color: var(--ink); }
  .checklist { max-height: 6rem; overflow-y: auto; padding: .5rem; font-size: .875rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
  .switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
  .switch input { position: absolute; opacity: 0; width: 0; height: 0; }
  .switch .track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; }
  .switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s, background-color .2s; }
  .switch input:checked + .track { background: var(--brand-solid); }
  .switch input:checked + .track::after { transform: translateX(20px); background: var(--accent); }
  .switch-danger input:checked + .track { background: var(--danger); }
  .switch-danger input:checked + .track::after { background: #fff; }
  .switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
  .switch input:disabled + .track { opacity: .5; }
  
  .doc-box { padding: 1rem; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; }
  .doc-box-title { margin: 0 0 .75rem; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
  .notice { padding: 1rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-deep) 30%, transparent); border-radius: 12px; }
  
  .badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 6px; font-size: .72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
  .badge-info { background: var(--accent-soft); color: var(--ink); border-color: color-mix(in srgb, var(--accent-deep) 30%, transparent); }
  .badge-accent { background: var(--accent); color: #0E0F12; border-color: transparent; }
  .badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
  .badge-bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
  .badge-mono { font-family: ui-monospace, monospace; font-weight: 600; }
  .btn-soft { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
  .btn-soft:hover { border-color: var(--ink-3); }
  .btn-soft-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-soft); }
  .btn-soft-ok:hover { border-color: var(--ok); }
  .btn-soft-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-bg); }
  .btn-soft-warn:hover { border-color: var(--warn); }
  
  [data-theme="dark"] .field { background: var(--surface-2); }
  [data-theme="dark"] .field:hover { border-color: var(--ink-3); }
  [data-theme="dark"] .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 244, 50, .18); }
  [data-theme="dark"] .search input { background: var(--surface-2); }
  
  [data-theme="dark"] .chip { background: var(--surface); }
  [data-theme="dark"] .chip.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
  [data-theme="dark"] .chip.active .n { opacity: .85; }
  
  [data-theme="dark"] .switch input:checked + .track { background: var(--accent); }
  [data-theme="dark"] .switch input:checked + .track::after { background: #0E0F12; }
  [data-theme="dark"] .switch-danger input:checked + .track { background: var(--danger); }
  [data-theme="dark"] .switch-danger input:checked + .track::after { background: #1A0B0B; }
  [data-theme="dark"] .check { accent-color: var(--accent); }
  
  [data-theme="dark"] .topbar { border-bottom-color: rgba(255, 255, 255, .08); }
  [data-theme="dark"] .model-facts > div, [data-theme="dark"] .doc-box { background: var(--surface-2); }
  [data-theme="dark"] .toast { background: var(--pop); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  [data-theme="dark"] .price-tag { border-color: rgba(198, 244, 50, .35); }
  [data-theme="dark"] .skeleton { background-color: var(--surface-2); }
  
  body > .site-footer {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
  }
  
  .site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 3rem 1.5rem 2rem;
    font-size: 0.8125rem;
    color: var(--ink-3);
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  
  .site-footer-inner {
    max-width: 95%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  @media (min-width: 768px) {
    .site-footer-inner {
      grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
  }
  
  .footer-col { display: flex; flex-direction: column; gap: 0.4rem; }
  
  .footer-title {
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .footer-col a {
    color: var(--ink-3);
    text-decoration: none;
    transition: color 0.15s;
  }
  .footer-col a:hover { color: var(--accent-deep); }
  [data-theme="dark"] .footer-col a:hover { color: var(--accent); }
  
  .footer-brand-name {
    font-weight: 800;
    color: var(--ink);
    font-size: 1.125rem;
    letter-spacing: -0.01em;
  }
  
  .footer-brand-desc {
    font-size: 0.8125rem;
    color: var(--ink-3);
    margin-top: 0.5rem;
    max-width: 32ch;
    line-height: 1.5;
  }
  
  .footer-col-legal { font-size: 0.75rem; }
  @media (min-width: 768px) {
    .footer-col-legal { text-align: right; align-items: flex-end; }
  }
  
  .footer-link { color: var(--accent-deep); text-decoration: none; font-weight: 600; cursor: pointer; }
  .footer-link:hover { text-decoration: underline; }
  [data-theme="dark"] .footer-link { color: var(--accent); }
  
  
 /* =====================================================================
   Cookie Consent Banner (Инвертированные цвета)
   ===================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  
  /* Инверсия: фон становится цветом текста, текст — цветом фона */
  background: var(--ink); 
  color: var(--bg);       
  
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cookie-banner-content {
  max-width: 95%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner-content p {
  margin: 0;
  flex: 1 1 300px;
  line-height: 1.5;
}

/* Ссылка в баннере: лайм на темном фоне, темный лайм на светлом */
.cookie-banner-content a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}
[data-theme="dark"] .cookie-banner-content a {
  color: var(--accent-deep);
}

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Переопределяем кнопку "Только необходимые", так как на инвертированном фоне 
   стандартная прозрачная кнопка будет невидимой */
.cookie-banner .btn-ghost {
  color: var(--bg);
  border-color: var(--bg);
}
.cookie-banner .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--bg);
}
[data-theme="dark"] .cookie-banner .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
}

@media (max-width: 600px) {
  .cookie-banner {
    padding: 1rem;
  }
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner-actions {
    justify-content: flex-end;
  }
}

/* =====================================================================
   Бейдж непрочитанных сообщений (Help Center)
   ===================================================================== */
   #nav-tabs-container > button {
    position: relative;
  }
  
  .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--side); /* Чтобы сливалось с темным топбаром */
    animation: pulse 2s infinite;
  }