  :root{
    --canvas:#F5F2EA; --surface:#FFFFFF; --surface-2:#EFEBDE; --ink:#1F1E1A; --ink-soft:#6E6A5D;
    --line:#E1DBCB; --accent:#E2551B; --accent-soft:#FBE6D9; --navy:#17314F; --navy-soft:#E6EDF3;
    --paid:#2E8B57; --paid-soft:#E1F1E7; --debt:#C0392B; --debt-soft:#FBE6E3;
    --radius-sm:8px; --radius:14px; --radius-lg:20px;
    --shadow-sm:0 1px 3px rgba(23,49,81,.07), 0 1px 2px rgba(23,49,81,.05);
    --shadow:0 4px 16px rgba(23,49,81,.09);
    --shadow-lg:0 16px 40px rgba(23,49,81,.16);
    --sidebar-w:252px;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background-color:var(--canvas); color:var(--ink); font-family:'Inter',sans-serif; -webkit-font-smoothing:antialiased;
    min-height:100vh;
    background-image:
      linear-gradient(rgba(23,49,79,.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(23,49,79,.045) 1px, transparent 1px);
    background-size:29px 29px;
  }
  h1,h2,h3,.display{font-family:'Oswald',sans-serif; text-transform:uppercase; letter-spacing:.02em;}
  .mono{font-family:'IBM Plex Mono',monospace; font-variant-numeric:tabular-nums;}
  :focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px;}
  ::selection{background:var(--accent-soft); color:var(--ink);}

  .btn, .chip, .navbtn, .side-link, .obj-card, .line-row, .icon-btn, .picker-item{transition:background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease, color .15s ease;}

  /* ===== App shell ===== */
  #shell{display:flex; min-height:100vh; align-items:stretch;}
  #sidebar{
    display:none; width:var(--sidebar-w); flex-shrink:0; flex-direction:column;
    background:var(--navy); color:#fff; padding:24px 18px; position:sticky; top:0; height:100vh; z-index:40;
  }
  .side-brand{display:flex; align-items:center; gap:10px; margin-bottom:32px; padding:0 4px;}
  .side-brand .mark{width:34px;height:34px;border-radius:9px;background:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
  .side-brand .mark svg{width:19px;height:19px;color:#fff;}
  .side-brand .word{font-family:'Oswald'; font-weight:700; font-size:17px; letter-spacing:.03em; text-transform:uppercase; line-height:1.1;}
  .side-brand .tagline{font-size:10.5px; opacity:.6; letter-spacing:.06em; text-transform:uppercase; margin-top:1px;}
  .side-nav{display:flex; flex-direction:column; gap:3px;}
  .side-link{
    display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px; border:none; background:none;
    color:rgba(255,255,255,.68); font-family:'Inter'; font-size:14px; font-weight:600; cursor:pointer; text-align:left;
  }
  .side-link svg{width:19px;height:19px; flex-shrink:0;}
  .side-link:hover{background:rgba(255,255,255,.07); color:#fff;}
  .side-link.active{background:var(--accent); color:#fff;}
  .side-footer{margin-top:auto; padding-top:18px; font-size:11px; line-height:1.5; color:rgba(255,255,255,.45); border-top:1px solid rgba(255,255,255,.12);}

  #mainCol{flex:1; min-width:0; display:flex; flex-direction:column;}

  .topbar{position:sticky; top:0; z-index:20; background:var(--navy); color:#fff; padding:16px 18px 14px; box-shadow:0 2px 8px rgba(0,0,0,.15);}
  .topbar .eyebrow{font-size:11px; letter-spacing:.14em; opacity:.65; font-family:'Oswald',sans-serif; text-transform:uppercase;}
  .topbar h1{font-size:20px; margin:2px 0 0; font-weight:600;}
  .topbar .sub{font-size:12.5px; opacity:.75; margin-top:3px; font-family:'Inter'; text-transform:none; letter-spacing:0;}
  .topbar-actions{position:absolute; right:14px; top:14px; display:flex; gap:6px; align-items:center;}
  .icon-btn{width:36px;height:36px; border-radius:10px; border:none; background:rgba(255,255,255,.12); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer;}
  .icon-btn:hover{background:rgba(255,255,255,.2);}
  .icon-btn:active{background:rgba(255,255,255,.28); transform:scale(.96);}
  .back-btn{background:none;border:none;color:#fff;display:flex;align-items:center;gap:6px;cursor:pointer;font-family:'Inter';font-size:14px;padding:0 0 8px;opacity:.85;}
  .desktop-cta{display:none;}

  main{padding:16px 16px 100px; flex:1; width:100%; max-width:1360px; margin:0 auto;}

  .bottomnav{position:fixed; bottom:0; left:0; right:0; z-index:30; background:var(--surface); border-top:1px solid var(--line); display:flex; padding-bottom:env(safe-area-inset-bottom);}
  .navbtn{flex:1; border:none; background:none; padding:10px 4px 8px; display:flex; flex-direction:column; align-items:center; gap:3px; color:var(--ink-soft); font-size:10.5px; font-family:'Inter'; font-weight:600; cursor:pointer;}
  .navbtn.active{color:var(--accent);}
  .navbtn svg{width:21px;height:21px;}

  .card{background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:14px; margin-bottom:12px; border:1px solid var(--line);}
  .search{width:100%; border:1px solid var(--line); background:var(--surface); border-radius:var(--radius-sm); padding:10px 12px; font-size:14px; font-family:'Inter'; color:var(--ink);}
  .search:focus{outline:2px solid var(--accent); outline-offset:1px;}

  .chips{display:flex; gap:6px; margin:10px 0; flex-wrap:wrap;}
  .chip{border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:6px 13px; font-size:12.5px; font-weight:600; color:var(--ink-soft); cursor:pointer;}
  .chip:hover{border-color:var(--accent);}
  .chip.active{background:var(--navy); color:#fff; border-color:var(--navy);}

  .grid-wrap{display:grid; gap:14px; grid-template-columns:1fr;}

  .cat-header{display:flex; align-items:center; justify-content:space-between; padding:10px 2px; cursor:pointer;}
  .cat-header .name{font-family:'Oswald'; font-weight:600; font-size:15px; letter-spacing:.03em; display:flex; align-items:center; gap:8px;}
  .cat-header .tick{width:14px;height:3px;background:var(--accent);border-radius:2px;}
  .cat-count{font-size:11.5px; color:var(--ink-soft); font-family:'IBM Plex Mono';}
  .cat-actions{display:flex; gap:2px; align-items:center;}
  .mini-btn{background:none;border:none;color:var(--ink-soft);cursor:pointer;padding:5px;display:flex;border-radius:6px;}
  .mini-btn:hover{background:var(--surface-2); color:var(--accent);}

  .item-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 4px; border-top:1px solid var(--line);}
  .item-row .info{flex:1; min-width:0;}
  .item-row .name{font-size:14px; font-weight:500;}
  .item-row .meta{font-size:12px; color:var(--ink-soft); margin-top:2px;}
  .item-row .price{font-family:'IBM Plex Mono'; font-weight:600; font-size:14px; white-space:nowrap;}
  .badge-type{display:inline-block; font-size:9.5px; font-weight:700; letter-spacing:.05em; padding:2px 6px; border-radius:5px; margin-right:6px; text-transform:uppercase; font-family:'Inter';}
  .badge-material{background:var(--navy-soft); color:var(--navy);}
  .badge-work{background:var(--accent-soft); color:var(--accent);}

  .fab{position:fixed; right:20px; bottom:calc(78px + env(safe-area-inset-bottom)); z-index:25; width:56px; height:56px; border-radius:16px; background:var(--accent); color:#fff; border:none; box-shadow:var(--shadow-lg); display:flex; align-items:center; justify-content:center; cursor:pointer;}
  .fab:active{transform:scale(.95);}

  .btn{border:none; border-radius:var(--radius-sm); padding:11px 16px; font-family:'Inter'; font-weight:600; font-size:14px; cursor:pointer;}
  .btn-primary{background:var(--accent); color:#fff; box-shadow:0 2px 8px rgba(226,85,27,.28);}
  .btn-primary:hover{filter:brightness(1.05);}
  .btn-outline{background:var(--surface); border:1px solid var(--line); color:var(--ink);}
  .btn-outline:hover{border-color:var(--accent); color:var(--accent);}
  .btn-navy{background:var(--navy); color:#fff;}
  .btn-navy:hover{filter:brightness(1.15);}
  .btn-ghost{background:none;border:none;color:var(--ink-soft);}
  .btn-danger{background:none;border:1px solid var(--debt);color:var(--debt);}
  .btn-danger:hover{background:var(--debt-soft);}
  .btn-sm{padding:7px 11px; font-size:12.5px; border-radius:8px;}
  .btn-block{width:100%;}
  .btn:disabled{opacity:.45;}
  .btn:active{transform:scale(.98);}

  .field{margin-bottom:12px;}
  .field label{display:block; font-size:12px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; text-transform:uppercase; letter-spacing:.04em;}
  .field input, .field select, .field textarea{width:100%; border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px 12px; font-size:14.5px; font-family:'Inter'; background:#fff; color:var(--ink);}
  .field input:focus, .field select:focus, .field textarea:focus{outline:2px solid var(--accent); outline-offset:1px;}
  .field textarea{resize:vertical; min-height:60px;}
  .row2{display:flex; gap:10px;}
  .row2 > *{flex:1;}
  .radio-row{display:flex; gap:10px; margin-bottom:12px;}
  .radio-opt{flex:1; border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px; text-align:center; font-size:13px; font-weight:600; cursor:pointer; color:var(--ink-soft);}
  .radio-opt.active{border-color:var(--accent); color:var(--accent); background:var(--accent-soft);}

  .obj-card{background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-sm); border:1px solid var(--line); padding:16px; cursor:pointer; position:relative; overflow:hidden;}
  .obj-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:var(--accent);}
  .obj-card h3{margin:0 0 2px; font-size:16px; font-weight:600; letter-spacing:.01em;}
  .obj-card .addr{font-size:12.5px; color:var(--ink-soft); margin-bottom:10px;}
  .obj-stats{display:flex; justify-content:space-between; align-items:flex-end; margin-top:6px; gap:6px;}
  .obj-stats .stat{font-size:11px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em;}
  .obj-stats .val{font-family:'IBM Plex Mono'; font-size:15px; font-weight:600; display:block; margin-top:2px;}
  .tag{font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap;}
  .tag-debt{background:var(--debt-soft); color:var(--debt);}
  .tag-pos{background:var(--paid-soft); color:var(--paid);}
  .tag-zero{background:var(--surface-2); color:var(--ink-soft);}

  @media (hover:hover){ .obj-card:hover{box-shadow:var(--shadow-lg); transform:translateY(-2px);} }

  .empty{text-align:center; padding:50px 20px; color:var(--ink-soft);}
  .empty svg{width:52px;height:52px;opacity:.35;margin-bottom:10px;}
  .empty p{font-size:14px; line-height:1.5;}

  .tick-corner{position:relative;}
  .tick-corner::before, .tick-corner::after{content:""; position:absolute; width:13px; height:13px; border:2px solid var(--accent); opacity:.5; pointer-events:none;}
  .tick-corner::before{top:-1px;left:-1px; border-right:none; border-bottom:none; border-radius:4px 0 0 0;}
  .tick-corner::after{bottom:-1px;right:-1px; border-left:none; border-top:none; border-radius:0 0 4px 0;}

  .side-panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:16px;}

  .detail-grid{display:block;}
  .detail-side{margin-top:16px;}

  .summary-strip{display:flex; background:var(--navy); border-radius:var(--radius); overflow:hidden; margin:0; color:#fff;}
  .summary-strip .cell{flex:1; padding:12px 10px; text-align:center; border-right:1px solid rgba(255,255,255,.12);}
  .summary-strip .cell:last-child{border-right:none;}
  .summary-strip .cell .l{font-size:9.5px; text-transform:uppercase; letter-spacing:.04em; opacity:.7;}
  .summary-strip .cell .v{font-family:'IBM Plex Mono'; font-weight:600; font-size:14.5px; margin-top:3px;}
  .summary-strip .cell.debt .v{color:#FFB199;}
  .summary-strip .cell.pos .v{color:#9BE3BE;}
  .summary-strip.vertical{flex-direction:column;}
  .summary-strip.vertical .cell{border-right:none; border-bottom:1px solid rgba(255,255,255,.12); text-align:left; padding:11px 4px; display:flex; align-items:center; justify-content:space-between;}
  .summary-strip.vertical .cell:last-child{border-bottom:none;}
  .summary-strip.vertical .cell .v{margin-top:0; font-size:15px;}

  .segment{display:flex; background:var(--surface-2); border-radius:var(--radius-sm); padding:3px; margin-bottom:12px;}
  .segment button{flex:1; border:none; background:none; padding:8px; border-radius:8px; font-weight:600; font-size:13px; color:var(--ink-soft); cursor:pointer;}
  .segment button.active{background:var(--surface); color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.1);}

  .line-row{position:relative; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:12px; margin-bottom:9px; overflow:hidden;}
  .line-row.paid{background:#FAFCF9; border-color:#CFE7DA;}
  .line-row.partial{background:#FFFBF3; border-color:#F0DFB8;}
  .line-top{display:flex; justify-content:space-between; gap:8px; align-items:flex-start;}
  .line-name{font-size:14px; font-weight:500; flex:1;}
  .line-sum{font-family:'IBM Plex Mono'; font-weight:700; font-size:14.5px; white-space:nowrap;}
  .line-controls{display:flex; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap;}
  .qty-input{width:64px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; font-family:'IBM Plex Mono'; font-size:13px;}
  .price-input{width:80px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; font-family:'IBM Plex Mono'; font-size:13px;}
  .unit-lbl{font-size:11.5px; color:var(--ink-soft);}
  .status-note{font-size:11.5px; font-weight:700; margin-left:auto;}
  .status-note.st-paid{color:var(--paid);}
  .status-note.st-partial{color:#A87A1E;}
  .status-note.st-unpaid{color:var(--ink-soft);}
  .stamp{position:absolute; right:10px; top:8px; transform:rotate(-9deg); border:2px solid var(--paid); color:var(--paid); font-family:'Oswald'; font-weight:700; font-size:11px; letter-spacing:.1em; padding:2px 8px; border-radius:6px; opacity:.85; pointer-events:none; text-transform:uppercase;}
  .del-x{background:none;border:none;color:var(--ink-soft);cursor:pointer;padding:2px;}
  .del-x:hover{color:var(--debt);}

  .pay-row{display:flex; justify-content:space-between; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:11px 13px; margin-bottom:9px; gap:8px;}
  .pay-row .method{display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:3px 8px; border-radius:7px;}
  .method-cash{background:var(--paid-soft); color:var(--paid);}
  .method-card{background:var(--navy-soft); color:var(--navy);}
  .pay-row .date{font-size:11.5px; color:var(--ink-soft); margin-top:3px;}
  .pay-row .amt{font-family:'IBM Plex Mono'; font-weight:700; font-size:15px;}
  .filter-panel{background:var(--surface-2); border-radius:var(--radius); padding:10px; margin-bottom:10px;}

  .client-card{background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-sm); border:1px solid var(--line); padding:14px;}
  .client-card h3{margin:0 0 2px; font-size:15.5px;}
  .client-card .phone{font-size:12.5px; color:var(--ink-soft); font-family:'IBM Plex Mono';}
  .client-obj-row{display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-top:1px solid var(--line); font-size:13px;}

  .modal-overlay{position:fixed; inset:0; background:rgba(20,19,16,.55); backdrop-filter:blur(2px); z-index:100; display:flex; align-items:flex-end; justify-content:center;}
  .modal-overlay.center{align-items:center; padding:20px;}
  .modal-sheet{background:var(--surface); width:100%; max-width:560px; border-radius:22px 22px 0 0; padding:18px 18px calc(18px + env(safe-area-inset-bottom)); max-height:88vh; overflow-y:auto; animation:slideup .18s ease-out; box-shadow:var(--shadow-lg);}
  .modal-overlay.center .modal-sheet{border-radius:20px; max-height:80vh;}
  @keyframes slideup{from{transform:translateY(30px); opacity:0;} to{transform:translateY(0); opacity:1;}}
  .modal-title{font-size:17px; font-weight:600; margin:0 0 14px; display:flex; justify-content:space-between; align-items:center;}
  .modal-title button{background:none;border:none;color:var(--ink-soft);cursor:pointer;}
  .hint{font-size:12.5px; color:var(--ink-soft); line-height:1.5; background:var(--surface-2); border-radius:var(--radius-sm); padding:10px 12px; margin-bottom:14px;}
  .picker-cat{font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin:14px 0 6px;}
  .picker-item{display:flex; justify-content:space-between; align-items:center; padding:9px 8px; border-top:1px solid var(--line); cursor:pointer; border-radius:8px;}
  .picker-item:hover{background:var(--surface-2);}
  .picker-item.picked{background:var(--paid-soft);}
  .picker-item.picked:hover{background:#D8E8DB;}
  .picker-item .name{font-size:13.5px;}
  .picker-item .price{font-family:'IBM Plex Mono'; font-size:13px; color:var(--ink-soft);}
  .selected-strip{background:var(--surface-2); border-radius:var(--radius); padding:10px; margin-top:12px;}
  .selected-strip .srow{display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--line);}
  .selected-strip .srow:last-child{border-bottom:none;}
  .selected-strip .srow .n{flex:1; font-size:13px;}
  .diff-row{display:flex; align-items:center; gap:10px; padding:8px 4px; border-top:1px solid var(--line); font-size:13px;}
  .diff-row input[type=checkbox]{width:16px;height:16px;}
  .diff-old{color:var(--ink-soft); text-decoration:line-through; font-family:'IBM Plex Mono'; font-size:12px;}
  .diff-new{color:var(--paid); font-weight:700; font-family:'IBM Plex Mono'; font-size:13px;}
  .progress-box{text-align:center; padding:20px 10px;}
  .spinner{width:34px;height:34px;border:3px solid var(--line); border-top-color:var(--accent); border-radius:50%; margin:0 auto 14px; animation:spin 0.8s linear infinite;}
  @keyframes spin{to{transform:rotate(360deg);}}

  .toast{position:fixed; bottom:90px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:10px 18px; border-radius:999px; font-size:13px; z-index:200; box-shadow:var(--shadow-lg); max-width:85vw; text-align:center;}

  #printArea{display:none;}
  @media print{
    body *{visibility:hidden;}
    #printArea, #printArea *{visibility:visible;}
    #printArea{display:block; position:absolute; top:0; left:0; width:100%; padding:0; background:#fff; color:#000;}
    .p-title{font-family:'Oswald',sans-serif; font-size:22px; margin:0 0 2px; text-transform:uppercase;}
    .p-sub{font-size:12px; color:#444; margin-bottom:14px;}
    .p-table{width:100%; border-collapse:collapse; font-size:12px; margin-bottom:14px;}
    .p-table th, .p-table td{border:1px solid #999; padding:5px 7px; text-align:left;}
    .p-table th{background:#eee;}
    .p-table td.num, .p-table th.num{text-align:right; font-family:'IBM Plex Mono',monospace;}
    .p-section-title{font-size:13px; font-weight:700; text-transform:uppercase; margin:14px 0 6px;}
    .p-total{font-size:14px; font-weight:700; text-align:right; margin-top:6px;}
    .p-sign{display:flex; justify-content:space-between; margin-top:50px; font-size:12px;}
    .p-sign div{width:45%; border-top:1px solid #333; padding-top:4px;}
  }

  @media (min-width: 900px){
    body{padding-bottom:0;}
    #sidebar{display:flex;}
    .bottomnav{display:none;}
    .fab{display:none !important;}
    .desktop-cta{display:inline-flex; align-items:center; gap:6px;}
    main{padding:26px 34px 50px;}
    .topbar{padding:18px 34px 16px;}
    .topbar-actions{right:34px;}
    .grid-wrap{grid-template-columns:repeat(auto-fill, minmax(300px,1fr));}
    .modal-overlay{align-items:center; padding:20px;}
    .modal-sheet{border-radius:20px; max-height:82vh;}
    .detail-grid{display:grid; grid-template-columns:1fr 320px; gap:24px; align-items:start;}
    .detail-side{margin-top:0; position:sticky; top:96px;}
  }
  @media (min-width: 1300px){
    main{max-width:1520px;}
    .grid-wrap{grid-template-columns:repeat(auto-fill, minmax(320px,1fr));}
  }

/* ===== Серверная версия: только необходимые дополнения ===== */
a{color:inherit;text-decoration:none}
.side-link,.navbtn{width:100%;text-decoration:none}
.side-footer{display:flex;flex-direction:column;gap:9px}
.side-user{color:rgba(255,255,255,.82);font-weight:600;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-footer-actions{display:flex;gap:7px}
.side-footer-link,.side-logout{flex:1;border:1px solid rgba(255,255,255,.18);background:transparent;color:rgba(255,255,255,.72);border-radius:8px;padding:7px 8px;font:600 11px 'Inter',sans-serif;cursor:pointer;text-align:center}
.side-footer-link:hover,.side-logout:hover{border-color:rgba(255,255,255,.38);color:#fff;background:rgba(255,255,255,.06)}
.mobile-settings{display:flex}
.mobile-settings svg{width:18px;height:18px}
.toolbar-actions,.page-actions,.inline-actions,.modal-actions,.copy-field{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.form-error{margin-top:12px;color:var(--debt);background:var(--debt-soft);padding:9px 11px;border-radius:8px;font-size:13px}
.muted{color:var(--ink-soft)}
.danger-text{color:var(--debt)}
.modal-actions{margin-top:14px}
.modal-wide{max-width:900px}
.source-list{font-size:12px;line-height:1.5;padding-left:20px}
.source-list a{color:var(--navy);text-decoration:underline;word-break:break-word}
.check-row{display:flex;gap:10px;align-items:flex-start;padding:10px 2px;border-top:1px solid var(--line)}
.check-row input{margin-top:3px}
.copy-field input{flex:1;min-width:0;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;font:14px 'Inter',sans-serif;color:var(--ink);background:#fff}
.client-obj-row>a{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.client-obj-row .inline-actions{justify-content:flex-end;flex-wrap:nowrap}
.fab{text-decoration:none}
.form-shell{max-width:760px;margin:0 auto}
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}
.settings-grid .card{margin:0}
.settings-grid h2{margin:0 0 14px;font-size:17px}
.status-row{display:flex;align-items:center;gap:8px;margin:10px 0}
.status-dot{width:10px;height:10px;border-radius:50%;display:inline-block}
.status-dot.ok{background:var(--paid)}
.status-dot.off{background:var(--debt)}
code{font-family:'IBM Plex Mono',monospace;font-size:.9em;background:var(--surface-2);padding:2px 5px;border-radius:5px}
.login-body{min-height:100vh;display:grid;place-items:center;padding:20px;background-color:var(--canvas)}
.login-card{width:min(430px,100%);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:28px}
.login-brand{display:flex;align-items:center;gap:10px}
.login-brand .mark{width:38px;height:38px;border-radius:10px;background:var(--accent);display:flex;align-items:center;justify-content:center;color:#fff}
.login-brand .mark svg{width:21px;height:21px}
.login-brand .word{font-family:'Oswald',sans-serif;font-weight:700;font-size:19px;letter-spacing:.03em;text-transform:uppercase;line-height:1.1}
.login-brand .tagline{font-size:10.5px;color:var(--ink-soft);letter-spacing:.06em;text-transform:uppercase;margin-top:1px}
.login-card h1{margin:25px 0 4px;font-size:23px}
.login-sub{color:var(--ink-soft);font-size:13px;line-height:1.5;margin:0 0 20px}
.table-scroll{overflow:auto}
.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th,.data-table td{padding:9px 8px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
.data-table th{font-size:11px;color:var(--ink-soft);text-transform:uppercase;letter-spacing:.04em}
.data-table td:first-child{white-space:normal;min-width:220px}
.public-wrap{max-width:1100px;margin:0 auto;padding:24px}
.public-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.public-head h1{margin:2px 0}
.public-head .sub{color:var(--ink-soft)}
.public-head .eyebrow{font-size:11px;letter-spacing:.14em;color:var(--ink-soft);font-family:'Oswald',sans-serif;text-transform:uppercase}
.public-note{text-align:center;font-size:12px;color:var(--ink-soft);margin:14px 0}
.topbar.has-actions h1,.topbar.has-actions .sub{padding-right:116px}
.topbar-actions .btn svg,.btn svg{width:15px;height:15px;flex-shrink:0}
.empty .btn{margin-top:6px}
.line-row .del-x svg,.pay-row .del-x svg{width:18px;height:18px}
.price-history-list{max-height:58vh;overflow:auto}

@media (min-width:900px){
  .mobile-settings{display:none}
}
@media (max-width:899px){
  .settings-grid{grid-template-columns:1fr}
  .public-wrap{padding:14px}
  .public-head{flex-direction:column}
  .client-obj-row{align-items:flex-start;gap:8px}
  .client-obj-row .inline-actions{flex-shrink:0}
  .copy-field{align-items:stretch}
  .copy-field .btn{width:100%}
}
@media print{
  body:not(.print-estimate-mode) *{visibility:visible!important}
  body:not(.print-estimate-mode) #printArea{display:none!important}
  body.print-estimate-mode *{visibility:hidden!important}
  body.print-estimate-mode #printArea,body.print-estimate-mode #printArea *{visibility:visible!important}
  body.print-estimate-mode #printArea{display:block!important;position:absolute!important;inset:0 auto auto 0;width:100%;padding:0;background:#fff;color:#000}
  #sidebar,.bottomnav,.topbar,.fab,.object-print-hide,.public-head .btn{display:none!important}
  #mainCol,main,.public-wrap{padding:0!important;margin:0!important;max-width:none!important}
  body{background:#fff!important;background-image:none!important}
  .card,.line-row,.pay-row,.side-panel{box-shadow:none;break-inside:avoid}
  .detail-grid{display:block!important}
  .detail-side{margin-top:14px!important;position:static!important}
  .public-head{display:block}
  .data-table{font-size:11px}
}
.icon-btn svg{width:18px;height:18px}
.fab svg{width:24px;height:24px}
.mini-btn svg{width:17px;height:17px}
.toast-error{background:var(--debt)}
.filter-panel input:not(.search){width:100%;border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 10px;font:13px 'Inter',sans-serif;background:#fff;color:var(--ink)}


/* ===== Точное выравнивание пустых состояний и кнопки объекта ===== */
.grid-wrap > .empty{
  grid-column:1 / -1;
  width:100%;
}

@media (min-width:900px){
  .topbar.has-actions h1,
  .topbar.has-actions .sub{
    padding-right:150px;
  }

  .topbar-actions .desktop-cta{
    width:118px;
    min-width:118px;
    height:60px;
    padding:10px 12px;
    gap:10px;
    justify-content:flex-start;
    align-items:center;
    border-radius:10px;
    white-space:normal;
    text-align:left;
    line-height:1.15;
    font-size:13px;
    font-weight:700;
  }

  .topbar-actions .desktop-cta svg{
    width:36px;
    height:36px;
    flex:0 0 36px;
  }
}
