#modal .modal-card{max-width:900px}
#modalFields.grant-task-grid{align-items:start}
.grant-org-search{position:relative}.grant-org-search input{width:100%}
.grant-org-suggestions{display:none;position:absolute;z-index:50;left:0;right:0;top:calc(100% + 5px);max-height:220px;overflow:auto;background:var(--panel,#10283b);border:1px solid rgba(196,205,199,.22);border-radius:10px;box-shadow:0 14px 35px rgba(0,0,0,.35)}
.grant-org-suggestions.open{display:block}.grant-org-option{display:block;width:100%;padding:10px 12px;text-align:left;border:0;border-bottom:1px solid rgba(196,205,199,.1);background:transparent;color:inherit;cursor:pointer}.grant-org-option:hover{background:rgba(255,255,255,.08)}
.grant-color-select-wrap,.grant-label-select-wrap{display:flex;gap:8px;align-items:center}.grant-color-select-wrap select,.grant-label-select-wrap select{flex:1}
.grant-selected-labels{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.grant-selected-label{display:inline-flex;align-items:center;gap:7px;padding:6px 9px;border:1px solid rgba(196,205,199,.17);border-radius:999px;background:rgba(255,255,255,.05)}.grant-selected-label button{border:0;background:transparent;color:inherit;cursor:pointer;font-size:16px}
.grant-custom-label-row{display:none;grid-template-columns:1fr 52px auto;gap:8px;margin-top:9px}.grant-custom-label-row.open{display:grid}
#taskModalTabs{display:none!important}#taskChatPanel.task-chat-panel{display:block!important;margin-top:18px;padding-top:16px;border-top:1px solid rgba(196,205,199,.15)}#taskChatPanel:before{content:'Чат задачи';display:block;font-size:15px;font-weight:800;margin-bottom:10px}#taskChatPanel .task-chat-messages{height:220px}#modalForm>div:last-child{display:flex!important}
body.day .grant-org-suggestions{background:#fff}
@media(max-width:700px){.grant-custom-label-row{grid-template-columns:1fr 48px}.grant-custom-label-row .btn{grid-column:1/-1}.grant-label-select-wrap{flex-wrap:wrap}.grant-label-select-wrap .btn{flex:1}}

/* 1.6.35 */
.grant-filter-inline{display:inline-flex!important;align-items:center;margin:0!important}
.grant-field-filter{min-width:170px;max-width:220px;height:42px;margin:0!important}
#deals .toolbar>.grant-filter-inline,#clients .toolbar>#clientFieldFilter{order:-1}
#modalFields.grant-task-grid .field{min-width:0}
#modalFields.grant-task-grid .wide-6{grid-column:span 6}
#modalFields.grant-task-grid input,#modalFields.grant-task-grid select{min-height:42px}
#taskChatPanel.task-chat-panel{display:block!important}
@media(max-width:900px){#modalFields.grant-task-grid .wide-6{grid-column:1/-1}}


/* 1.6.37 — исправленная сетка карточки тендерной задачи */
#modal .modal-box{width:min(920px,100%)}
#modalFields.grant-task-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 16px;
  align-items:start;
}
#modalFields.grant-task-grid .field{grid-column:span 1;min-width:0;align-self:start}
#modalFields.grant-task-grid .field.wide-6,
#modalFields.grant-task-grid .field.full{grid-column:1/-1}
#modalFields.grant-task-grid .field>label:first-child{display:block;line-height:1.3;margin:0 0 2px}
#modalFields.grant-task-grid input,
#modalFields.grant-task-grid select,
#modalFields.grant-task-grid textarea{box-sizing:border-box;width:100%;min-width:0}
#modalFields.grant-task-grid .check-row{display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 12px;margin-top:8px}
#modalFields.grant-task-grid .check-row input{width:auto;min-height:0;flex:0 0 auto}
#taskChatPanel.task-chat-panel{clear:both;width:100%;box-sizing:border-box}
#taskChatPanel .task-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch}
#taskChatPanel .task-chat-compose textarea{min-height:64px;box-sizing:border-box}
@media(max-width:760px){
 #modalFields.grant-task-grid{grid-template-columns:1fr}
 #modalFields.grant-task-grid .field,#modalFields.grant-task-grid .field.wide-6,#modalFields.grant-task-grid .field.full{grid-column:1}
 #taskChatPanel .task-chat-compose{grid-template-columns:1fr}
}

/* 1.6.38 — адаптивная воронка и корректный табличный список */
#deals .toolbar{display:grid;grid-template-columns:minmax(220px,1fr) minmax(210px,250px) auto auto;align-items:center;gap:12px}
#deals .toolbar .search{width:100%;max-width:none!important;min-width:0}
#deals .toolbar .grant-filter-inline{min-width:0}
#deals .toolbar>.btn.primary{white-space:nowrap}
.tender-board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(330px,1fr);gap:14px;align-items:start;overflow-x:auto;overflow-y:visible;padding:2px 2px 16px;scrollbar-gutter:stable}
.tender-column{min-height:0;height:auto;align-self:start;background:var(--vh-surface-2);border:1px solid var(--vh-line);border-radius:16px;padding:12px;overflow:hidden}
.tender-column-head{margin-bottom:10px;padding:1px 2px 10px;border-bottom:1px solid var(--vh-line)}
.tender-column-head h3{margin:0;font-size:14px;line-height:1.25}
.tender-column-body{display:flex;flex-direction:column;gap:10px;min-height:42px}
.tender-empty{padding:10px 4px;color:var(--vh-muted);font-size:12px}
.tender-card{position:relative;overflow:hidden;margin:0;padding:14px 14px 13px 16px;min-width:0}
.tender-card-accent{position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--task-color)}
.tender-card h4{display:flex;align-items:flex-start;gap:8px;margin:0 0 9px;line-height:1.35;overflow-wrap:anywhere}
.task-color-dot{display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;margin-top:.32em}
.tender-meta{gap:6px;line-height:1.35}
.tender-meta span{overflow-wrap:anywhere}
.tender-tags,.tender-list-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.tender-actions{display:grid;grid-template-columns:minmax(0,1fr) 34px 34px 34px;gap:6px;align-items:center}
.tender-actions .small-btn{min-width:0;white-space:nowrap}
.tender-board.list-view{display:block;overflow:visible;padding:0}
.tender-list-wrap{width:100%;overflow:auto;border-radius:14px}
.tender-list{width:100%;min-width:1480px;table-layout:fixed;border-collapse:separate;border-spacing:0}
.tender-list col.col-title{width:230px}.tender-list col.col-client{width:170px}.tender-list col.col-stage{width:160px}.tender-list col.col-status{width:125px}.tender-list col.col-priority{width:115px}.tender-list col.col-owner{width:145px}.tender-list col.col-amount{width:110px}.tender-list col.col-deadline{width:140px}.tender-list col.col-platform{width:190px}.tender-list col.col-actions{width:205px}
.tender-list th,.tender-list td{box-sizing:border-box;padding:12px 10px;overflow-wrap:anywhere}
.tender-list th{white-space:nowrap}
.tender-list-title{display:flex;align-items:flex-start;gap:8px;line-height:1.35}
.tender-list-actions{display:grid;grid-template-columns:minmax(92px,1fr) 34px 34px 34px;gap:5px;white-space:normal}
.tender-list-actions .small-btn{min-width:0;padding-left:7px;padding-right:7px;white-space:nowrap}
.money-cell{white-space:nowrap}
@media(min-width:1800px){.tender-board{grid-auto-columns:minmax(300px,1fr)}}
@media(max-width:1350px){#deals .toolbar{grid-template-columns:minmax(220px,1fr) minmax(210px,250px) auto}#deals .toolbar>.btn.primary{grid-column:auto}.deal-view-switch{order:0}.tender-board{grid-auto-columns:320px}}
@media(max-width:900px){#deals .toolbar{display:flex;flex-wrap:wrap}#deals .toolbar>*{flex:1 1 220px}#deals .toolbar .deal-view-switch,#deals .toolbar>.btn.primary{flex:0 0 auto}.tender-board{grid-auto-columns:minmax(285px,86vw)}.tender-actions{grid-template-columns:minmax(0,1fr) 32px 32px 32px}}

/* 1.6.39 — компактная воронка, размеры как в исходном макете */
#deals .toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}
#deals .toolbar .filter-bar{
  flex:0 0 150px;
  width:150px;
  min-width:150px;
  margin:0;
}
#deals .toolbar .filter-bar select{
  width:100%;
  height:40px;
  min-height:40px;
  padding:8px 32px 8px 11px;
}
#deals .toolbar #dealSearch{
  flex:0 1 260px;
  width:260px;
  max-width:260px!important;
  min-width:180px;
  height:40px;
  min-height:40px;
  padding:8px 11px;
}
#deals .toolbar #dealDeadlineSort{
  flex:0 0 230px;
  width:230px;
  max-width:230px!important;
  height:40px;
  min-height:40px;
  padding:8px 32px 8px 11px;
  margin-left:auto;
}
#deals .toolbar .deal-view-switch{
  flex:0 0 auto;
  padding:3px;
  gap:4px;
}
#deals .toolbar .deal-view-switch .btn{
  min-height:34px;
  padding:7px 11px;
  font-size:12px;
}
#deals .toolbar>.btn.primary{
  flex:0 0 auto;
  width:auto;
  min-height:40px;
  padding:9px 15px;
  font-size:12px;
  white-space:nowrap;
}
.tender-board{
  grid-auto-columns:minmax(285px,1fr);
  gap:12px;
  padding:0 0 14px;
  overflow-x:auto;
  overflow-y:hidden;
}
.tender-column{
  min-height:335px;
  padding:10px;
  border-radius:14px;
}
.tender-column-head{
  margin-bottom:9px;
  padding:1px 1px 9px;
}
.tender-column-head h3{font-size:13px}
.tender-count{padding:3px 7px;font-size:11px}
.tender-column-body{gap:9px;min-height:36px}
.tender-empty{padding:8px 3px;font-size:11px}
.tender-card{
  padding:12px 11px 11px 14px;
  border-radius:12px;
}
.tender-card h4{margin-bottom:7px;font-size:13px}
.tender-meta{gap:5px;font-size:11px;line-height:1.3}
.tender-tags,.tender-list-tags{gap:4px;margin-top:7px}
.tender-actions{
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:5px;
  margin-top:9px;
}
.tender-actions .small-btn{
  width:auto;
  min-width:30px;
  min-height:30px;
  padding:6px 9px;
  font-size:11px;
}
.tender-actions .small-btn:not(:first-child){
  width:30px;
  flex:0 0 30px;
  padding:6px 0;
}
.tender-list-actions{
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:5px;
}
.tender-list-actions .small-btn{
  width:auto;
  min-width:30px;
  min-height:30px;
  padding:6px 8px;
  font-size:11px;
}
.tender-list-actions .small-btn:not(:first-child){width:30px;flex:0 0 30px;padding:6px 0}
@media(max-width:1450px){
  #deals .toolbar{flex-wrap:wrap}
  #deals .toolbar #dealDeadlineSort{margin-left:0}
  #deals .toolbar #dealSearch{flex:1 1 230px;max-width:none!important}
  .tender-board{grid-auto-columns:290px}
}
@media(max-width:900px){
  #deals .toolbar{display:flex;flex-wrap:wrap}
  #deals .toolbar .filter-bar,#deals .toolbar #dealSearch,#deals .toolbar #dealDeadlineSort{flex:1 1 210px;width:auto;max-width:none!important;min-width:0}
  #deals .toolbar .deal-view-switch,#deals .toolbar>.btn.primary{flex:0 0 auto}
  .tender-board{grid-auto-columns:minmax(280px,86vw)}
  .tender-column{min-height:300px}
}


/* GRANT OS 1.6.47 — refined activity picker and accessible day/night palette */
.activity-picker{display:grid;grid-template-columns:minmax(220px,.9fr) minmax(260px,1.4fr);gap:10px;align-items:center}
.activity-picker select,.activity-picker input{width:100%;min-width:0}
.field-help{margin-top:6px;font-size:11px;line-height:1.4;color:var(--muted,#66756f)}
@media(max-width:760px){.activity-picker{grid-template-columns:1fr}}

body:not(.night),body[data-theme="light"]{
 --grant-bg:#f2f5f3;--grant-surface:#ffffff;--grant-surface-2:#e9efec;--grant-text:#17342a;--grant-muted:#5d7068;--grant-line:#cbd7d1;--grant-green:#176b43;--grant-green-2:#218554;--grant-navy:#173247;
 color:var(--grant-text)!important;background:var(--grant-bg)!important;
}
body:not(.night) main,body[data-theme="light"] main{background:linear-gradient(180deg,#edf3f0 0%,#f7f9f8 100%)!important;color:var(--grant-text)!important}
body:not(.night) .topbar,body[data-theme="light"] .topbar{background:rgba(255,255,255,.94)!important;border:1px solid #d4ded9!important;box-shadow:0 8px 26px rgba(18,48,37,.10)!important}
body:not(.night) .card,body:not(.night) .panel,body:not(.night) .toolbar,body:not(.night) .modal-panel,body:not(.night) .tender-column,
body[data-theme="light"] .card,body[data-theme="light"] .panel,body[data-theme="light"] .toolbar,body[data-theme="light"] .modal-panel,body[data-theme="light"] .tender-column{background:#fff!important;color:#18362b!important;border-color:#ccd8d2!important;box-shadow:0 8px 24px rgba(19,52,40,.08)!important}
body:not(.night) input,body:not(.night) select,body:not(.night) textarea,
body[data-theme="light"] input,body[data-theme="light"] select,body[data-theme="light"] textarea{background:#fff!important;color:#17342a!important;border:1px solid #bfcfc7!important;box-shadow:none!important}
body:not(.night) input::placeholder,body:not(.night) textarea::placeholder{color:#778981!important;opacity:1}
body:not(.night) label,body[data-theme="light"] label{color:#425c52!important}
body:not(.night) .muted,body[data-theme="light"] .muted,body:not(.night) .field-help{color:#61746b!important}
body:not(.night) table thead th,body[data-theme="light"] table thead th{background:#e5ece8!important;color:#24483a!important;border-color:#c7d4ce!important}
body:not(.night) table tbody td,body[data-theme="light"] table tbody td{background:#fff!important;color:#203e33!important;border-color:#d4ddd8!important}
body:not(.night) table tbody tr:hover td{background:#f0f6f3!important}
body:not(.night) .btn.primary,body[data-theme="light"] .btn.primary{background:linear-gradient(135deg,#176b43,#218554)!important;color:#fff!important;border-color:#145c39!important}
body:not(.night) .btn:not(.primary),body[data-theme="light"] .btn:not(.primary),body:not(.night) .small-btn{background:#f8faf9!important;color:#24483a!important;border-color:#bdcbc4!important}
body:not(.night) .btn:hover,body:not(.night) .small-btn:hover{filter:none!important;background:#e7f1ec!important;border-color:#7fa18f!important}
body:not(.night) :is(input,select,textarea,button):focus{outline:3px solid rgba(197,145,28,.28)!important;outline-offset:1px;border-color:#b48417!important}
body:not(.night) .modal-overlay{background:rgba(25,45,37,.48)!important;backdrop-filter:blur(5px)}

body.night,body[data-theme="dark"]{
 --grant-bg:#07140f;--grant-surface:#10251c;--grant-surface-2:#173328;--grant-text:#edf7f1;--grant-muted:#b1c4ba;--grant-line:#315044;--grant-green:#4ec985;--grant-green-2:#2fa767;--grant-gold:#e4bd57;
 color:var(--grant-text)!important;background:var(--grant-bg)!important;
}
body.night main,body[data-theme="dark"] main{background:linear-gradient(180deg,#091913 0%,#0d2118 100%)!important;color:#edf7f1!important}
body.night .topbar,body[data-theme="dark"] .topbar{background:rgba(11,29,21,.96)!important;border:1px solid #29483b!important;box-shadow:0 8px 28px rgba(0,0,0,.34)!important}
body.night .card,body.night .panel,body.night .toolbar,body.night .modal-panel,body.night .tender-column,
body[data-theme="dark"] .card,body[data-theme="dark"] .panel,body[data-theme="dark"] .toolbar,body[data-theme="dark"] .modal-panel,body[data-theme="dark"] .tender-column{background:#10251c!important;color:#edf7f1!important;border-color:#315044!important;box-shadow:0 10px 28px rgba(0,0,0,.28)!important}
body.night input,body.night select,body.night textarea,
body[data-theme="dark"] input,body[data-theme="dark"] select,body[data-theme="dark"] textarea{background:#f8faf9!important;color:#142a21!important;border:1px solid #789286!important;box-shadow:none!important}
body.night input::placeholder,body.night textarea::placeholder{color:#65776f!important;opacity:1}
body.night label,body[data-theme="dark"] label{color:#c4d6cd!important}
body.night .muted,body[data-theme="dark"] .muted,body.night .field-help{color:#aebfb6!important}
body.night table thead th,body[data-theme="dark"] table thead th{background:#18382b!important;color:#eff8f3!important;border-color:#345548!important}
body.night table tbody td,body[data-theme="dark"] table tbody td{background:#10271e!important;color:#eaf4ee!important;border-color:#2c4b3f!important}
body.night table tbody tr:hover td{background:#173b2c!important}
body.night .btn.primary,body[data-theme="dark"] .btn.primary{background:linear-gradient(135deg,#238b57,#36ad70)!important;color:#fff!important;border-color:#4ec985!important}
body.night .btn:not(.primary),body[data-theme="dark"] .btn:not(.primary),body.night .small-btn{background:#173549!important;color:#f1f7f4!important;border-color:#426172!important}
body.night .btn:hover,body.night .small-btn:hover{filter:none!important;background:#21506b!important;border-color:#6e93a8!important}
body.night :is(input,select,textarea,button):focus{outline:3px solid rgba(228,189,87,.30)!important;outline-offset:1px;border-color:#e4bd57!important}
body.night .modal-overlay,body[data-theme="dark"] .modal-overlay{background:rgba(2,9,6,.68)!important;backdrop-filter:blur(6px)}
body.night .tender-card,body[data-theme="dark"] .tender-card{background:linear-gradient(145deg,#123c28,#0b2519)!important;color:#f3faf6!important;border-color:#3c7658!important}
body.night .tender-card .tender-meta,body[data-theme="dark"] .tender-card .tender-meta{color:#d0e3d8!important}
body.night .tender-card h4,body[data-theme="dark"] .tender-card h4{color:#fff!important}

/* GRANT OS 1.6.48 — мягкая светлая палитра и нейтральная ночная тема */
:root{
  --grant-accent:#2f8f68;
  --grant-accent-hover:#267759;
  --grant-warm:#f4b860;
  --grant-radius:14px;
}

/* Дневная тема: тёплый светлый фон вместо резкого белого */
body:not(.night),body[data-theme="light"]{
  --grant-bg:#eef1ed;
  --grant-surface:#f8f7f2;
  --grant-surface-2:#e5ebe5;
  --grant-text:#26332d;
  --grant-muted:#68756f;
  --grant-line:#c8d0ca;
  background:#eef1ed!important;
  color:#26332d!important;
}
body:not(.night) main,body[data-theme="light"] main{
  background:linear-gradient(180deg,#e7ece8 0%,#f1f2ee 100%)!important;
  color:#26332d!important;
}
body:not(.night) .topbar,body[data-theme="light"] .topbar,
body:not(.night) .card,body:not(.night) .panel,body:not(.night) .toolbar,body:not(.night) .modal-panel,body:not(.night) .tender-column,
body[data-theme="light"] .card,body[data-theme="light"] .panel,body[data-theme="light"] .toolbar,body[data-theme="light"] .modal-panel,body[data-theme="light"] .tender-column{
  background:#f8f7f2!important;
  color:#26332d!important;
  border-color:#cbd2cc!important;
  box-shadow:0 8px 24px rgba(54,66,59,.10)!important;
}
body:not(.night) input,body:not(.night) select,body:not(.night) textarea,
body[data-theme="light"] input,body[data-theme="light"] select,body[data-theme="light"] textarea{
  background:#fdfcf8!important;
  color:#26332d!important;
  border:1px solid #bac5bd!important;
}
body:not(.night) input::placeholder,body:not(.night) textarea::placeholder{color:#89938e!important}
body:not(.night) table thead th,body[data-theme="light"] table thead th{
  background:#dde5df!important;color:#31473d!important;border-color:#c3ccc5!important;
}
body:not(.night) table tbody td,body[data-theme="light"] table tbody td{
  background:#f8f7f2!important;color:#2d3933!important;border-color:#d0d7d1!important;
}
body:not(.night) table tbody tr:hover td{background:#edf2ed!important}
body:not(.night) .btn:not(.primary),body[data-theme="light"] .btn:not(.primary),body:not(.night) .small-btn{
  background:#eeefe9!important;color:#35443d!important;border-color:#bcc6bf!important;
}
body:not(.night) .btn.primary,body[data-theme="light"] .btn.primary{
  background:linear-gradient(135deg,#348f6a,#49a77f)!important;color:#fff!important;border-color:#2c7b5b!important;
}
body:not(.night) .tender-card,body[data-theme="light"] .tender-card{
  background:linear-gradient(145deg,#fffdf6,#edf3ed)!important;color:#25342d!important;border-color:#b8c9be!important;
}
body:not(.night) .tender-card h4,body:not(.night) .tender-card .tender-meta{color:#2b3a33!important}

/* Ночная тема: графитово-лиловая, без тёмно-синего и тёмно-зелёного */
body.night,body[data-theme="dark"]{
  --grant-bg:#27262b;
  --grant-surface:#343238;
  --grant-surface-2:#403d44;
  --grant-text:#f1edf3;
  --grant-muted:#c1bac5;
  --grant-line:#5e5863;
  background:#27262b!important;
  color:#f1edf3!important;
}
body.night main,body[data-theme="dark"] main{
  background:linear-gradient(180deg,#2b292f 0%,#36333a 100%)!important;
  color:#f1edf3!important;
}
body.night .topbar,body[data-theme="dark"] .topbar,
body.night .card,body.night .panel,body.night .toolbar,body.night .modal-panel,body.night .tender-column,
body[data-theme="dark"] .card,body[data-theme="dark"] .panel,body[data-theme="dark"] .toolbar,body[data-theme="dark"] .modal-panel,body[data-theme="dark"] .tender-column{
  background:#39363e!important;
  color:#f1edf3!important;
  border-color:#625c68!important;
  box-shadow:0 10px 28px rgba(0,0,0,.30)!important;
}
body.night input,body.night select,body.night textarea,
body[data-theme="dark"] input,body[data-theme="dark"] select,body[data-theme="dark"] textarea{
  background:#e9e4ec!important;
  color:#29262d!important;
  border:1px solid #a59da9!important;
  box-shadow:none!important;
}
body.night input::placeholder,body.night textarea::placeholder{color:#756e79!important;opacity:1}
body.night label,body[data-theme="dark"] label{color:#e2dce5!important}
body.night .muted,body[data-theme="dark"] .muted,body.night .field-help{color:#c5bec9!important}
body.night table thead th,body[data-theme="dark"] table thead th{
  background:#4a4650!important;color:#f5f1f6!important;border-color:#68616e!important;
}
body.night table tbody td,body[data-theme="dark"] table tbody td{
  background:#39363e!important;color:#eee9f0!important;border-color:#5d5762!important;
}
body.night table tbody tr:hover td{background:#4a4650!important}
body.night .btn:not(.primary),body[data-theme="dark"] .btn:not(.primary),body.night .small-btn{
  background:#5b5561!important;color:#fff!important;border-color:#77707d!important;
}
body.night .btn:not(.primary):hover,body.night .small-btn:hover{
  background:#6b6472!important;border-color:#918998!important;
}
body.night .btn.primary,body[data-theme="dark"] .btn.primary{
  background:linear-gradient(135deg,#3f9b76,#5cb58f)!important;color:#fff!important;border-color:#72c7a3!important;
}
body.night .tender-card,body[data-theme="dark"] .tender-card{
  background:linear-gradient(145deg,#57515d,#464149)!important;
  color:#f7f3f8!important;
  border-color:#756e7b!important;
}
body.night .tender-card h4,body[data-theme="dark"] .tender-card h4,
body.night .tender-card .tender-meta,body[data-theme="dark"] .tender-card .tender-meta{color:#f6f1f7!important}
body.night .check-row,body[data-theme="dark"] .check-row{background:#464249!important;border-color:#625c68!important;color:#eee9f0!important}
body.night .task-chat-messages,body[data-theme="dark"] .task-chat-messages{background:#302e33!important;border-color:#5d5762!important}
body.night .modal-overlay,body[data-theme="dark"] .modal-overlay{background:rgba(26,24,29,.66)!important;backdrop-filter:blur(6px)}
body.night :is(input,select,textarea,button):focus{outline:3px solid rgba(244,184,96,.34)!important;border-color:#e2a94f!important}

/* Единая читаемость заголовков, подписей и выпадающих списков */
.modal-panel h2,.modal-panel h3,.topbar h1,.topbar h2{letter-spacing:.01em}
select option{color:#29262d;background:#f1edf3}
body:not(.night) select option{color:#26332d;background:#fdfcf8}


/* GRANT OS 1.6.49 — редактор задачи: мягкая палитра, цветные метки, компактный чек-лист */
.task-checklist-inline{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.task-checklist-field .check-row{min-height:42px;margin:0;padding:8px 12px;display:flex;align-items:center;gap:9px;border-radius:10px}
.task-checklist-field .check-row input{width:18px!important;height:18px!important;min-width:18px;margin:0;accent-color:#d88b3d}
.grant-label-select-wrap select{font-weight:650}
.grant-selected-label{box-shadow:0 2px 7px rgba(50,43,36,.10)}

/* Дневная тема — тёплая слоновая кость и песочные поверхности */
body:not(.night),body[data-theme="light"]{--grant-bg:#e9e5dc;--grant-surface:#f6f1e7;--grant-surface-2:#ebe2d4;--grant-text:#302e2a;--grant-muted:#706b63;--grant-line:#c9bdac;background:#e9e5dc!important;color:#302e2a!important}
body:not(.night) main,body[data-theme="light"] main{background:linear-gradient(180deg,#e5e1d8 0%,#eeeae2 100%)!important}
body:not(.night) :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column),body[data-theme="light"] :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column){background:#f7f2e9!important;color:#302e2a!important;border-color:#c9bdac!important;box-shadow:0 10px 28px rgba(67,57,45,.12)!important}
body:not(.night) :is(input,select,textarea),body[data-theme="light"] :is(input,select,textarea){background:#fffaf1!important;color:#302e2a!important;border-color:#bfb19e!important}
body:not(.night) .tender-card,body[data-theme="light"] .tender-card{background:linear-gradient(145deg,#fff9ee,#eee3d4)!important;color:#322e28!important;border-color:#c5b59f!important}
body:not(.night) .check-row{background:#f1e8da!important;color:#352f28!important;border-color:#cbbba5!important}
body:not(.night) .check-row.done{background:#e4efdf!important;border-color:#9eb895!important}
body:not(.night) .grant-selected-label{background:#eee5d8!important;color:#342f29!important;border-color:#c6b6a0!important}
body:not(.night) .task-chat-messages{background:#eee8df!important;border-color:#c7bbab!important}

/* Ночная тема — светлый дымчато-графитовый интерфейс, без синего и тёмно-зелёного */
body.night,body[data-theme="dark"]{--grant-bg:#393733;--grant-surface:#504d48;--grant-surface-2:#5e5a54;--grant-text:#fff9ef;--grant-muted:#ddd4c8;--grant-line:#797269;background:#393733!important;color:#fff9ef!important}
body.night main,body[data-theme="dark"] main{background:linear-gradient(180deg,#3d3a36 0%,#494640 100%)!important;color:#fff9ef!important}
body.night :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column),body[data-theme="dark"] :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column){background:#514e49!important;color:#fff9ef!important;border-color:#7b746b!important;box-shadow:0 12px 30px rgba(20,18,16,.30)!important}
body.night #modal .modal-panel,body[data-theme="dark"] #modal .modal-panel{background:#514e49!important;color:#fff9ef!important}
body.night :is(input,select,textarea),body[data-theme="dark"] :is(input,select,textarea){background:#f2eadf!important;color:#302d29!important;border-color:#b8aa98!important}
body.night :is(input,textarea)::placeholder{color:#7d746a!important}
body.night label,body[data-theme="dark"] label{color:#f2e9dd!important}
body.night .muted,body[data-theme="dark"] .muted{color:#d7cec2!important}
body.night .tender-card,body[data-theme="dark"] .tender-card{background:linear-gradient(145deg,#6a645d,#57524c)!important;color:#fffaf1!important;border-color:#8d8479!important}
body.night .tender-card :is(h4,.tender-meta){color:#fffaf1!important}
body.night .check-row,body[data-theme="dark"] .check-row{background:#625d56!important;color:#fff8ee!important;border-color:#80776d!important}
body.night .check-row.done,body[data-theme="dark"] .check-row.done{background:#666f57!important;border-color:#9ba681!important}
body.night .grant-selected-label,body[data-theme="dark"] .grant-selected-label{background:#625d56!important;color:#fff8ee!important;border-color:#81786e!important}
body.night .task-chat-messages,body[data-theme="dark"] .task-chat-messages{background:#45423e!important;border-color:#756e66!important}
body.night table thead th,body[data-theme="dark"] table thead th{background:#625d56!important;color:#fff9ef!important;border-color:#80776e!important}
body.night table tbody td,body[data-theme="dark"] table tbody td{background:#514e49!important;color:#fff9ef!important;border-color:#746d64!important}
body.night .btn:not(.primary),body[data-theme="dark"] .btn:not(.primary),body.night .small-btn{background:#6b655e!important;color:#fffaf2!important;border-color:#8e857b!important}
body.night .btn.primary,body[data-theme="dark"] .btn.primary{background:linear-gradient(135deg,#b9783f,#d39455)!important;color:#fff!important;border-color:#e2ad72!important}
body.night :is(input,select,textarea,button):focus{outline:3px solid rgba(234,170,92,.36)!important;border-color:#dfa45f!important}
body.night .modal-overlay,body[data-theme="dark"] .modal-overlay{background:rgba(34,31,28,.64)!important}

@media(max-width:760px){.task-checklist-inline{grid-template-columns:1fr}.task-color-field,.task-checklist-field{grid-column:1/-1}}


/* GRANT OS 1.6.50 — сглаженные панели, приглушённая ночная тема и единые маркеры */
#deals .toolbar,#clients .toolbar{
  border-radius:16px!important;
  overflow:hidden!important;
  background-clip:padding-box!important;
  padding:9px 10px!important;
}
#deals .toolbar::before,#deals .toolbar::after,#clients .toolbar::before,#clients .toolbar::after{display:none!important;content:none!important}
#deals .toolbar>*:first-child,#clients .toolbar>*:first-child{margin-left:0!important}
#deals .toolbar>*:last-child,#clients .toolbar>*:last-child{margin-right:0!important}
.grant-label-select-wrap{border-radius:12px;overflow:visible}
.grant-label-select-wrap select{border-radius:12px!important}
.grant-label-select-wrap .btn{border-radius:12px!important}
select option{font-variant-emoji:emoji}

/* Ночная тема строится на дневной палитре, но снижает яркость и контраст свечения */
body.night,body[data-theme="dark"]{
  --grant-bg:#b9b3a8;
  --grant-surface:#cbc4b8;
  --grant-surface-2:#b3ac9f;
  --grant-text:#26231f;
  --grant-muted:#625d55;
  --grant-line:#958d80;
  background:#b9b3a8!important;
  color:#26231f!important;
}
body.night main,body[data-theme="dark"] main{
  background:linear-gradient(180deg,#aaa398 0%,#c2bbb0 100%)!important;
  color:#26231f!important;
}
body.night :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column),
body[data-theme="dark"] :is(.topbar,.card,.panel,.toolbar,.modal-panel,.tender-column){
  background:#c9c2b6!important;
  color:#292620!important;
  border-color:#91897d!important;
  box-shadow:0 8px 22px rgba(45,40,34,.18)!important;
}
body.night #modal .modal-panel,body[data-theme="dark"] #modal .modal-panel{background:#c9c2b6!important;color:#292620!important}
body.night :is(input,select,textarea),body[data-theme="dark"] :is(input,select,textarea){
  background:#ddd6ca!important;
  color:#27241f!important;
  border-color:#91887b!important;
}
body.night :is(input,textarea)::placeholder{color:#777066!important}
body.night label,body[data-theme="dark"] label{color:#454039!important}
body.night .muted,body[data-theme="dark"] .muted,body.night .field-help{color:#696258!important}
body.night .tender-card,body[data-theme="dark"] .tender-card{
  background:linear-gradient(145deg,#b9b0a2,#a9a093)!important;
  color:#28241f!important;
  border-color:#877e70!important;
}
body.night .tender-card :is(h4,.tender-meta),body[data-theme="dark"] .tender-card :is(h4,.tender-meta){color:#28241f!important}
body.night .check-row,body[data-theme="dark"] .check-row{background:#b9b1a5!important;color:#302b25!important;border-color:#8d8477!important}
body.night .check-row.done,body[data-theme="dark"] .check-row.done{background:#aeb9a1!important;border-color:#7f9272!important}
body.night .grant-selected-label,body[data-theme="dark"] .grant-selected-label{background:#b8b0a4!important;color:#302b25!important;border-color:#8c8376!important}
body.night .task-chat-messages,body[data-theme="dark"] .task-chat-messages{background:#b0a99e!important;border-color:#898174!important}
body.night table thead th,body[data-theme="dark"] table thead th{background:#aea69a!important;color:#302b25!important;border-color:#888074!important}
body.night table tbody td,body[data-theme="dark"] table tbody td{background:#c7c0b5!important;color:#302b25!important;border-color:#958d81!important}
body.night table tbody tr:hover td{background:#bbb3a7!important}
body.night .btn:not(.primary),body[data-theme="dark"] .btn:not(.primary),body.night .small-btn{background:#b1a99d!important;color:#302b25!important;border-color:#8b8275!important}
body.night .btn.primary,body[data-theme="dark"] .btn.primary{background:linear-gradient(135deg,#537b69,#678d7b)!important;color:#fff!important;border-color:#456a5a!important}
body.night .modal-overlay,body[data-theme="dark"] .modal-overlay{background:rgba(47,43,38,.50)!important;backdrop-filter:blur(5px)}
body.night :is(input,select,textarea,button):focus{outline:3px solid rgba(148,108,45,.25)!important;border-color:#8f6a32!important}

@media(max-width:1050px){#clients .toolbar{overflow:visible!important}}

/* GRANT OS 1.6.51 — собственный список меток с корректными круглыми цветами */
.grant-label-dropdown{position:relative;flex:1;min-width:220px}
.grant-label-select-button{width:100%;min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 13px;border:1px solid var(--line,#c8c0b5);border-radius:12px;background:var(--grant-input,#fffdf8);color:inherit;font:inherit;font-weight:650;cursor:pointer;text-align:left}
.grant-label-select-button #grantLabelSelectText{display:inline-flex;align-items:center;gap:9px;min-width:0}
.grant-label-chevron{font-size:18px;line-height:1;opacity:.7}
.grant-label-menu{display:none;position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:1000;padding:6px;background:#fffdf8;border:1px solid #bcb3a6;border-radius:12px;box-shadow:0 14px 34px rgba(48,42,35,.22);max-height:310px;overflow:auto}
.grant-label-menu.open{display:grid}
.grant-label-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:#342f29;font:inherit;text-align:left;cursor:pointer}
.grant-label-menu-item:hover,.grant-label-menu-item:focus{background:#eee7dc;outline:none}
.grant-label-dot{display:inline-block;flex:0 0 14px;width:14px;height:14px;border-radius:50%;border:1px solid rgba(20,20,20,.42);box-shadow:inset 0 0 0 1px rgba(255,255,255,.22)}
body.night .grant-label-select-button,body[data-theme="dark"] .grant-label-select-button{background:#d7d0c4!important;color:#2f2a24!important;border-color:#8f8679!important}
body.night .grant-label-menu,body[data-theme="dark"] .grant-label-menu{background:#c8c0b4!important;border-color:#847b6f!important;box-shadow:0 14px 34px rgba(35,31,27,.34)!important}
body.night .grant-label-menu-item,body[data-theme="dark"] .grant-label-menu-item{color:#2d2924!important}
body.night .grant-label-menu-item:hover,body.night .grant-label-menu-item:focus,body[data-theme="dark"] .grant-label-menu-item:hover,body[data-theme="dark"] .grant-label-menu-item:focus{background:#b6ada0!important}
@media(max-width:700px){.grant-label-dropdown{min-width:100%;flex-basis:100%}}

/* GRANT OS 1.6.52 — fixes: visible label selector contour and calm noble palette */
.grant-label-select-wrap{
  align-items:stretch!important;
}
.grant-label-dropdown{
  border-radius:13px;
}
.grant-label-select-button{
  border:1.5px solid #a69b8c!important;
  background:#fffdf8!important;
  box-shadow:0 0 0 1px rgba(116,94,62,.08),0 3px 10px rgba(61,51,39,.06)!important;
}
.grant-label-select-button:hover{
  border-color:#827666!important;
  background:#fbf7ef!important;
}
.grant-label-select-button:focus,
.grant-label-select-button[aria-expanded="true"]{
  border-color:#7c6848!important;
  outline:3px solid rgba(139,111,65,.18)!important;
}
body.night .grant-label-select-button,
body[data-theme="dark"] .grant-label-select-button{
  background:#d7d0c4!important;
  color:#2f2a24!important;
  border-color:#81776a!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.08),0 4px 12px rgba(43,37,31,.16)!important;
}
/* Native date/time field: distinct neutral contour without blue browser accent. */
input[type="date"],input[type="datetime-local"],input[type="time"]{
  accent-color:#77664b;
  border-color:#aaa091!important;
}
input[type="date"]:focus,input[type="datetime-local"]:focus,input[type="time"]:focus{
  border-color:#7c6848!important;
  outline:3px solid rgba(139,111,65,.18)!important;
}

/* v1.6.54: centered login and user administration */
.login-screen{display:flex!important;align-items:center!important;justify-content:center!important;overflow:auto!important;padding:clamp(18px,4vw,48px)!important}
.login-screen.hidden{display:none!important}
.login-card{margin:auto!important;left:auto!important;right:auto!important;transform:none!important;max-width:460px!important;flex:0 1 460px!important}
.user-admin-grid{display:grid;grid-template-columns:minmax(300px,420px) minmax(0,1fr);gap:18px;align-items:start}
.user-admin-form,.user-admin-list{padding:18px}
.user-admin-table{width:100%;border-collapse:collapse;min-width:720px}
.user-admin-table th,.user-admin-table td{padding:12px;border-bottom:1px solid var(--vh-line);text-align:left;vertical-align:middle}
.user-admin-table th{font-size:12px;text-transform:uppercase;color:var(--muted)}
.user-status{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:750}
.user-status.active{background:rgba(47,117,69,.14);color:#3f8c5a}.user-status.blocked{background:rgba(164,74,63,.13);color:#b95f53}
.user-actions{display:flex;gap:7px;flex-wrap:wrap}.admin-only[hidden]{display:none!important}
@media(max-width:950px){.user-admin-grid{grid-template-columns:1fr}.login-card{max-width:min(460px,calc(100vw - 32px))!important}}

/* 1.6.56 individual permissions */
.permission-badge{display:inline-block;margin-top:5px;padding:3px 7px;border-radius:999px;background:rgba(176,132,54,.14);color:#8a6325;font-size:11px;font-weight:700}.permission-panel{width:min(920px,94vw);max-height:90vh;overflow:auto}.permission-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}.permission-group{border:1px solid var(--border);border-radius:14px;padding:10px 12px}.permission-group legend{font-weight:800;padding:0 6px}.permission-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:8px 4px;border-bottom:1px solid rgba(120,120,120,.12);cursor:pointer}.permission-item:last-child{border-bottom:0}.permission-item code{font-size:10px;opacity:.55}.permission-item input{width:17px;height:17px}@media(max-width:760px){.permission-groups{grid-template-columns:1fr}.permission-item{grid-template-columns:auto 1fr}.permission-item code{display:none}}

/* 1.6.57 action history */
.audit-filters{display:grid;grid-template-columns:minmax(240px,2fr) repeat(4,minmax(150px,1fr));gap:10px;margin:14px 0}.audit-summary{display:flex;gap:18px;flex-wrap:wrap;margin:8px 0 14px;color:var(--muted)}.audit-table td{vertical-align:top}.audit-time{white-space:nowrap}.audit-action{font-weight:700}.audit-details{display:flex;gap:6px;flex-wrap:wrap;max-width:720px}.audit-detail{padding:4px 8px;border:1px solid var(--line);border-radius:10px;background:rgba(118,132,124,.08);font-size:12px}.nav-btn[data-page="audit"] b{background:rgba(120,145,127,.22)!important}@media(max-width:1050px){.audit-filters{grid-template-columns:1fr 1fr}}@media(max-width:720px){.audit-filters{grid-template-columns:1fr}.audit-time{white-space:normal}}

/* 1.6.58: скрытые по правам вкладки не должны отображаться даже при display:flex/grid */
[hidden], .nav-btn[hidden], #mobileNav [hidden], main .page[hidden]{display:none!important}
/* v1.6.61 — глобальный центр уведомлений */
.grant-notification-wrap{position:fixed!important;right:24px!important;bottom:24px!important;left:auto!important;top:auto!important;z-index:2147483000!important;display:block;pointer-events:none}.grant-notification-wrap[hidden]{display:none!important}.grant-notification-button{pointer-events:auto;position:relative;width:64px;height:64px;border:1px solid rgba(255,255,255,.28);border-radius:50%;background:linear-gradient(145deg,#203d34,#10261f);color:#fff;font-size:27px;cursor:pointer;box-shadow:0 14px 38px rgba(20,38,31,.34),0 0 0 8px rgba(31,67,54,.10);transition:transform .18s ease,box-shadow .18s ease}.grant-notification-button:hover{transform:translateY(-3px) scale(1.03);box-shadow:0 18px 46px rgba(20,38,31,.42),0 0 0 9px rgba(31,67,54,.13)}#grantNotificationBadge{position:absolute;right:-3px;top:-5px;min-width:25px;height:25px;padding:0 6px;border-radius:999px;background:#b94738;color:#fff;font:700 12px/25px Arial;border:3px solid var(--panel,#fff);box-sizing:content-box}.grant-notification-panel{pointer-events:auto;position:fixed!important;right:24px!important;bottom:102px!important;top:auto!important;left:auto!important;width:min(430px,calc(100vw - 32px));max-height:min(72vh,680px);overflow:hidden;border:1px solid var(--border,#d8d2c7);border-radius:20px;background:var(--panel,#fff);box-shadow:0 28px 90px rgba(24,28,25,.36);z-index:2147483001!important}.grant-notification-panel[hidden]{display:none!important}.grant-notification-head{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:16px;border-bottom:1px solid var(--border,#e8e2d8)}.grant-notification-head-actions{display:flex;align-items:center;gap:8px}.grant-notification-close{width:34px;height:34px;border:0;border-radius:10px;background:transparent;color:inherit;font-size:25px;line-height:1;cursor:pointer}.grant-notification-close:hover{background:rgba(125,94,65,.10)}.grant-notification-tabs{display:flex;gap:6px;padding:10px 14px;border-bottom:1px solid var(--border,#e8e2d8)}.grant-notification-tabs button{border:0;background:transparent;padding:7px 10px;border-radius:9px;cursor:pointer}.grant-notification-tabs button.active{background:rgba(125,94,65,.13);font-weight:700}.grant-notification-list{overflow:auto;max-height:calc(min(72vh,680px) - 126px)}.grant-notification-item{width:100%;display:grid;grid-template-columns:34px 1fr;gap:9px;text-align:left;border:0;border-bottom:1px solid var(--border,#eee8df);background:transparent;padding:13px 15px;cursor:pointer;color:inherit}.grant-notification-item:hover{background:rgba(125,94,65,.07)}.grant-notification-item.unread{background:rgba(139,91,57,.10)}.grant-notification-item small,.grant-notification-item time{display:block;margin-top:4px}.grant-notification-item time{font-size:11px;opacity:.6}.grant-notification-icon{font-size:19px}.grant-notification-empty{padding:30px;text-align:center;opacity:.65}@media(max-width:640px){.grant-notification-wrap{right:14px!important;bottom:14px!important}.grant-notification-button{width:58px;height:58px}.grant-notification-panel{right:12px!important;bottom:86px!important;width:calc(100vw - 24px);max-height:76vh}.grant-notification-list{max-height:calc(76vh - 126px)}}

/* v1.6.61.2 — читабельная цветовая схема окна уведомлений */
.grant-notification-panel{
  background:#f7f3eb!important;
  color:#1f352d!important;
  border-color:#c9c0b1!important;
  box-shadow:0 28px 90px rgba(20,32,27,.34),0 8px 24px rgba(20,32,27,.18)!important;
}
.grant-notification-head{
  background:linear-gradient(180deg,#fbf8f2 0%,#f1eadf 100%)!important;
  border-bottom-color:#d5ccbe!important;
}
.grant-notification-head b{color:#17352a!important}
.grant-notification-head .muted,#grantNotificationSummary{color:#62736b!important;opacity:1!important}
.grant-notification-head .small-btn{
  background:#fffdf8!important;
  color:#24483a!important;
  border:1px solid #b9c2bb!important;
  box-shadow:0 2px 8px rgba(31,53,45,.08)!important;
}
.grant-notification-head .small-btn:hover{background:#e8f0eb!important;border-color:#789487!important}
.grant-notification-close{color:#53655d!important}
.grant-notification-close:hover{background:#e6ded2!important;color:#17352a!important}
.grant-notification-tabs{background:#f3eee5!important;border-bottom-color:#d5ccbe!important}
.grant-notification-tabs button{color:#52645c!important;background:transparent!important}
.grant-notification-tabs button:hover{background:#e8e1d6!important;color:#24483a!important}
.grant-notification-tabs button.active{
  background:#dfe9e3!important;
  color:#173f30!important;
  box-shadow:inset 0 0 0 1px #b8c9bf!important;
}
.grant-notification-list{background:#fffdf9!important}
.grant-notification-item{
  color:#20382f!important;
  border-bottom-color:#e2dbd0!important;
  background:#fffdf9!important;
}
.grant-notification-item:hover{background:#edf3ef!important}
.grant-notification-item.unread{background:#e4eee8!important;box-shadow:inset 4px 0 0 #3d7a5d!important}
.grant-notification-item b{color:#17372b!important}
.grant-notification-item small{color:#50635a!important;opacity:1!important}
.grant-notification-item time{color:#748078!important;opacity:1!important}
.grant-notification-empty{color:#68766f!important;opacity:1!important;background:#fffdf9!important}

body.night .grant-notification-panel,body[data-theme="dark"] .grant-notification-panel{
  background:#14271f!important;
  color:#edf6f1!important;
  border-color:#3f5a4d!important;
}
body.night .grant-notification-head,body[data-theme="dark"] .grant-notification-head{
  background:linear-gradient(180deg,#1c3429 0%,#162a21 100%)!important;
  border-bottom-color:#3b5549!important;
}
body.night .grant-notification-head b,body[data-theme="dark"] .grant-notification-head b{color:#f2f8f4!important}
body.night .grant-notification-head .muted,body.night #grantNotificationSummary,
body[data-theme="dark"] .grant-notification-head .muted,body[data-theme="dark"] #grantNotificationSummary{color:#b5c8be!important}
body.night .grant-notification-head .small-btn,body[data-theme="dark"] .grant-notification-head .small-btn{
  background:#eef3ef!important;color:#19382b!important;border-color:#93aa9e!important
}
body.night .grant-notification-tabs,body[data-theme="dark"] .grant-notification-tabs{background:#172c23!important;border-bottom-color:#3b5549!important}
body.night .grant-notification-tabs button,body[data-theme="dark"] .grant-notification-tabs button{color:#b9ccc2!important}
body.night .grant-notification-tabs button.active,body[data-theme="dark"] .grant-notification-tabs button.active{background:#2c4d3d!important;color:#f0f8f4!important;box-shadow:inset 0 0 0 1px #537361!important}
body.night .grant-notification-list,body[data-theme="dark"] .grant-notification-list{background:#11241c!important}
body.night .grant-notification-item,body[data-theme="dark"] .grant-notification-item{background:#11241c!important;color:#edf6f1!important;border-bottom-color:#314b3e!important}
body.night .grant-notification-item:hover,body[data-theme="dark"] .grant-notification-item:hover{background:#1c382b!important}
body.night .grant-notification-item.unread,body[data-theme="dark"] .grant-notification-item.unread{background:#234437!important;box-shadow:inset 4px 0 0 #d1a33a!important}
body.night .grant-notification-item b,body[data-theme="dark"] .grant-notification-item b{color:#f4faf6!important}
body.night .grant-notification-item small,body[data-theme="dark"] .grant-notification-item small{color:#c3d3cb!important}
body.night .grant-notification-item time,body[data-theme="dark"] .grant-notification-item time{color:#99ada3!important}
body.night .grant-notification-empty,body[data-theme="dark"] .grant-notification-empty{color:#b7c8bf!important;background:#11241c!important}

/* GRANT OS 1.6.61.3 — live assignment notification toasts */
.grant-notification-toasts{position:fixed;right:24px;bottom:112px;z-index:2147483002;display:flex;flex-direction:column;gap:10px;width:min(390px,calc(100vw - 32px));pointer-events:none}
.grant-notification-toast{pointer-events:auto;display:grid;grid-template-columns:42px 1fr 24px;gap:10px;align-items:start;width:100%;padding:14px;border:1px solid #cfc5b6;border-radius:16px;background:#fffdf9;color:#17352a;text-align:left;box-shadow:0 18px 48px rgba(27,39,32,.28);cursor:pointer;opacity:0;transform:translateY(14px) scale(.98);transition:opacity .22s ease,transform .22s ease}
.grant-notification-toast.show{opacity:1;transform:translateY(0) scale(1)}
.grant-notification-toast:hover{background:#f5f0e8}.grant-notification-toast-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#e4eee8;font-size:20px}.grant-notification-toast b{display:block;color:#17352a;font-size:14px}.grant-notification-toast small{display:block;margin-top:4px;color:#53655d;line-height:1.35}.grant-notification-toast-close{font-size:21px;color:#718078;text-align:center;line-height:1}
body.night .grant-notification-toast,body[data-theme="dark"] .grant-notification-toast{background:#183127;color:#eef7f2;border-color:#496255}body.night .grant-notification-toast:hover,body[data-theme="dark"] .grant-notification-toast:hover{background:#214035}body.night .grant-notification-toast b,body[data-theme="dark"] .grant-notification-toast b{color:#f4faf6}body.night .grant-notification-toast small,body[data-theme="dark"] .grant-notification-toast small{color:#bfd0c7}body.night .grant-notification-toast-icon,body[data-theme="dark"] .grant-notification-toast-icon{background:#2b4d3d}
@media(max-width:640px){.grant-notification-toasts{right:12px;bottom:88px;width:calc(100vw - 24px)}}

/* GRANT OS 1.6.62 — permanent daylight palette and readable profile */
.theme-toggle{display:none!important}
html,body,body[data-theme="light"],body:not(.night){color-scheme:light!important}
#profileModal .modal-panel,.profile-modal .modal-panel,.profile-panel{
 background:#f7f4ec!important;color:#173b31!important;border:1px solid #cbd8d1!important;
 box-shadow:0 24px 70px rgba(28,55,45,.22)!important
}
#profileModal h2,#profileModal h3,#profileModal label,#profileModal b,.profile-panel h2,.profile-panel h3,.profile-panel label,.profile-panel b{color:#173b31!important}
#profileModal .muted,.profile-panel .muted{color:#687a73!important}
#profileModal input,#profileModal select,#profileModal textarea,.profile-panel input,.profile-panel select,.profile-panel textarea{background:#fffdf7!important;color:#173b31!important;border-color:#b9c9c1!important}
#profileModal .btn,.profile-panel .btn{background:#fffdf7!important;color:#244b3f!important;border-color:#b9c9c1!important}
#profileModal .btn.primary,.profile-panel .btn.primary{background:linear-gradient(135deg,#2e8b68,#47aa83)!important;color:#fff!important;border-color:#2e8b68!important}
.audit-details{display:grid;gap:5px}.audit-object{display:block;color:#173b31}.audit-detail{display:inline-block;margin-right:8px}

/* GRANT OS 1.6.64 — centered profile, crisp funnel toolbar and consistent day palette */
#profileModal.profile-modal{
 display:none!important;position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;
 padding:clamp(16px,3vw,32px)!important;overflow:auto!important;align-items:center!important;justify-content:center!important;
 background:rgba(20,38,31,.58)!important;backdrop-filter:blur(10px)!important;
}
#profileModal.profile-modal.open{display:flex!important}
#profileModal .profile-card{
 position:relative!important;margin:auto!important;width:min(680px,calc(100vw - 32px))!important;max-height:min(860px,calc(100dvh - 32px))!important;
 overflow:auto!important;background:#f7f4ec!important;color:#173b31!important;border:1px solid #c6d3cc!important;border-radius:24px!important;
 padding:clamp(18px,3vw,28px)!important;box-shadow:0 28px 80px rgba(24,48,39,.32)!important;
}
#profileModal .profile-header{position:sticky;top:-1px;z-index:2;background:#f7f4ec!important;padding-bottom:12px!important}
#profileModal .profile-settings{border-top-color:#ccd7d1!important}
#profileModal .profile-avatar{background:linear-gradient(135deg,#2f7659,#64a17d)!important;border-color:#dbe7e0!important}
#profileModal .btn:not(.primary),#profileModal .small-btn{background:#fffdf8!important;color:#244b3f!important;border:1px solid #b8c7bf!important;box-shadow:none!important}
#profileModal .btn:not(.primary):hover,#profileModal .small-btn:hover{background:#e8f0eb!important;border-color:#809b8d!important}
#profileModal .toolbar{background:transparent!important;border:0!important;padding:0!important}
@media(max-width:700px){#profileModal.profile-modal{align-items:flex-start!important}#profileModal .profile-card{max-height:none!important}.profile-editor{grid-template-columns:1fr!important}}

#deals .toolbar{align-items:center!important;gap:10px!important}
#deals .deal-view-switch{display:inline-flex!important;align-items:center!important;padding:3px!important;border:1px solid #b8c5bd!important;border-radius:14px!important;background:#edf1ed!important;box-shadow:0 2px 8px rgba(35,58,48,.08)!important}
#deals .deal-view-switch .btn{min-height:38px!important;padding:8px 14px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:#385247!important;font-weight:750!important;text-shadow:none!important;filter:none!important;box-shadow:none!important;letter-spacing:0!important}
#deals .deal-view-switch .btn.active{background:#fffdf8!important;color:#173f30!important;box-shadow:0 2px 8px rgba(32,54,44,.12),inset 0 0 0 1px #c8d2cc!important}
#deals .toolbar>.btn.primary{min-height:44px!important;padding:10px 18px!important;background:linear-gradient(135deg,#2f8a68,#49a97f)!important;color:#fff!important;border:1px solid #2f8062!important;font-weight:800!important;letter-spacing:0!important;text-shadow:none!important;filter:none!important;box-shadow:0 8px 20px rgba(47,128,98,.22)!important;-webkit-font-smoothing:antialiased!important;text-rendering:geometricPrecision!important}
#deals .toolbar>.btn.primary:hover{background:linear-gradient(135deg,#28795c,#419973)!important}
#deals .tender-board{align-items:stretch!important}
#deals .tender-column{background:#f5f1e8!important;border:1px solid #d1c9bc!important;border-radius:16px!important;overflow:hidden!important}
#deals .tender-column-head{background:#efe9de!important;border-bottom:1px solid #d7cec0!important;color:#253e34!important}
#deals .tender-card{background:#fffaf1!important;color:#243a31!important;border-color:#cfc5b6!important;box-shadow:0 7px 18px rgba(37,55,47,.08)!important}
#deals .tender-card .muted,#deals .tender-meta{color:#5d6d65!important}
#deals .small-btn{background:#f7f4ec!important;color:#28473a!important;border-color:#b9c6be!important}
#deals .small-btn:hover{background:#e7efe9!important;border-color:#7f9a8c!important}
#deals .small-btn:disabled{opacity:.38!important;cursor:not-allowed!important}


/* GRANT OS 1.6.65 — centered login, unread task emphasis, visible user profile */
.login-screen{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  min-width:100vw!important;
  height:100vh!important;
  min-height:100dvh!important;
  margin:0!important;
  padding:24px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  transform:none!important;
}
.login-screen.hidden{display:none!important}
.login-card{
  position:relative!important;
  inset:auto!important;
  margin:auto!important;
  width:min(460px,calc(100vw - 48px))!important;
  max-width:460px!important;
  flex:0 0 auto!important;
  transform:none!important;
}

.tender-card.task-unread{
  border:3px solid #267a57!important;
  box-shadow:0 0 0 2px rgba(38,122,87,.16),0 10px 26px rgba(25,71,52,.16)!important;
}
.tender-card.task-unread .tender-card-accent{width:7px!important}
.tender-card.task-unread h4,.task-unread-title{font-weight:900!important}
.task-unread-row>td{
  border-top:3px solid #267a57!important;
  border-bottom:3px solid #267a57!important;
  background:rgba(47,139,104,.07)!important;
}
.task-unread-row>td:first-child{border-left:3px solid #267a57!important}
.task-unread-row>td:last-child{border-right:3px solid #267a57!important}

.profile-trigger{
  border:2px solid #6f9b86!important;
  background:#fffdf8!important;
  box-shadow:0 0 0 3px rgba(47,118,89,.10),0 5px 14px rgba(31,76,58,.10)!important;
}
.profile-trigger:hover,.profile-trigger:focus-visible{
  border-color:#2f7659!important;
  box-shadow:0 0 0 4px rgba(47,118,89,.16),0 7px 18px rgba(31,76,58,.14)!important;
}


/* GRANT OS 1.6.65.1 — task read state without refresh and action column layout */
#deals .tender-card.task-unread{
  border:3px solid #267a57!important;
  border-radius:14px!important;
  box-shadow:0 0 0 1px rgba(38,122,87,.14),0 10px 26px rgba(25,71,52,.16)!important;
}
#deals .tender-card.task-unread .tender-card-accent{
  width:4px!important;
}
#deals .tender-card:not(.task-unread){
  border-width:1px!important;
}
#deals .tender-list col.col-actions{width:250px!important}
#deals .tender-list-actions{
  display:grid!important;
  grid-template-columns:minmax(112px,1fr) 34px 34px 34px!important;
  gap:6px!important;
  align-items:center!important;
  min-width:232px!important;
}
#deals .tender-list-actions .small-btn{
  min-width:0!important;
  width:auto!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
#deals .tender-list-actions .small-btn:not(:first-child){
  width:34px!important;
  min-width:34px!important;
  padding-left:0!important;
  padding-right:0!important;
}
#deals .tender-list th:last-child,
#deals .tender-list td:last-child{min-width:250px!important}

/* GRANT OS 1.6.65.2 — compact centered login tab and black unread task border */
.login-card .auth-tabs{
  grid-template-columns:1fr!important;
  padding:0!important;
  gap:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.login-card .auth-tab{
  width:100%!important;
  min-height:48px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.login-card .auth-tab[hidden]{display:none!important}

#deals .tender-card.task-unread{
  border-color:#111!important;
  box-shadow:0 0 0 1px rgba(0,0,0,.16),0 10px 26px rgba(0,0,0,.14)!important;
}
#deals .task-unread-row>td{
  border-top-color:#111!important;
  border-bottom-color:#111!important;
}
#deals .task-unread-row>td:first-child{border-left-color:#111!important}
#deals .task-unread-row>td:last-child{border-right-color:#111!important}

/* GRANT OS 1.6.65.7 — единые корректные скругления без выступающих фоновых углов */
.page > .toolbar,
.page > .panel,
.page > .card,
.page > .table-wrap,
.page > .stats,
.page .content-panel,
.page .filter-panel,
.page .summary-panel {
  border-radius:18px!important;
  background-clip:padding-box!important;
  isolation:isolate;
}

.page > .toolbar,
.page > .table-wrap,
.page > .panel,
.page > .card {
  overflow:hidden;
}

/* Панели с выпадающими пользовательскими меню не обрезают их содержимое. */
.page > .toolbar:has(.grant-label-dropdown),
.page > .toolbar:has(.grant-org-search),
.page > .toolbar:has(.filter-bar) {
  overflow:visible;
}

.page > .toolbar::before,
.page > .toolbar::after,
.page > .panel::before,
.page > .panel::after,
.page > .card::before,
.page > .card::after,
.page > .table-wrap::before,
.page > .table-wrap::after {
  border-radius:inherit!important;
  background-clip:padding-box!important;
}

.stats,
.stats .mini,
.metric-card,
.summary-card,
.dashboard-card,
.filter-bar,
.search,
.data-table,
.tender-list-wrap,
.action-history-wrap {
  background-clip:padding-box!important;
}

.stats .mini,
.metric-card,
.summary-card,
.dashboard-card {
  border-radius:14px!important;
  overflow:hidden;
}

.table-wrap,
.tender-list-wrap,
.action-history-wrap {
  border-radius:16px!important;
  overflow:hidden;
}

.table-wrap table,
.tender-list-wrap table,
.action-history-wrap table {
  border-radius:inherit!important;
}

/* Убирает квадратные углы первой и последней строк таблиц внутри скруглённой оболочки. */
.table-wrap thead tr:first-child th:first-child,
.tender-list-wrap thead tr:first-child th:first-child,
.action-history-wrap thead tr:first-child th:first-child {border-top-left-radius:15px!important}
.table-wrap thead tr:first-child th:last-child,
.tender-list-wrap thead tr:first-child th:last-child,
.action-history-wrap thead tr:first-child th:last-child {border-top-right-radius:15px!important}
.table-wrap tbody tr:last-child td:first-child,
.tender-list-wrap tbody tr:last-child td:first-child,
.action-history-wrap tbody tr:last-child td:first-child {border-bottom-left-radius:15px!important}
.table-wrap tbody tr:last-child td:last-child,
.tender-list-wrap tbody tr:last-child td:last-child,
.action-history-wrap tbody tr:last-child td:last-child {border-bottom-right-radius:15px!important}

@media(max-width:1050px){
  .page > .toolbar{overflow:visible}
}

/* GRANT OS 1.6.65.8 — корректное размещение текста и кнопок в шапках страниц */
.page > .toolbar {
  box-sizing:border-box!important;
  min-height:64px!important;
  padding:11px 14px!important;
  align-items:center!important;
}

.page > .toolbar > .muted,
.page > .toolbar > div.muted {
  min-width:0;
  margin:0!important;
  padding:0!important;
  line-height:1.4!important;
  align-self:center!important;
  overflow-wrap:anywhere;
}

.page > .toolbar > .btn,
.page > .toolbar > button.btn {
  flex:0 0 auto;
  align-self:center!important;
  margin:0!important;
  min-height:40px;
  box-sizing:border-box!important;
  white-space:nowrap;
}

/* Панели поиска сохраняют компактную высоту, но больше не касаются краёв. */
.page > .toolbar:has(> .search),
.page > .toolbar:has(> .filter-bar),
.page > .toolbar:has(> select) {
  min-height:62px!important;
}

/* Специализированная панель воронки остаётся компактной и не ломает сетку. */
#deals.page > .toolbar {
  min-height:64px!important;
  padding:11px 14px!important;
}

@media(max-width:700px){
  .page > .toolbar{
    min-height:0!important;
    padding:10px!important;
  }
  .page > .toolbar > .btn,
  .page > .toolbar > button.btn{
    max-width:100%;
  }
}

/* GRANT OS 1.6.65.11 — исправление вкладки «Воронка задач → Список» */
#deals,
#deals #tenderBoard,
#deals #tenderBoard.list-view {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

#deals #tenderBoard.list-view {
  display:block!important;
  overflow:visible!important;
  padding:0!important;
}

#deals #tenderBoard.list-view .tender-list-wrap {
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  max-height:calc(100vh - 300px)!important;
  overflow-x:auto!important;
  overflow-y:auto!important;
  scrollbar-gutter:stable!important;
  -webkit-overflow-scrolling:touch;
}

#deals #tenderBoard.list-view table.tender-list {
  width:100%!important;
  min-width:1320px!important;
  table-layout:fixed!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}

#deals #tenderBoard.list-view .tender-list th,
#deals #tenderBoard.list-view .tender-list td {
  box-sizing:border-box!important;
  padding:11px 10px!important;
  vertical-align:top!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:none!important;
}

#deals #tenderBoard.list-view .tender-list th {
  white-space:nowrap!important;
}

#deals #tenderBoard.list-view .tender-list-title,
#deals #tenderBoard.list-view .tender-list td,
#deals #tenderBoard.list-view .tender-list td * {
  min-width:0;
  max-width:100%;
}

#deals #tenderBoard.list-view .tender-list-title {
  line-height:1.35!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}

#deals #tenderBoard.list-view .tender-list col.col-title{width:220px!important}
#deals #tenderBoard.list-view .tender-list col.col-client{width:155px!important}
#deals #tenderBoard.list-view .tender-list col.col-stage{width:145px!important}
#deals #tenderBoard.list-view .tender-list col.col-status{width:110px!important}
#deals #tenderBoard.list-view .tender-list col.col-priority{width:105px!important}
#deals #tenderBoard.list-view .tender-list col.col-owner{width:140px!important}
#deals #tenderBoard.list-view .tender-list col.col-amount{width:105px!important}
#deals #tenderBoard.list-view .tender-list col.col-deadline{width:130px!important}
#deals #tenderBoard.list-view .tender-list col.col-platform{width:165px!important}
#deals #tenderBoard.list-view .tender-list col.col-actions{width:230px!important}

#deals #tenderBoard.list-view .tender-list th:last-child,
#deals #tenderBoard.list-view .tender-list td:last-child {
  min-width:230px!important;
}

#deals #tenderBoard.list-view .tender-list-actions {
  display:grid!important;
  grid-template-columns:minmax(112px,1fr) 34px 34px 34px!important;
  gap:6px!important;
  min-width:210px!important;
  align-items:center!important;
  white-space:nowrap!important;
}

#deals #tenderBoard.list-view .tender-list-actions .small-btn {
  min-width:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

@media (min-width:1550px) {
  #deals #tenderBoard.list-view table.tender-list {
    min-width:100%!important;
  }
}

/* GRANT OS 1.6.65.13 — поручения: несколько ответственных и выделение изменений */
.assignment-assignee-picker{display:grid;gap:7px;max-height:220px;overflow:auto;padding:8px;border:1px solid var(--vh-line);border-radius:12px;background:var(--vh-surface-2)}
.assignment-assignee-option{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:8px 10px;border:1px solid var(--vh-line);border-radius:10px;background:var(--vh-surface);cursor:pointer}
.assignment-assignee-option:hover{border-color:var(--vh-accent)}
.assignment-assignee-option input{width:17px;height:17px;margin:0}
.assignment-assignee-option small{color:var(--vh-muted)}
.assignment-card.task-unread{border-color:var(--vh-accent)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--vh-accent) 28%,transparent),var(--vh-shadow)!important}
.assignment-card.task-unread .assignment-card-priority{width:7px}
.assignment-card.task-unread h4{font-weight:900!important;text-shadow:0 0 10px rgba(53,243,255,.22)}

/* GRANT OS 1.6.65.14 — выпадающий список ответственных */
.assignment-assignee-dropdown{position:relative;border:1px solid var(--vh-line);border-radius:12px;background:var(--vh-input);min-width:0}
.assignment-assignee-dropdown>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;padding:10px 12px;cursor:pointer;color:var(--vh-text)}
.assignment-assignee-dropdown>summary::-webkit-details-marker{display:none}
.assignment-assignee-caption{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.assignment-assignee-arrow{font-size:18px;transition:transform .18s ease}
.assignment-assignee-dropdown[open] .assignment-assignee-arrow{transform:rotate(180deg)}
.assignment-assignee-dropdown .assignment-assignee-picker{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 6px);max-height:250px;box-shadow:var(--vh-shadow)}

/* GRANT OS 1.6.65.21 — поручения в общей палитре «Воронки задач» */
#plan .assignment-kanban{
  gap:14px!important;
  align-items:stretch!important;
}
#plan .assignment-column{
  min-height:430px!important;
  padding:12px!important;
  background:#f5f1e8!important;
  color:#253e34!important;
  border:1px solid #d1c9bc!important;
  border-radius:16px!important;
  box-shadow:0 8px 22px rgba(37,55,47,.07)!important;
}
#plan .assignment-column.drag-over{
  background:#edf2ea!important;
  border-color:#7f9a8c!important;
  box-shadow:0 0 0 3px rgba(47,138,104,.14),0 8px 22px rgba(37,55,47,.08)!important;
}
#plan .assignment-column-head{
  margin:-12px -12px 12px!important;
  padding:13px 14px 11px!important;
  background:#efe9de!important;
  color:#253e34!important;
  border-bottom:1px solid #d7cec0!important;
  border-radius:16px 16px 0 0!important;
}
#plan .assignment-column-head h3{
  color:#253e34!important;
  font-weight:800!important;
}
#plan .assignment-count{
  min-width:28px!important;
  background:#fffaf1!important;
  color:#28473a!important;
  border:1px solid #c6bbaa!important;
  box-shadow:0 2px 7px rgba(37,55,47,.06)!important;
}
#plan .assignment-card{
  padding:13px 13px 13px 16px!important;
  background:#fffaf1!important;
  color:#243a31!important;
  border:1px solid #cfc5b6!important;
  border-radius:14px!important;
  box-shadow:0 7px 18px rgba(37,55,47,.08)!important;
}
#plan .assignment-card:hover{
  border-color:#aebeb4!important;
  box-shadow:0 10px 24px rgba(37,55,47,.12)!important;
  transform:translateY(-1px);
}
#plan .assignment-card h4{
  color:#243a31!important;
}
#plan .assignment-card-meta{
  color:#5d6d65!important;
}
#plan .assignment-card-description{
  color:#354b42!important;
  border-top-color:#ddd3c5!important;
}
#plan .assignment-empty{
  background:rgba(255,250,241,.48)!important;
  color:#718078!important;
  border-color:#c9c0b2!important;
}
#plan .assignment-card-actions .small-btn{
  background:#f7f4ec!important;
  color:#28473a!important;
  border-color:#b9c6be!important;
  box-shadow:none!important;
}
#plan .assignment-card-actions .small-btn:hover{
  background:#e7efe9!important;
  border-color:#7f9a8c!important;
}
#plan .assignment-card-actions .small-btn.primary{
  background:#f7f4ec!important;
  color:#28473a!important;
  border-color:#b9c6be!important;
}
#plan .assignment-card-actions .small-btn.danger{
  background:#f5eee8!important;
  color:#8b493c!important;
  border-color:#cfb8ae!important;
}
#plan .assignment-card-actions .small-btn.danger:hover{
  background:#eadbd3!important;
  border-color:#b98f82!important;
}
#plan .assignment-card.task-unread{
  border-color:#2f8a68!important;
  box-shadow:0 0 0 2px rgba(47,138,104,.18),0 9px 22px rgba(37,55,47,.12)!important;
}
#plan .assignment-card.task-unread h4{
  color:#173f30!important;
  text-shadow:none!important;
}

body.night #plan .assignment-column,body[data-theme="dark"] #plan .assignment-column{
  background:#514e49!important;
  color:#fff9ef!important;
  border-color:#7b746b!important;
  box-shadow:0 10px 26px rgba(20,18,16,.26)!important;
}
body.night #plan .assignment-column.drag-over,body[data-theme="dark"] #plan .assignment-column.drag-over{
  background:#5a5751!important;
  border-color:#b9905d!important;
  box-shadow:0 0 0 3px rgba(217,158,83,.18),0 10px 26px rgba(20,18,16,.28)!important;
}
body.night #plan .assignment-column-head,body[data-theme="dark"] #plan .assignment-column-head{
  background:#625d56!important;
  color:#fff9ef!important;
  border-bottom-color:#80776e!important;
}
body.night #plan .assignment-column-head h3,body[data-theme="dark"] #plan .assignment-column-head h3{color:#fff9ef!important}
body.night #plan .assignment-count,body[data-theme="dark"] #plan .assignment-count{
  background:#6b655e!important;color:#fffaf2!important;border-color:#8e857b!important;
}
body.night #plan .assignment-card,body[data-theme="dark"] #plan .assignment-card{
  background:linear-gradient(145deg,#6a645d,#57524c)!important;
  color:#fffaf1!important;
  border-color:#8d8479!important;
  box-shadow:0 8px 20px rgba(20,18,16,.24)!important;
}
body.night #plan .assignment-card h4,body[data-theme="dark"] #plan .assignment-card h4{color:#fffaf1!important}
body.night #plan .assignment-card-meta,body[data-theme="dark"] #plan .assignment-card-meta{color:#ddd4c8!important}
body.night #plan .assignment-card-description,body[data-theme="dark"] #plan .assignment-card-description{color:#f1e8dc!important;border-top-color:#827a71!important}
body.night #plan .assignment-empty,body[data-theme="dark"] #plan .assignment-empty{background:#57534e!important;color:#d7cec2!important;border-color:#80786f!important}
body.night #plan .assignment-card-actions .small-btn,body[data-theme="dark"] #plan .assignment-card-actions .small-btn{
  background:#6b655e!important;color:#fffaf2!important;border-color:#8e857b!important;
}
body.night #plan .assignment-card-actions .small-btn:hover,body[data-theme="dark"] #plan .assignment-card-actions .small-btn:hover{background:#777068!important;border-color:#a0968b!important}
body.night #plan .assignment-card-actions .small-btn.danger,body[data-theme="dark"] #plan .assignment-card-actions .small-btn.danger{background:#715c54!important;color:#fff2ec!important;border-color:#9a776c!important}

/* GRANT OS 1.6.65.22 — «Воронка задач» в палитре поручений */
#deals .tender-board{
  gap:14px!important;
  align-items:stretch!important;
}
#deals .tender-column{
  min-height:430px!important;
  padding:12px!important;
  background:#f5f1e8!important;
  color:#253e34!important;
  border:1px solid #d1c9bc!important;
  border-radius:16px!important;
  box-shadow:0 8px 22px rgba(37,55,47,.07)!important;
}
#deals .tender-column-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin:-12px -12px 12px!important;
  padding:13px 14px 11px!important;
  background:#efe9de!important;
  color:#253e34!important;
  border-bottom:1px solid #d7cec0!important;
  border-radius:16px 16px 0 0!important;
}
#deals .tender-column-head h3{
  margin:0!important;
  color:#253e34!important;
  font-size:15px!important;
  line-height:1.3!important;
  font-weight:800!important;
}
#deals .tender-count{
  flex:0 0 auto!important;
  min-width:28px!important;
  padding:4px 8px!important;
  background:#fffaf1!important;
  color:#28473a!important;
  border:1px solid #c6bbaa!important;
  border-radius:999px!important;
  text-align:center!important;
  font-size:12px!important;
  font-weight:800!important;
  box-shadow:0 2px 7px rgba(37,55,47,.06)!important;
}
#deals .tender-card{
  background:#fffaf1!important;
  color:#243a31!important;
  border:1px solid #cfc5b6!important;
  border-radius:14px!important;
  box-shadow:0 7px 18px rgba(37,55,47,.08)!important;
}
#deals .tender-card:hover{
  border-color:#aebeb4!important;
  box-shadow:0 10px 24px rgba(37,55,47,.12)!important;
  transform:translateY(-1px);
}
#deals .tender-card h4{color:#243a31!important}
#deals .tender-card .muted,#deals .tender-meta{color:#5d6d65!important}

body.night #deals .tender-column,body[data-theme="dark"] #deals .tender-column{
  background:#514e49!important;
  color:#fff9ef!important;
  border-color:#7b746b!important;
  box-shadow:0 10px 26px rgba(20,18,16,.26)!important;
}
body.night #deals .tender-column-head,body[data-theme="dark"] #deals .tender-column-head{
  background:#625d56!important;
  color:#fff9ef!important;
  border-bottom-color:#80776e!important;
}
body.night #deals .tender-column-head h3,body[data-theme="dark"] #deals .tender-column-head h3{color:#fff9ef!important}
body.night #deals .tender-count,body[data-theme="dark"] #deals .tender-count{
  background:#6b655e!important;
  color:#fffaf2!important;
  border-color:#8e857b!important;
}
body.night #deals .tender-card,body[data-theme="dark"] #deals .tender-card{
  background:linear-gradient(145deg,#6a645d,#57524c)!important;
  color:#fffaf1!important;
  border-color:#8d8479!important;
  box-shadow:0 8px 20px rgba(20,18,16,.24)!important;
}
body.night #deals .tender-card h4,body[data-theme="dark"] #deals .tender-card h4{color:#fffaf1!important}
body.night #deals .tender-card .muted,body.night #deals .tender-meta,
body[data-theme="dark"] #deals .tender-card .muted,body[data-theme="dark"] #deals .tender-meta{color:#ddd4c8!important}

/* GRANT OS 1.6.65.23 — обновлённые поручения как в «Воронке задач», чёрная обводка */
#plan .assignment-card.task-unread{
  border:3px solid #111!important;
  border-radius:14px!important;
  box-shadow:0 0 0 1px rgba(0,0,0,.16),0 10px 26px rgba(0,0,0,.14)!important;
}
#plan .assignment-card.task-unread .assignment-card-priority{
  width:4px!important;
}
#plan .assignment-card.task-unread h4{
  font-weight:900!important;
  color:inherit!important;
  text-shadow:none!important;
}
body.night #plan .assignment-card.task-unread,
body[data-theme="dark"] #plan .assignment-card.task-unread{
  border-color:#050505!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.08),0 12px 28px rgba(0,0,0,.38)!important;
}

/* GRANT OS 1.6.65.28 — исправленная прокрутка меню и форма задач */
.sidebar{
  box-sizing:border-box!important;
  height:100vh!important;
  max-height:100vh!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
.sidebar>.brand{flex:0 0 auto!important}
#desktopNav{
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:8px!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  padding:0 7px 8px 0!important;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.42) rgba(255,255,255,.06);
}
#desktopNav>.nav-btn{
  display:flex!important;
  flex:0 0 auto!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#desktopNav::-webkit-scrollbar{width:8px}
#desktopNav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.38);border-radius:10px;border:2px solid transparent;background-clip:padding-box}
#desktopNav::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.58);background-clip:padding-box}
#desktopNav::-webkit-scrollbar-track{background:rgba(255,255,255,.05);border-radius:10px}
.side-bottom{flex:0 0 auto!important;margin-top:8px}.tender-list .col-executor{width:150px}

/* 1.6.65.33 — полная панель фильтров воронки задач */
#deals .toolbar{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:10px!important}
#deals .toolbar>#dealAdvancedFilters{order:20;flex:1 0 100%;width:100%}
.grant-deal-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:10px 12px;padding:12px;border:1px solid var(--line,rgba(0,0,0,.16));border-radius:14px;background:var(--panel-soft,rgba(255,255,255,.24));box-sizing:border-box}
.grant-deal-filter-grid label{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;color:var(--muted,#63706a)}
.grant-deal-filter-grid input,.grant-deal-filter-grid select{width:100%;min-width:0;height:40px;box-sizing:border-box;margin:0!important}
body.day .grant-deal-filter-grid{background:rgba(255,255,255,.32);border-color:rgba(25,31,28,.18)}
@media(max-width:1200px){.grant-deal-filter-grid{grid-template-columns:repeat(2,minmax(180px,1fr))}}
@media(max-width:650px){.grant-deal-filter-grid{grid-template-columns:1fr}}

/* GRANT OS 1.6.65.49 — фильтр «Воронки задач» в едином стиле с «Поручениями» */
#deals .toolbar > .grant-task-filter-tabs{
  display:flex!important;
  flex:0 1 auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:10px!important;
  margin:0!important;
  order:-1!important;
}
#deals .grant-task-filter-tabs > select{
  width:auto!important;
  min-width:190px!important;
  max-width:300px!important;
  flex:0 1 240px!important;
  margin:0!important;
}
#deals .grant-task-filter-tabs > #dealPersonFilter{
  min-width:230px!important;
  max-width:360px!important;
  flex-basis:300px!important;
}
#deals .grant-task-filter-tabs > #dealPersonFilter[hidden]{display:none!important}
@media(max-width:760px){
  #deals .toolbar > .grant-task-filter-tabs{
    flex:1 1 100%!important;
    width:100%!important;
    flex-wrap:wrap!important;
  }
  #deals .grant-task-filter-tabs > select{
    flex:1 1 210px!important;
    max-width:none!important;
  }
}

/* GRANT OS 1.6.65.57 — notification preferences */
.grant-notification-settings-backdrop{position:fixed;inset:0;z-index:2147483500;background:rgba(18,28,23,.42);display:grid;place-items:center;padding:18px}.grant-notification-settings{width:min(520px,100%);background:#fffdf9;border:1px solid #d5ccbe;border-radius:20px;box-shadow:0 30px 100px rgba(20,30,25,.35);overflow:hidden;color:#17352a}.grant-notification-settings-head{display:flex;justify-content:space-between;gap:15px;padding:18px;border-bottom:1px solid #ded6ca}.grant-notification-settings-head b{display:block;font-size:18px}.grant-notification-settings-head small{display:block;color:#65756d;margin-top:4px}.grant-notification-settings-head button{border:0;background:transparent;font-size:26px;cursor:pointer;color:#52645c}.grant-notification-settings-list{padding:8px 18px}.grant-notification-settings-list label{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 2px;border-bottom:1px solid #eee8df;font-weight:600}.grant-notification-settings-list input{width:20px;height:20px;accent-color:#356b52}.grant-notification-settings-actions{display:flex;justify-content:flex-end;gap:8px;padding:16px 18px;background:#f3eee5}


/* GRANT OS 1.6.65.62 — unified notification controls */
.grant-notification-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.grant-notification-action-btn{
  box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  height:34px!important;min-width:118px!important;padding:0 14px!important;margin:0!important;
  border:1px solid #b9c2bb!important;border-radius:9px!important;background:#fffdf8!important;color:#24483a!important;
  font:600 13px/1 "Segoe UI",Arial,sans-serif!important;white-space:nowrap!important;cursor:pointer!important;
  box-shadow:0 2px 8px rgba(31,53,45,.08)!important;transition:background .15s ease,border-color .15s ease,transform .15s ease!important;
}
.grant-notification-action-btn:hover{background:#e8f0eb!important;border-color:#789487!important}
.grant-notification-action-btn:active{transform:translateY(1px)!important}
.grant-notification-action-btn.primary{background:#356b52!important;border-color:#356b52!important;color:#fff!important}
.grant-notification-action-btn.primary:hover{background:#2c5d46!important;border-color:#2c5d46!important}
.grant-notification-settings-actions .grant-notification-action-btn{min-width:120px!important}
body.night .grant-notification-action-btn,body[data-theme="dark"] .grant-notification-action-btn{
  background:#eef3ef!important;color:#19382b!important;border-color:#93aa9e!important
}
body.night .grant-notification-action-btn.primary,body[data-theme="dark"] .grant-notification-action-btn.primary{
  background:#d1a33a!important;color:#17271f!important;border-color:#d1a33a!important
}
@media(max-width:620px){.grant-notification-head-actions{gap:6px}.grant-notification-action-btn{min-width:0!important;padding:0 10px!important;font-size:12px!important}}

/* GRANT OS 1.6.65.62 — CRM multi-activity & client documents */
.grant-client-activities{display:grid;gap:10px}.grant-activity-head,.grant-client-doc-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:space-between}.grant-activity-list{display:flex;gap:8px;flex-wrap:wrap}.grant-activity-chip{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid var(--line,#d7dde5);border-radius:10px;background:var(--card,#fff);cursor:pointer}.grant-activity-chip input{width:auto}.grant-activity-custom{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px}.grant-client-doc-toolbar select,.grant-client-doc-toolbar input{min-width:180px}.grant-client-doc-list{display:grid;gap:8px;margin-top:10px}.grant-client-doc-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line,#d7dde5);border-radius:10px;background:var(--card,#fff)}.grant-client-doc-row small{display:block;margin-top:3px;opacity:.7}.grant-client-doc-row>div:last-child{display:flex;gap:6px;flex-wrap:wrap}@media(max-width:760px){.grant-activity-custom{grid-template-columns:1fr}.grant-client-doc-row{align-items:flex-start;flex-direction:column}}


/* =====================================================================
   GRANT OS 1.6.65.73 — GLOBAL UI GEOMETRY CONTRACT
   Единые скругления, безопасная прокрутка модальных окон и защита текста.
   ===================================================================== */
:root{
  --grant-radius-control:12px;
  --grant-radius-small:10px;
  --grant-radius-panel:18px;
  --grant-radius-modal:24px;
}

/* Все основные интерактивные элементы используют одну геометрию. */
.btn,.small-btn,.icon-btn,.search,
input:not([type="checkbox"]):not([type="radio"]),select,textarea,
.subtab,.file-tab,.sheet-tab,.auth-tab,
.theme-toggle,.theme-toggle button,.deal-view-switch,
.grant-notification-action-btn,.grant-task-filter-tabs>select,
.grant-client-doc-toolbar select,.grant-client-doc-toolbar input{
  box-sizing:border-box!important;
  border-radius:var(--grant-radius-control)!important;
  max-width:100%;
}

/* Контейнеры/панели — единый мягкий радиус, без квадратных углов. */
.card,.panel,.modal-panel,.profile-card,.table-wrap,.tender-column,
.tender-list-wrap,.grant-notification-settings,.grant-deal-filter-grid,
.permission-panel,.ai-status,.ai-model-list,.ai-history-item,
.workday-block,.workday-metric,.workday-task{
  box-sizing:border-box!important;
  border-radius:var(--grant-radius-panel)!important;
}

/* Кнопки закрытия тоже являются частью единой системы. */
.icon-btn,.modal .icon-btn,.modal-box .icon-btn{
  border-radius:var(--grant-radius-control)!important;
  flex:0 0 auto;
}

/*
   ВАЖНО: прокрутка стандартной формы идёт внутри формы, а не по внешней
   оболочке modal-box. Поэтому scrollbar больше не срезает правые углы.
*/
#modal.modal{padding:18px!important;overflow:hidden!important;}
#modal .modal-box{
  width:min(1040px,calc(100vw - 36px))!important;
  max-height:calc(100vh - 36px)!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  border-radius:var(--grant-radius-modal)!important;
  isolation:isolate;
}
#modal .modal-head{
  flex:0 0 auto;
  margin:0!important;
  padding:20px 20px 14px!important;
  background:inherit;
  position:relative;
  z-index:2;
}
#modal #modalForm{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 20px 20px!important;
  box-sizing:border-box!important;
  scrollbar-gutter:stable;
  overscroll-behavior:contain;
}
#modal #modalForm::-webkit-scrollbar{width:10px}
#modal #modalForm::-webkit-scrollbar-track{background:transparent;margin:6px 0 10px}
#modal #modalForm::-webkit-scrollbar-thumb{
  background:rgba(83,101,90,.42);
  border-radius:999px;
  border:3px solid transparent;
  background-clip:padding-box;
}

/* Формы и flex/grid не дают тексту и контролам вылезать за границы. */
.form-grid,.client-card-grid,.field,.toolbar,.card-head,.record-actions,
.grant-client-doc-row,.grant-client-doc-toolbar,.grant-activity-custom,
.workday-grid,.workday-list,.workday-task,.workday-task-meta,
.permission-toolbar,.permission-groups,.grant-task-filter-tabs{
  min-width:0!important;
}
.form-grid>* ,.client-card-grid>* ,.toolbar>* ,.card-head>* ,.record-actions>*{
  min-width:0;
}
.field input,.field select,.field textarea,
#modal input,#modal select,#modal textarea{
  min-width:0!important;
  width:100%;
}

/* Текст не накладывается и не выходит за карточки/кнопки. */
.card,.panel,.modal-box,.modal-panel,.profile-card,
.btn,.small-btn,.subtab,.file-tab,.sheet-tab,.nav-btn,
.tender-card,.workday-task,.grant-client-doc-row,
.grant-notification-settings,label,.muted{
  overflow-wrap:anywhere;
  word-break:normal;
}
.btn,.small-btn,.subtab,.file-tab,.sheet-tab{
  line-height:1.25!important;
}

/* Вспомогательные панели и меню не получают квадратных внутренних углов. */
.grant-notification-settings-head{border-radius:var(--grant-radius-panel) var(--grant-radius-panel) 0 0}
.grant-notification-settings-actions{border-radius:0 0 var(--grant-radius-panel) var(--grant-radius-panel)}
.grant-client-doc-row,.grant-activity-chip,.equipment-row,.lifecycle-item,
.ai-step,.board,.board-slot,.board-device,.row,.mini{
  border-radius:var(--grant-radius-control)!important;
}

/* Мобильный/узкий экран: никаких наложений кнопок и полей. */
@media(max-width:760px){
  #modal.modal{padding:10px!important}
  #modal .modal-box{width:calc(100vw - 20px)!important;max-height:calc(100vh - 20px)!important;border-radius:18px!important}
  #modal .modal-head{padding:16px 14px 12px!important}
  #modal #modalForm{padding:0 14px 16px!important}
  .toolbar,.record-actions,.grant-client-doc-toolbar{align-items:stretch}
  .toolbar>.btn,.record-actions>.btn,.record-actions>.small-btn{max-width:100%}
}


/* =====================================================================
   GRANT OS 1.6.65.75 — FINANCE UI THEME NORMALIZATION
   Финансы используют общую палитру проекта. Запрещены отдельные
   тёмно-зелёные панели/меню. Поля дат и месяца показывают значение целиком.
   ===================================================================== */
#finance .grant7-kpi,
#finance .grant7-panel{
  background:var(--grant-surface,#f7f2e9)!important;
  color:var(--grant-text,#302e2a)!important;
  border:1px solid var(--grant-line,#c9bdac)!important;
  box-shadow:0 8px 22px rgba(67,57,45,.08)!important;
  border-radius:var(--grant-radius-panel,18px)!important;
}
#finance .grant7-kpi span,
#finance .grant7-title,
#finance .grant7-planview,
#finance .grant7-debt,
#finance .grant7-panel .muted{
  color:inherit!important;
}
#finance .grant7-panel .table-wrap{
  background:transparent!important;
  border-color:var(--grant-line,#c9bdac)!important;
}
#finance .grant7-panel table thead th{
  background:var(--grant-surface-2,#ebe2d4)!important;
  color:var(--grant-text,#302e2a)!important;
}
#finance .grant7-panel table tbody td{
  background:var(--grant-surface,#f7f2e9)!important;
  color:var(--grant-text,#302e2a)!important;
}
#finance .grant7-filter input[type="date"],
#finance input[type="date"],
#finance input[type="month"]{
  min-width:158px!important;
  width:auto!important;
  flex:0 0 158px!important;
  padding-left:12px!important;
  padding-right:38px!important;
  white-space:nowrap!important;
  overflow:visible!important;
}
#finance #financePlanPeriod{
  min-width:170px!important;
  flex-basis:170px!important;
}
#finance .grant7-filter label{
  min-width:max-content!important;
}
#finance .grant7-planline,
#finance .grant7-debtline{
  align-items:center!important;
}
#finance .grant7-planline .btn,
#finance .grant7-debtline .btn{
  min-height:42px;
  white-space:normal;
}
#finance .grant7-kpi,
#finance .grant7-panel,
#finance .grant7-panel *{
  max-width:100%;
  box-sizing:border-box;
}
#finance .grant7-kpi b,
#finance .grant7-planview b,
#finance .grant7-debt b,
#finance td,
#finance th{
  overflow-wrap:anywhere;
}
body.night #finance .grant7-kpi,
body.night #finance .grant7-panel,
body[data-theme="dark"] #finance .grant7-kpi,
body[data-theme="dark"] #finance .grant7-panel{
  background:var(--grant-surface,#504d48)!important;
  color:var(--grant-text,#fff9ef)!important;
  border-color:var(--grant-line,#797269)!important;
}
body.night #finance .grant7-panel table thead th,
body[data-theme="dark"] #finance .grant7-panel table thead th{
  background:var(--grant-surface-2,#5e5a54)!important;
  color:var(--grant-text,#fff9ef)!important;
}
body.night #finance .grant7-panel table tbody td,
body[data-theme="dark"] #finance .grant7-panel table tbody td{
  background:var(--grant-surface,#504d48)!important;
  color:var(--grant-text,#fff9ef)!important;
}
@media(max-width:760px){
  #finance .grant7-filter label{
    width:100%;
    min-width:0!important;
  }
  #finance .grant7-filter input[type="date"]{
    width:100%!important;
    min-width:0!important;
    flex:1 1 auto!important;
  }
  #finance #financePlanPeriod,
  #finance input[type="month"]{
    width:100%!important;
    min-width:0!important;
    flex:1 1 100%!important;
  }
}


/* =====================================================================
   GRANT OS 1.6.65.77 — GLOBAL CONTROL SIZE & TEXT ALIGNMENT STANDARD
   Единый стандарт размеров для кнопок, вкладок, полей и селектов.
   ===================================================================== */
:root{
  --grant-control-height:44px;
  --grant-control-padding-x:14px;
  --grant-control-font-size:14px;
}

/* Все обычные однострочные элементы управления имеют одинаковую высоту. */
button,.btn,.small-btn,.nav-btn,.subtab,.file-tab,.sheet-tab,.auth-tab,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,
.theme-toggle,.theme-toggle button,.deal-view-switch,
.grant-notification-action-btn,.grant-task-filter-tabs>select{
  min-height:var(--grant-control-height)!important;
  height:var(--grant-control-height)!important;
  box-sizing:border-box!important;
  border-radius:var(--grant-radius-control,12px)!important;
  font-size:var(--grant-control-font-size)!important;
  line-height:1.2!important;
}

button,.btn,.small-btn,.nav-btn,.subtab,.file-tab,.sheet-tab,.auth-tab,
.theme-toggle button,.grant-notification-action-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px;
  padding:0 var(--grant-control-padding-x)!important;
  text-align:center!important;
  vertical-align:middle!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select{
  padding-top:0!important;
  padding-bottom:0!important;
  padding-left:var(--grant-control-padding-x)!important;
  padding-right:var(--grant-control-padding-x)!important;
  vertical-align:middle!important;
}
select{padding-right:36px!important;}
input[type="date"],input[type="month"],input[type="datetime-local"]{padding-right:40px!important;}

/* Многострочные поля сохраняют собственную высоту, но используют тот же ритм. */
textarea{
  min-height:96px!important;
  height:auto!important;
  padding:12px var(--grant-control-padding-x)!important;
  line-height:1.45!important;
  box-sizing:border-box!important;
  border-radius:var(--grant-radius-control,12px)!important;
}

/* Иконки остаются квадратными, но соответствуют стандартной высоте. */
.icon-btn,.btn-icon,.small-btn.icon-only,
button[aria-label="Закрыть"],button[title="Закрыть"]{
  width:var(--grant-control-height)!important;
  min-width:var(--grant-control-height)!important;
  max-width:var(--grant-control-height)!important;
  padding:0!important;
  flex:0 0 var(--grant-control-height)!important;
}

/* Внутри форм и панелей элементы выравниваются по единой линии. */
.toolbar,.record-actions,.grant7-actions,.grant7-filter,.grant7-planline,.grant7-debtline,
.grant-client-doc-toolbar,.grant-upload-line,.permission-toolbar,.workday-actions{
  align-items:center!important;
}
.toolbar>* ,.record-actions>* ,.grant7-actions>* ,.grant7-filter>* ,.grant7-planline>* ,.grant7-debtline>*{
  box-sizing:border-box!important;
}

/* Финансы: одинаковая высота всех управляющих элементов и читаемые даты. */
#finance .grant7-filter input[type="date"],
#finance .grant7-planline input,
#finance .grant7-debtline input,
#finance #financePlanPeriod,
#finance .grant7-planline button,
#finance .grant7-debtline button{
  min-height:var(--grant-control-height)!important;
  height:var(--grant-control-height)!important;
}
#finance .grant7-filter input[type="date"]{
  min-width:170px!important;
  width:170px!important;
  flex:0 0 170px!important;
}
#finance #financePlanPeriod{
  min-width:190px!important;
  width:190px!important;
  flex:0 0 190px!important;
}

/* Текст никогда не прилипает к краю и не накладывается. */
button,.btn,.small-btn,.nav-btn,.subtab,.file-tab,.sheet-tab,.auth-tab,
input,select,textarea,.card,.panel,.modal-box,.modal-panel,.table-wrap,td,th,label{
  text-rendering:optimizeLegibility;
}
input,select,textarea{overflow:hidden;text-overflow:ellipsis;}
td,th,.card,.panel,.modal-box,.modal-panel{overflow-wrap:anywhere;word-break:normal;}

/* Узкие экраны: высота стандарта сохраняется, ширина становится адаптивной. */
@media(max-width:760px){
  :root{--grant-control-height:44px;--grant-control-padding-x:12px;}
  #finance .grant7-filter input[type="date"],#finance #financePlanPeriod{
    width:100%!important;min-width:0!important;flex:1 1 100%!important;
  }
  button,.btn,.small-btn{max-width:100%;}
}


/* =====================================================================
   GRANT OS 1.6.65.77 — SIDEBAR MENU ALIGNMENT RESTORE
   Глобальный стандарт контролов не должен менять геометрию левого меню.
   ===================================================================== */
#desktopNav>.nav-btn{
  height:auto!important;
  min-height:50px!important;
  width:100%!important;
  justify-content:flex-start!important;
  align-items:center!important;
  text-align:left!important;
  padding:9px 12px!important;
  gap:10px!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.25!important;
}
#desktopNav>.nav-btn>b{
  flex:0 0 31px!important;
  width:31px!important;
  min-width:31px!important;
  height:31px!important;
  margin:0!important;
}
#desktopNav>.nav-btn>span{
  flex:1 1 auto!important;
  min-width:0!important;
  margin:0!important;
  text-align:left!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#desktopNav>.nav-btn.active{padding-left:12px!important;}
@media(max-width:1050px){
  #desktopNav>.nav-btn{justify-content:center!important;padding:9px!important;}
  #desktopNav>.nav-btn>span{display:none!important;}
}


/* GRANT OS 1.6.65.77 — Security overview uses the shared UI system. */
.grant-security-card{margin-top:14px!important;}
.grant-security-status{display:flex;flex-wrap:wrap;gap:8px 14px;margin:12px 0 14px;padding:12px 14px;border:1px solid var(--vh-line,var(--line));border-radius:var(--grant-radius-panel,16px);background:var(--vh-surface-2,var(--panel-soft,#f7f5ef));}
.grant-security-status>span{min-width:170px;line-height:1.45;overflow-wrap:anywhere;}
#grantSecurityOverview .table-wrap{border-radius:var(--grant-radius-panel,16px)!important;overflow:auto!important;}
#grantSecurityOverview .status{white-space:nowrap;}

/* =====================================================================
   GRANT OS 2.0.2 — DASHBOARD TEXT CONTRAST FIX
   Служебные подписи главной страницы должны оставаться читаемыми.
   ===================================================================== */
#dashboard .card-head .pill{
  color:#566760!important;
  background:#f2f4ef!important;
  border:1px solid #d4dbd5!important;
  opacity:1!important;
  font-weight:700!important;
  line-height:1.2!important;
  text-shadow:none!important;
}
#dashboard .muted,
#dashboard .card .muted,
#dashboard .mini small{
  color:#65756e!important;
  opacity:1!important;
  text-shadow:none!important;
}
#dashboard .delta{
  color:#2f7545!important;
  opacity:1!important;
  font-weight:700!important;
}
.topbar #pageSubtitle,
#pageSubtitle{
  color:#66766f!important;
  opacity:1!important;
  font-weight:500!important;
  text-shadow:none!important;
}
#dashboard .card-head h3,
#dashboard .card-head .pill,
#dashboard .muted,
#pageSubtitle{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.night #dashboard .card-head .pill,
body[data-theme="dark"] #dashboard .card-head .pill{
  color:#d6e1db!important;
  background:#1b3027!important;
  border-color:#3a5549!important;
}
body.night #dashboard .muted,
body.night #dashboard .card .muted,
body.night #dashboard .mini small,
body[data-theme="dark"] #dashboard .muted,
body[data-theme="dark"] #dashboard .card .muted,
body[data-theme="dark"] #dashboard .mini small,
body.night #pageSubtitle,
body[data-theme="dark"] #pageSubtitle{
  color:#b8c7bf!important;
}
body.night #dashboard .delta,
body[data-theme="dark"] #dashboard .delta{
  color:#89c99e!important;
}


/* =====================================================================
   GRANT OS 2.0.2 — NOTIFICATION LAYOUT FIX
   Notification rows and live toasts are content cards, not fixed-height
   toolbar buttons. These rules intentionally override the global button
   geometry contract so long titles/messages wrap inside their containers.
   ===================================================================== */
.grant-notification-item{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:start!important;
  justify-content:stretch!important;
  width:100%!important;
  height:auto!important;
  min-height:72px!important;
  padding:13px 15px!important;
  gap:9px!important;
  text-align:left!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.35!important;
}
.grant-notification-item>span:last-child{
  display:block!important;
  min-width:0!important;
  width:100%!important;
  overflow:hidden!important;
  text-align:left!important;
}
.grant-notification-item b,
.grant-notification-item small,
.grant-notification-item time{
  display:block!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-overflow:clip!important;
  text-align:left!important;
}
.grant-notification-item b{line-height:1.3!important;}
.grant-notification-item small{line-height:1.4!important;margin-top:5px!important;}
.grant-notification-item time{line-height:1.3!important;margin-top:5px!important;}

.grant-notification-toasts{
  right:24px!important;
  bottom:116px!important;
  width:min(410px,calc(100vw - 48px))!important;
  max-height:calc(100vh - 148px)!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
.grant-notification-toast{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) 24px!important;
  align-items:start!important;
  justify-content:stretch!important;
  width:100%!important;
  height:auto!important;
  min-height:72px!important;
  padding:14px!important;
  gap:10px!important;
  box-sizing:border-box!important;
  text-align:left!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  line-height:1.35!important;
}
.grant-notification-toast>span:nth-child(2){
  display:block!important;
  min-width:0!important;
  width:100%!important;
  overflow:hidden!important;
  text-align:left!important;
}
.grant-notification-toast b,
.grant-notification-toast small{
  display:block!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-overflow:clip!important;
  text-align:left!important;
}
.grant-notification-toast b{line-height:1.3!important;}
.grant-notification-toast small{line-height:1.4!important;margin-top:5px!important;}
.grant-notification-toast-close{
  display:block!important;
  width:24px!important;
  min-width:24px!important;
  height:28px!important;
  align-self:start!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:visible!important;
}

/* Keep the header usable on narrow browser windows. */
@media(max-width:520px){
  .grant-notification-panel{
    right:12px!important;
    bottom:86px!important;
    width:calc(100vw - 24px)!important;
  }
  .grant-notification-head{
    align-items:flex-start!important;
    flex-wrap:wrap!important;
  }
  .grant-notification-head>div:first-child{min-width:0!important;flex:1 1 120px!important;}
  .grant-notification-head-actions{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr 44px!important;gap:6px!important;}
  .grant-notification-action-btn{min-width:0!important;width:100%!important;padding:0 8px!important;}
  .grant-notification-toasts{
    right:12px!important;
    bottom:88px!important;
    width:calc(100vw - 24px)!important;
    max-height:calc(100vh - 112px)!important;
  }
}


/* =====================================================================
   GRANT OS 2.0.3 — ROUNDED COMPONENT CLIPPING FIX
   Remove the visual parent plate behind the workday controls and do not
   clip rounded toast shadows against a rectangular toast-host boundary.
   ===================================================================== */
.workday-head .toolbar{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  border-radius:0!important;
  overflow:visible!important;
}
.workday-head .toolbar::before,
.workday-head .toolbar::after{
  content:none!important;
  display:none!important;
}
.workday-head .toolbar>select,
.workday-head .toolbar>input[type="date"],
.workday-head .toolbar>.btn{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  background-clip:padding-box!important;
  border-radius:14px!important;
}
.grant-notification-toasts{
  overflow:visible!important;
}
.grant-notification-toast{
  position:relative!important;
  isolation:isolate!important;
  border-radius:16px!important;
  background-clip:padding-box!important;
  clip-path:inset(0 round 16px)!important;
}
.grant-notification-toast:focus,
.grant-notification-toast:focus-visible{
  outline:none!important;
}
/* 2.0.3 final polish: rounded shadow follows the toast silhouette. */
.grant-notification-toast{
  box-shadow:none!important;
  filter:drop-shadow(0 14px 22px rgba(27,39,32,.22));
}
.workday-head .toolbar>select:focus,
.workday-head .toolbar>input[type="date"]:focus,
.workday-head .toolbar>.btn:focus,
.workday-head .toolbar>select:focus-visible,
.workday-head .toolbar>input[type="date"]:focus-visible,
.workday-head .toolbar>.btn:focus-visible{
  outline:none!important;
  box-shadow:0 0 0 2px rgba(47,117,69,.18)!important;
}


/* =====================================================================
   GRANT OS 2.0.6 — FINAL ROUNDING + WORKDAY PLANNER FIX
   Eliminate native/control shadow plates that can appear as square ears
   around rounded controls and notification toasts on Windows Chromium.
   ===================================================================== */
.workday-head .toolbar,
.workday-head .toolbar>*{
  box-shadow:none!important;
  filter:none!important;
}
.workday-head .toolbar>select,
.workday-head .toolbar>input[type="date"],
.workday-head .toolbar>.btn{
  border-radius:14px!important;
  background-clip:padding-box!important;
  outline:0!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
}
.workday-head .toolbar>select{
  -webkit-appearance:none!important;
  appearance:none!important;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%)!important;
  background-position:calc(100% - 16px) 19px,calc(100% - 11px) 19px!important;
  background-size:5px 5px,5px 5px!important;
  background-repeat:no-repeat!important;
  padding-right:34px!important;
}
.workday-head .toolbar>input[type="date"]{
  -webkit-appearance:none!important;
  appearance:none!important;
}
.workday-head .toolbar>input[type="date"]::-webkit-calendar-picker-indicator{
  opacity:.8;
  cursor:pointer;
}
.workday-head .toolbar>select:focus,
.workday-head .toolbar>input[type="date"]:focus,
.workday-head .toolbar>.btn:focus,
.workday-head .toolbar>select:focus-visible,
.workday-head .toolbar>input[type="date"]:focus-visible,
.workday-head .toolbar>.btn:focus-visible{
  outline:0!important;
  box-shadow:inset 0 0 0 2px rgba(47,117,69,.24)!important;
}
.grant-notification-toast{
  border-radius:16px!important;
  overflow:hidden!important;
  clip-path:none!important;
  filter:none!important;
  box-shadow:none!important;
  background-clip:padding-box!important;
}
.grant-notification-toast::before,
.grant-notification-toast::after{
  content:none!important;
  display:none!important;
}
.wd-task-kind{
  display:inline-flex;
  align-items:center;
  margin-right:8px;
  padding:2px 7px;
  border:1px solid var(--vh-line);
  border-radius:999px;
  color:var(--vh-muted);
  font-size:11px;
  font-weight:700;
  vertical-align:middle;
}

/* Stronger than the global day/night .toolbar skin: the workday control row
   is intentionally only a layout container, never a visible rectangular plate. */
#workday .workday-head .toolbar,
body:not(.night) #workday .workday-head .toolbar,
body.night #workday .workday-head .toolbar,
body[data-theme="light"] #workday .workday-head .toolbar,
body[data-theme="dark"] #workday .workday-head .toolbar{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  filter:none!important;
  border-radius:0!important;
  overflow:visible!important;
  padding:0!important;
}


/* =====================================================================
   GRANT OS 2.0.6 — UNIFIED VISUAL CLEANUP
   One component source for spacing, neutral surfaces and rounded geometry.
   ===================================================================== */

/* Direct workday blocks are siblings, so they need an explicit layout gap. */
#workday.page.active{
  display:flex!important;
  flex-direction:column!important;
  gap:18px!important;
}
#workday.page.active > .card,
#workday.page.active > .workday-grid{margin:0!important;}
#workday .workday-grid{gap:18px!important;}
#scheduler > .grid,
#marketing > .grid{gap:18px!important;row-gap:18px!important;}
.page > .toolbar{margin-bottom:18px!important;}

/* A toolbar inside a card is a layout row, never a second rectangular card. */
.page .card .toolbar,
.page .card-head .toolbar,
.page .panel .toolbar{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  filter:none!important;
  padding:0!important;
  min-height:0!important;
  border-radius:0!important;
  overflow:visible!important;
}
.page .card .toolbar::before,
.page .card .toolbar::after,
.page .card-head .toolbar::before,
.page .card-head .toolbar::after,
.page .panel .toolbar::before,
.page .panel .toolbar::after{
  content:none!important;
  display:none!important;
}

/* Historical decorative pseudo layers caused square ears around rounded cards. */
.page .card::before,
.page .card::after,
.page .panel::before,
.page .panel::after,
.page .table-wrap::before,
.page .table-wrap::after{
  content:none!important;
  display:none!important;
}
.page .card,
.page .panel,
.page .table-wrap{
  background-clip:padding-box!important;
  border-radius:18px!important;
}

/* Search suggestions use the standard warm GRANT surface, never dark green/navy. */
.grant-org-suggestions{
  background:var(--grant-surface,#f6f1e7)!important;
  color:var(--grant-text,#302e2a)!important;
  border:1px solid var(--grant-line,#c9bdac)!important;
  border-radius:14px!important;
  box-shadow:0 12px 28px rgba(61,51,39,.16)!important;
  overflow:hidden!important;
}
.grant-org-option{
  background:transparent!important;
  color:var(--grant-text,#302e2a)!important;
  border-bottom:1px solid var(--grant-line,#c9bdac)!important;
  white-space:normal!important;
}
.grant-org-option:last-child{border-bottom:0!important;}
.grant-org-option:hover,
.grant-org-option:focus{
  background:var(--grant-surface-2,#ebe2d4)!important;
  color:var(--grant-text,#302e2a)!important;
  outline:0!important;
}

/* Technical/diagnostic text follows the same neutral palette as the rest of UI. */
.ai-log,
pre.ai-log,
#aiDiagnostics,
#aiLog,
#schLog{
  background:var(--grant-surface-2,#ebe2d4)!important;
  color:var(--grant-text,#302e2a)!important;
  border:1px solid var(--grant-line,#c9bdac)!important;
  border-radius:14px!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
body.night .ai-log,
body[data-theme="dark"] .ai-log,
body.night .grant-org-suggestions,
body[data-theme="dark"] .grant-org-suggestions{
  background:#c7c0b5!important;
  color:#302b25!important;
  border-color:#958d81!important;
}
body.night .grant-org-option,
body[data-theme="dark"] .grant-org-option{color:#302b25!important;border-bottom-color:#958d81!important;}
body.night .grant-org-option:hover,
body[data-theme="dark"] .grant-org-option:hover{background:#b7afa3!important;color:#302b25!important;}

/* Marketing cards use the same warm neutral surface; no cold blue mini-panels. */
#marketing .mini{
  background:var(--grant-surface-2,#ebe2d4)!important;
  color:var(--grant-text,#302e2a)!important;
  border-color:var(--grant-line,#c9bdac)!important;
  box-shadow:none!important;
}
#marketing .mini small{color:var(--grant-muted,#706b63)!important;opacity:1!important;}
#marketing .marketing-payback{
  display:inline-flex!important;
  align-items:center!important;
  min-height:30px!important;
  padding:5px 10px!important;
  background:#e4ebe6!important;
  color:#315443!important;
  border:1px solid #b9c9c0!important;
  border-radius:999px!important;
  font-weight:800!important;
  opacity:1!important;
  white-space:nowrap!important;
  text-shadow:none!important;
}
body.night #marketing .marketing-payback,
body[data-theme="dark"] #marketing .marketing-payback{
  background:#b7c2ba!important;
  color:#26372f!important;
  border-color:#83978c!important;
}

/* Disabled pills/buttons must not create a pale rectangular plate around themselves. */
.card-head .toolbar > :disabled,
.card .toolbar > :disabled{
  box-shadow:none!important;
  filter:none!important;
}

@media(max-width:700px){
  #workday.page.active{gap:14px!important;}
  #scheduler > .grid,#marketing > .grid{gap:14px!important;row-gap:14px!important;}
  .page > .toolbar{margin-bottom:14px!important;}
}


/* =====================================================================
   GRANT OS 2.0.6 — AI SETTINGS SPACING + EXPLICIT CHECKBOX ROWS
   Fixes missing gaps and ambiguous full-width checkbox labels.
   ===================================================================== */

/* Standard checkboxes must never inherit the 100% width of text inputs. */
#aistudio input[type="checkbox"],
#scheduler .toolbar > label input[type="checkbox"],
#sourceModal input[type="checkbox"]{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  min-height:18px!important;
  max-width:18px!important;
  max-height:18px!important;
  padding:0!important;
  margin:0!important;
  flex:0 0 18px!important;
  vertical-align:middle!important;
}

/* AI provider checkbox rows: checkbox stays next to its own description. */
#aistudio .field > label:has(> input[type="checkbox"]){
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-height:32px!important;
  line-height:1.35!important;
  cursor:pointer!important;
}

/* Clear gap between the last field and action buttons in every AI card. */
#aistudio .card > .toolbar{
  margin-top:16px!important;
  margin-bottom:0!important;
}
#aistudio .card > .toolbar + .ai-status,
#aistudio .card > .toolbar + [id$="Status"]{
  margin-top:14px!important;
}

/* Telegram toggles are explicit settings, not detached check marks. */
#aistudio .ai-toggle-group{
  display:grid!important;
  gap:0!important;
  margin:14px 0 16px!important;
  border-top:1px solid var(--vh-line)!important;
  border-bottom:1px solid var(--vh-line)!important;
}
#aistudio .ai-toggle-row{
  display:flex!important;
  align-items:flex-start!important;
  gap:12px!important;
  padding:12px 0!important;
  cursor:pointer!important;
  color:var(--vh-text)!important;
}
#aistudio .ai-toggle-row + .ai-toggle-row{
  border-top:1px solid var(--vh-line)!important;
}
#aistudio .ai-toggle-row input[type="checkbox"]{
  margin-top:2px!important;
}
#aistudio .ai-toggle-row > span{
  display:grid!important;
  gap:3px!important;
  min-width:0!important;
}
#aistudio .ai-toggle-row b{
  color:var(--vh-text)!important;
  font-size:13px!important;
  line-height:1.35!important;
}
#aistudio .ai-toggle-row small{
  display:block!important;
  color:var(--vh-muted)!important;
  font-size:12px!important;
  line-height:1.4!important;
  opacity:1!important;
}

/* Source editor: fields and the Add button must not touch each other. */
#sourceModal .form-grid{
  margin-top:14px!important;
  margin-bottom:14px!important;
}
#sourceModal .form-grid + .btn{
  margin-top:0!important;
}

/* Scheduler checkbox row follows the same readable geometry. */
#scheduler .toolbar > label:has(> input[type="checkbox"]){
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-height:32px!important;
  color:var(--vh-text)!important;
  cursor:pointer!important;
}

@media(max-width:700px){
  #aistudio .ai-toggle-row{padding:11px 0!important;}
  #aistudio .card > .toolbar{margin-top:14px!important;}
}


/* =====================================================================
   GRANT OS 2.0.12 — DASHBOARD LONG DEAL TITLES
   Длинные названия в «Ближайших дедлайнах» и «Проблемных сделках»
   всегда показываются полностью внутри карточки.
   ===================================================================== */
#dashboardDeadlines .dashboard-deal-row,
#dashboardRiskDeals .dashboard-deal-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:start!important;
  gap:7px!important;
  min-height:0!important;
  height:auto!important;
}
#dashboardDeadlines .dashboard-deal-row .row-main,
#dashboardRiskDeals .dashboard-deal-row .row-main{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
#dashboardDeadlines .dashboard-deal-row .row-main b,
#dashboardRiskDeals .dashboard-deal-row .row-main b{
  display:block!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.35!important;
  max-width:100%!important;
}
#dashboardDeadlines .dashboard-deal-row .row-main .muted,
#dashboardRiskDeals .dashboard-deal-row .row-main .muted{
  display:block!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  line-height:1.3!important;
  margin-top:3px!important;
}
#dashboardDeadlines .dashboard-deal-row>.status,
#dashboardRiskDeals .dashboard-deal-row>.status{
  justify-self:start!important;
  max-width:100%!important;
  white-space:normal!important;
  line-height:1.2!important;
}


/* =====================================================================
   GRANT OS 2.0.12 — DASHBOARD NEW CLIENTS LONG NAMES
   Полное отображение длинных ФИО/названий в «Новые клиенты».
   Статус переносится ниже и больше не отнимает ширину у имени клиента.
   ===================================================================== */
#dashboardNewClients .dashboard-client-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:start!important;
  gap:7px!important;
  min-height:0!important;
  height:auto!important;
  width:100%!important;
  max-width:100%!important;
}
#dashboardNewClients .dashboard-client-row .row-main{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
#dashboardNewClients .dashboard-client-row .row-main b{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.35!important;
}
#dashboardNewClients .dashboard-client-row .row-main .muted{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin-top:3px!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  line-height:1.3!important;
}
#dashboardNewClients .dashboard-client-row>.status{
  justify-self:start!important;
  max-width:100%!important;
  white-space:normal!important;
  line-height:1.2!important;
}


/* =====================================================================
   Grant-Tenter OS 2.0.14 — SERVER BACKUPS MODAL
   Unified readable palette, rounded geometry and compact backup cards.
   ===================================================================== */
#backupModal.profile-modal{
  background:rgba(13,26,20,.64)!important;
  backdrop-filter:blur(8px)!important;
  padding:18px!important;
}
#backupModal .profile-card{
  width:min(760px,calc(100vw - 36px))!important;
  max-height:calc(100vh - 36px)!important;
  overflow:auto!important;
  display:block!important;
  padding:24px!important;
  background:#f3eee5!important;
  color:#233d32!important;
  border:1px solid #bdc9c1!important;
  border-radius:20px!important;
  box-shadow:0 24px 70px rgba(8,25,17,.32)!important;
}
#backupModal .profile-header{
  position:static!important;
  margin:0 0 18px!important;
  padding:0 0 16px!important;
  background:transparent!important;
  border-bottom:1px solid #cbd4ce!important;
  align-items:center!important;
}
#backupModal .profile-header h2{
  color:#173d2d!important;
  font-size:21px!important;
  line-height:1.25!important;
}
#backupModal .muted{
  color:#65746c!important;
  opacity:1!important;
}
#backupModal .field{gap:7px!important;min-width:0!important;}
#backupModal .field>label{
  color:#435c50!important;
  font-weight:700!important;
  line-height:1.35!important;
}
#backupModal .field>label:has(>input[type="checkbox"]){
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  min-height:34px!important;
  cursor:pointer!important;
}
#backupModal input[type="checkbox"]{
  width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;
  padding:0!important;margin:0!important;accent-color:#2e8a67!important;
}
#backupModal input[type="number"],
#backupModal input[type="text"],
#backupModal input:not([type]){
  width:100%!important;
  min-height:44px!important;
  padding:10px 13px!important;
  background:#fffdf9!important;
  color:#283b33!important;
  border:1px solid #b9c6bf!important;
  border-radius:12px!important;
  box-shadow:none!important;
}
#backupModal input::placeholder{color:#8a938e!important;opacity:1!important;}
#backupModal .form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:13px!important;
  margin-top:8px!important;
}
#backupModal>.profile-card>.toolbar,
#backupModal .profile-card>.toolbar{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  margin:16px 0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
#backupModal .btn,#backupModal .small-btn{
  min-height:42px!important;
  padding:9px 14px!important;
  border-radius:12px!important;
  font-weight:800!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
#backupModal .btn.primary{
  background:#2f8c69!important;
  color:#fff!important;
  border:1px solid #267557!important;
}
#backupModal .btn.primary:hover{background:#267a5c!important;border-color:#1f694d!important;}
#backupModal .btn:not(.primary),#backupModal .small-btn{
  background:#fffdf8!important;
  color:#2d493d!important;
  border:1px solid #b7c4bd!important;
}
#backupModal .btn:not(.primary):hover,#backupModal .small-btn:hover{
  background:#e7eee9!important;
  color:#173d2d!important;
  border-color:#7d998b!important;
}
#backupList{
  display:grid!important;
  gap:12px!important;
  margin-top:6px!important;
}
#backupList .server-backup-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px 16px!important;
  align-items:center!important;
  margin:0!important;
  padding:14px 15px!important;
  background:#fffdf9!important;
  color:#293f35!important;
  border:1px solid #c3cec8!important;
  border-radius:16px!important;
  box-shadow:0 5px 16px rgba(30,56,43,.06)!important;
}
#backupList .server-backup-main{min-width:0!important;}
#backupList .server-backup-name{
  display:block!important;
  color:#20382e!important;
  font-size:13px!important;
  line-height:1.35!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#backupList .server-backup-meta{
  margin-top:3px!important;
  color:#69776f!important;
  font-size:12px!important;
}
#backupList .server-backup-actions{
  display:flex!important;
  gap:8px!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}
#backupList .server-backup-actions .btn{min-height:38px!important;padding:7px 11px!important;}
@media(max-width:700px){
  #backupModal .profile-card{padding:18px!important;width:min(100%,calc(100vw - 20px))!important;}
  #backupModal .form-grid,#backupModal .profile-card>.toolbar{grid-template-columns:1fr!important;}
  #backupList .server-backup-card{grid-template-columns:1fr!important;}
  #backupList .server-backup-actions{justify-content:flex-start!important;}
}


/* GRANT OS 2.0.14 finance plan/fact readability fix */
#finance .grant7-planview{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px!important;
  margin-top:14px;
}
#finance .grant7-planmetric{
  min-width:0;
  padding:14px 16px;
  border:1px solid var(--grant-line,#c9bdac);
  border-radius:14px;
  background:rgba(255,255,255,.28);
}
#finance .grant7-planmetric>span{
  display:block;
  margin-bottom:10px;
  font-size:13px;
  font-weight:800;
}
#finance .grant7-planrows{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
#finance .grant7-planrows small{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
  font-size:12px;
}
#finance .grant7-planrows em{
  color:var(--grant-muted,#756f67);
  font-style:normal;
  font-size:11px;
}
#finance .grant7-planrows b{
  font-size:16px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#finance .grant7-planprogress{
  height:5px;
  margin:12px 0 7px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(72,93,80,.14);
}
#finance .grant7-planprogress i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:currentColor;
  opacity:.65;
}
#finance .grant7-planfoot{
  display:block;
  color:var(--grant-muted,#756f67)!important;
  font-size:11px;
}
#finance .grant7-resultdelta{
  margin:12px 0 7px;
  min-height:20px;
  font-size:12px;
  font-weight:750;
}
#finance .grant7-resultdelta.positive{color:#2f7a50!important}
#finance .grant7-resultdelta.negative{color:#a6473f!important}
body.night #finance .grant7-planmetric,
body[data-theme="dark"] #finance .grant7-planmetric{
  background:rgba(255,255,255,.035);
}
@media(max-width:980px){
  #finance .grant7-planview{grid-template-columns:1fr!important}
}


/* GRANT OS 2.1.0 — финансы сделки */
.grant-finance-deal-title{margin-top:8px;padding-top:14px;border-top:1px solid var(--vh-line)}
.grant-finance-deal-title label{font-size:16px;font-weight:800;color:var(--vh-text)}
.grant-finance-deal-hint{padding:10px 12px;border:1px solid var(--vh-line);border-radius:12px;background:var(--vh-surface-2);color:var(--vh-muted)}
.grant-finance-deals{margin-top:16px}.grant-finance-deals .data-table td{vertical-align:top}


/* GRANT OS 2.1.2 — reliable vertical navigation scrolling on small-height screens */
.sidebar{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;}
.sidebar>.brand{flex:0 0 auto!important;}
#desktopNav{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:14px!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important;}
.side-bottom{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;flex:0 0 auto!important;margin-top:8px!important;}
@supports not (height:100dvh){.sidebar{height:100vh!important;max-height:100vh!important;}}


/* GRANT OS 2.1.5 — Leads workspace aligned with task funnel */
.lead-main-card{padding:0!important;overflow:hidden}
.lead-head{padding:18px 20px 8px;margin:0;border-bottom:0}
.lead-work-toolbar{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:12px 16px;margin:0 12px 12px;border:1px solid var(--line);
  border-radius:18px;background:rgba(255,255,255,.58)
}
.lead-filter-select,.lead-search,.lead-date-filter input{
  min-height:42px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.72);
  padding:0 13px;color:var(--text);font:inherit
}
.lead-filter-select{min-width:150px}
.lead-search{min-width:260px;flex:1 1 280px}
.lead-date-filter{display:flex;align-items:center;gap:6px;color:var(--muted);white-space:nowrap}
.lead-date-filter input{width:142px}
.lead-toolbar-spacer{flex:1 1 20px}
.lead-view-switch{display:flex;gap:0}
.lead-view-switch .btn{border-radius:0}
.lead-view-switch .btn:first-child{border-radius:13px 0 0 13px}
.lead-view-switch .btn:last-child{border-radius:0 13px 13px 0}
.lead-view-switch .btn.active{background:#fff;color:#20372f;box-shadow:0 4px 12px rgba(34,52,46,.10)}
.lead-summary{display:flex;gap:18px;padding:0 20px 12px;color:var(--muted);font-size:13px}
.leads-board{display:grid;grid-template-columns:repeat(7,minmax(230px,1fr));gap:12px;overflow-x:auto;padding:0 16px 18px;align-items:start}
.lead-column{min-width:230px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.43);overflow:hidden}
.lead-column-head{display:flex;align-items:center;justify-content:space-between;padding:12px 13px;border-bottom:1px solid var(--line)}
.lead-column-head h4{margin:0;font-size:14px}
.lead-column-body{padding:10px;display:grid;gap:10px;min-height:90px}
.lead-card{border:1px solid var(--line);border-radius:14px;background:#fff;padding:12px;box-shadow:0 4px 12px rgba(35,49,42,.05)}
.lead-card h4{margin:4px 0 8px}
.lead-card-date{font-size:11px;color:var(--muted)}
.lead-contact{display:grid;gap:3px;font-size:12px;color:#394b44}
.lead-message{margin:9px 0;padding:8px;border-radius:10px;background:rgba(240,244,239,.75);font-size:12px;line-height:1.4;max-height:82px;overflow:auto}
.lead-card select,.lead-table select{width:100%;min-height:36px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 8px}
.lead-count{display:inline-grid;place-items:center;min-width:26px;height:26px;border-radius:99px;background:#e7eee8;font-size:12px;font-weight:700}
.lead-table-wrap{overflow:auto;padding:0 16px 18px}
.lead-table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid var(--line);border-radius:15px;overflow:hidden;background:#fff}
.lead-table th,.lead-table td{padding:12px 13px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.lead-table th{font-size:12px;color:var(--muted);background:#f7f8f5;white-space:nowrap}
.lead-table tr:last-child td{border-bottom:0}
.lead-list-message{max-width:420px;white-space:normal;line-height:1.4}
.lead-status-pill{display:inline-block;padding:7px 10px;border-radius:999px;background:#eef3ee;font-size:12px;font-weight:700}
.lead-sync-error{margin:12px 16px 18px;padding:14px;border:1px solid #ecc8c3;border-radius:14px;background:#fff0ed;color:#87443b}
@media(max-width:1100px){
  .lead-work-toolbar{align-items:stretch}
  .lead-toolbar-spacer{display:none}
  .lead-date-filter{width:100%;flex-wrap:wrap}
  .lead-search{min-width:200px}
}


/* GRANT OS 2.1.5 — Leads compact layout aligned with task funnel */
#leads,
#leads .card,
#leads #leadWorkspace{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
#leads .lead-main-card{
  overflow:hidden!important;
}
#leads #leadWorkspace{
  width:100%;
  overflow:hidden;
}

/* Toolbar: two compact filter groups + actions, never outside the card */
#leads .lead-work-toolbar{
  display:grid!important;
  grid-template-columns:minmax(340px,1fr) auto auto;
  align-items:center;
  gap:10px 12px;
  margin:0 12px 12px!important;
  padding:10px 12px!important;
  width:calc(100% - 24px)!important;
  max-width:calc(100% - 24px)!important;
  box-sizing:border-box;
  overflow:hidden;
}
#leads .lead-filter-main{
  display:grid;
  grid-template-columns:150px minmax(180px,1fr) 170px;
  gap:8px;
  min-width:0;
}
#leads .lead-filter-dates{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  white-space:nowrap;
}
#leads .lead-toolbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-width:0;
  white-space:nowrap;
}
#leads .lead-filter-select,
#leads .lead-search,
#leads .lead-filter-dates input{
  min-width:0!important;
  max-width:100%;
  height:42px;
  box-sizing:border-box;
}
#leads .lead-filter-dates input{
  width:132px!important;
}
#leads .lead-date-label{
  color:var(--muted);
  font-size:13px;
}
#leads .lead-view-switch{
  display:flex!important;
  flex:0 0 auto;
}
#leads .lead-view-switch .btn,
#leads .lead-refresh-btn,
#leads .lead-reset-btn{
  height:42px;
  min-height:42px;
  padding:0 13px;
  white-space:nowrap;
}

/* Summary stays inside */
#leads .lead-summary{
  padding:0 16px 10px!important;
  flex-wrap:wrap;
}

/* Kanban: the board itself scrolls, never the whole page/card */
#leads .leads-board{
  display:grid!important;
  grid-auto-flow:column;
  grid-auto-columns:minmax(218px,1fr);
  grid-template-columns:none!important;
  gap:10px!important;
  width:100%;
  max-width:100%;
  padding:0 14px 16px!important;
  box-sizing:border-box;
  overflow-x:auto!important;
  overflow-y:hidden;
  overscroll-behavior-x:contain;
}
#leads .lead-column{
  width:100%;
  min-width:218px!important;
  max-width:280px;
  box-sizing:border-box;
  overflow:hidden!important;
}
#leads .lead-column-head{
  min-width:0;
  gap:8px;
}
#leads .lead-column-head h4{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.25;
}
#leads .lead-column-body{
  min-width:0;
}
#leads .lead-card{
  min-width:0;
  max-width:100%;
  overflow:hidden;
  box-sizing:border-box;
}
#leads .lead-card h4,
#leads .lead-contact,
#leads .lead-message,
#leads .lead-card-date{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:normal;
}
#leads .lead-contact span{
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
}
#leads .lead-message{
  white-space:normal!important;
  overflow-wrap:anywhere;
  word-break:normal;
}
#leads .lead-card select{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box;
  text-overflow:ellipsis;
}

/* List: compact status column/select */
#leads .lead-table-wrap{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto!important;
  padding:0 14px 16px!important;
}
#leads .lead-table{
  width:100%!important;
  min-width:820px;
  table-layout:fixed;
}
#leads .lead-table th:nth-child(1),
#leads .lead-table td:nth-child(1){width:150px}
#leads .lead-table th:nth-child(2),
#leads .lead-table td:nth-child(2){width:140px}
#leads .lead-table th:nth-child(3),
#leads .lead-table td:nth-child(3){width:145px}
#leads .lead-table th:nth-child(4),
#leads .lead-table td:nth-child(4){width:200px}
#leads .lead-table th:nth-child(6),
#leads .lead-table td:nth-child(6){width:185px}
#leads .lead-table td{
  overflow-wrap:anywhere;
  word-break:normal;
}
#leads .lead-list-message{
  max-width:none!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
#leads .lead-status-select,
#leads .lead-table td:nth-child(6) select{
  width:170px!important;
  min-width:0!important;
  max-width:100%!important;
  height:36px;
  padding:0 28px 0 9px;
  box-sizing:border-box;
  font-size:12px;
  text-overflow:ellipsis;
}

/* Medium screens: mirror task funnel by moving actions to second row cleanly */
@media (max-width:1400px){
  #leads .lead-work-toolbar{
    grid-template-columns:minmax(320px,1fr) auto;
  }
  #leads .lead-toolbar-actions{
    grid-column:2;
    grid-row:1 / span 2;
    align-self:center;
  }
  #leads .lead-filter-main{
    grid-column:1;
  }
  #leads .lead-filter-dates{
    grid-column:1;
  }
}
@media (max-width:980px){
  #leads .lead-work-toolbar{
    grid-template-columns:1fr;
  }
  #leads .lead-filter-main{
    grid-template-columns:140px minmax(170px,1fr);
  }
  #leads .lead-status-filter{
    grid-column:1 / -1;
  }
  #leads .lead-filter-dates{
    grid-column:1;
    flex-wrap:wrap;
  }
  #leads .lead-toolbar-actions{
    grid-column:1;
    grid-row:auto;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}
@media (max-width:650px){
  #leads .lead-filter-main{
    grid-template-columns:1fr;
  }
  #leads .lead-filter-dates{
    display:grid;
    grid-template-columns:auto 1fr auto 1fr;
  }
  #leads .lead-filter-dates input{
    width:100%!important;
  }
  #leads .lead-reset-btn{
    grid-column:1 / -1;
  }
  #leads .lead-toolbar-actions{
    display:grid;
    grid-template-columns:1fr auto;
    width:100%;
  }
}


/* GRANT OS 2.1.5 — Leads Kanban/List switch exactly like «Воронка задач» */
#leads .lead-view-switch{
  display:inline-flex!important;
  align-items:center!important;
  padding:3px!important;
  border:1px solid #b8c5bd!important;
  border-radius:14px!important;
  background:#edf1ed!important;
  box-shadow:0 2px 8px rgba(35,58,48,.08)!important;
  flex:0 0 auto!important;
  gap:0!important;
}
#leads .lead-view-switch .btn{
  min-height:38px!important;
  height:38px!important;
  padding:8px 14px!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:#385247!important;
  font-weight:750!important;
  text-shadow:none!important;
  filter:none!important;
  box-shadow:none!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}
#leads .lead-view-switch .btn:first-child,
#leads .lead-view-switch .btn:last-child{border-radius:10px!important}
#leads .lead-view-switch .btn.active{
  background:#fffdf8!important;
  color:#173f30!important;
  box-shadow:0 2px 8px rgba(32,54,44,.12),inset 0 0 0 1px #c8d2cc!important;
}

/* GRANT OS 2.1.6 — compact finance section inside deal/task card */
.grant-finance-deal-collapse{margin-top:6px}
.grant-finance-deal-details{border:1px solid var(--border,#dfe6e1);border-radius:14px;background:var(--card,#fff);overflow:hidden}
.grant-finance-deal-details>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;font-weight:700;user-select:none}
.grant-finance-deal-details>summary::-webkit-details-marker{display:none}
.grant-finance-deal-details>summary:after{content:'▾';font-size:14px;transition:transform .15s ease}
.grant-finance-deal-details:not([open])>summary:after{transform:rotate(-90deg)}
.grant-finance-deal-details[open]>summary{border-bottom:1px solid var(--border,#dfe6e1)}
.grant-finance-deal-inner{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px}
.grant-finance-deal-inner .field.full{grid-column:1/-1}
@media(max-width:760px){.grant-finance-deal-inner{grid-template-columns:1fr}}
