/* Cabinet redesign, stage 1 (prototype commit 76d54cc, design folder of the repository): colour tokens, the shell (side menu, top bar, phone bar, «Ещё»),
   a few shared components and «Обзор сети». Loaded LAST. Every rule is limited to the shell elements or to the overview screen (.ov-*), so the
   sections that keep their present look are not touched; global rules here are only token values, the keyboard focus ring and the body font.
   Sizes stay in px like the rest of the site; «текст 200 %» = browser zoom (the visible width halves): see the narrow-width rules at the end. */

/* ---------- tokens: the existing names keep working, new names are added for the shell ---------- */
:root{
  --bg:#F4F6FA; --card:#FFFFFF; --text:#0B1B33; --muted:#4E5B73; --border:#E3E8F0;
  --accent:#1557FF; --accent2:#0B44D6;
  --surface-2:#F7F9FC; --surface-3:#EEF2F8; --line-2:#EDF1F6; --faint:#5E6A82;
  --accent-ink:#0B44D6; --accent-soft:#EAF0FF;
  --ok-ink:#0F7A3D; --ok-bg:#E6F5EC; --warn-ink:#9A5B00; --warn-bg:#FDF3E1; --warn-line:#F2D49B; --bad-ink:#C21F1F; --bad-bg:#FDECEC;
  --wb:#9B1FC9; --ozon:#005BFF;
  --focus-ring:0 0 0 3px rgba(21,87,255,.35);
  --sh-1:0 1px 2px rgba(11,27,51,.05), 0 1px 3px rgba(11,27,51,.05);
  --shadow:var(--sh-1);
}
:root[data-theme="dark"]{
  --bg:#0A101C; --card:#121A2B; --text:#EEF2FA; --muted:#B3BED3; --border:#25324B;
  --accent:#5B88FF; --accent2:#3A66E8;
  --surface-2:#0F1726; --surface-3:#1A2438; --line-2:#1C2840; --faint:#8F9BB3;
  --accent-ink:#86A6FF; --accent-soft:#1A2850;
  --ok-ink:#4FD18A; --ok-bg:#0F2E1E; --warn-ink:#F4B54A; --warn-bg:#33260D; --warn-line:#5C4515; --bad-ink:#FF7A7A; --bad-bg:#3A1616;
  --wb:#C46BF0; --ozon:#5C94FF;
  --focus-ring:0 0 0 3px rgba(91,136,255,.5);
  --sh-1:0 1px 2px rgba(0,0,0,.35);
  --shadow:var(--sh-1);
}
body{-webkit-font-smoothing:antialiased;}
/* one visible keyboard focus everywhere (mouse clicks show none) */
:where(button,a[href],summary,[tabindex]):focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* ---------- side menu (computer) ---------- */
:root{--side-w:248px;}   /* room for «Wildberries 12 · Ozon 3» without cutting a counter */
#sidebar{background:var(--card);border-right:1px solid var(--border);}
@media (min-width:901px){#sidebar{padding:16px 12px;}}   /* the phone sheet keeps its own padding above the home indicator */
.side-logo{padding:4px 8px 12px;}
.side-item{border-radius:10px;min-height:38px;color:var(--text);}
.side-item svg{color:var(--faint);}
.side-item:hover{background:var(--surface-3);}
.side-item.active{background:var(--accent-soft);color:var(--accent-ink);}
.side-item.active svg{color:var(--accent);}
.side-item.active::before{background:var(--accent);}
:root[data-theme="dark"] .side-item.active{background:var(--accent-soft);color:var(--accent-ink);}
:root[data-theme="dark"] .side-item.active svg{color:var(--accent-ink);}
.side-group{color:var(--faint);}
.side-item.side-cta{background:var(--accent);color:#fff;border-radius:10px;min-height:42px;box-shadow:var(--sh-1);}
.side-item.side-cta svg{color:#fff;}
.side-item.side-cta:hover{background:var(--accent2);filter:none;}
.side-item .nav-badge{font-variant-numeric:tabular-nums;}
.side-bottom{border-top:1px solid var(--border);}
.profbtn{border-radius:12px;}
/* the network of the account (only with several networks): a block of its own, the name wraps, never cut in the middle of a word */
.side-item.org-switch{border:1px solid var(--border);background:var(--surface-2);padding:8px 10px;min-height:44px;}
.side-item.org-switch b{overflow-wrap:break-word;word-break:normal;}

/* ---------- cabinet switch WB / Ozon: a calm segmented control; the marketplace colour is a dot, the count stays ---------- */
.cab-sw{background:var(--surface-3);border:1px solid var(--border);border-radius:12px;padding:3px;gap:2px;}
.cab-sw button{color:var(--muted);border-radius:9px;font-weight:600;}
.cab-sw button::before{content:"";width:8px;height:8px;border-radius:2px;flex:none;background:var(--wb);}
.cab-sw button.cab-ozon::before{background:var(--ozon);}
.cab-sw button.cab-wb.on,.cab-sw button.cab-ozon.on{background:var(--card);color:var(--text);box-shadow:var(--sh-1);}
.cab-sw button small,.cab-sw button.on small{background:var(--surface-3);border:0;color:var(--muted);font-variant-numeric:tabular-nums;}
.cab-sw button.on small{background:var(--accent-soft);color:var(--accent-ink);}
@media (forced-colors:active){.cab-sw button.on{outline:2px solid Highlight;}}

/* ---------- top bar: title, network, help, bell; it stays on top while the page scrolls ---------- */
.topbar{position:sticky;top:0;z-index:20;padding:12px 24px;min-height:60px;box-sizing:border-box;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--border);}
.topbar h1{font-size:20px;font-weight:700;letter-spacing:-.01em;line-height:1.25;}
.org-tag{background:var(--surface-3);border:1px solid var(--border);color:var(--muted);border-radius:99px;padding:2px 10px;}
.bell-btn,#menuBtn{border-radius:12px;border-color:var(--border);background:var(--card);}
.bell-btn{width:44px;height:44px;}
.bell-btn:hover{background:var(--surface-3);}
.bell-btn.active{background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent);}
.sh-button{border-radius:12px;}
main#app{padding-top:20px;}

/* the link of the «маркетплейс не указан» notice: the darker accent keeps 4.5:1 on the amber background */
.cab-warn .linkbtn{color:var(--accent-ink);}

/* ---------- side panel and small dialogs: a calm header, a title that wraps, the close button never squeezed ---------- */
#sidePanel{border-left:1px solid var(--border);box-shadow:0 12px 32px rgba(11,27,51,.14);}
#sidePanel .ph{gap:12px;align-items:flex-start;}
#sidePanel .ph #panelTitle{flex:1 1 auto;line-height:1.3;padding-top:8px;overflow-wrap:break-word;word-break:normal;hyphens:auto;}
#sidePanel .ph .iconbtn{border:1px solid var(--border);background:var(--card);color:var(--text);}
.modal-card{border-radius:16px;box-shadow:0 12px 32px rgba(11,27,51,.2);}
.modal-btns .btn{min-height:var(--ctl-h);}

/* ---------- phone: menu button, title on up to two lines (never «Зарплата и вып…»), bell, help; WB / Ozon under them ---------- */
@media (max-width:900px){
  .topbar{padding:8px max(12px,var(--sar)) 8px max(12px,var(--sal));gap:8px;min-height:56px;}   /* a phone on its side keeps the notch insets */
  .topbar h1{font-size:18px;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;word-break:normal;}   /* the whole title, on as many lines as it needs: nothing cut, the size kept */
  #menuBtn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;}
  .sh-button{min-width:44px;}
  main#app{padding:16px max(16px,var(--sar)) calc(var(--bn-h,64px) + 24px) max(16px,var(--sal));}
  #sidebar{border-right:0;box-shadow:0 12px 32px rgba(11,27,51,.2);}
  /* the bottom bar: five equal places, the active one in the accent colour, the counter on the icon */
  #bottomNav{background:var(--card);border-top:1px solid var(--border);}   /* solid: the labels keep their contrast whatever scrolls under the bar */
  #bottomNav button{color:var(--faint);border-radius:10px;}
  #bottomNav button.active{color:var(--accent);}
  :root[data-theme="dark"] #bottomNav button.active{color:var(--accent-ink);}
}
/* long cabinet labels wrap inside their button instead of being cut */
@media (max-width:400px){
  #cabTop .cab-sw button{white-space:normal;line-height:1.2;}
}
/* ---------- phone header, every section: the title has a LINE OF ITS OWN ----------
   Row 1: menu · WB / Ozon · (free space) · help · bell.   Row 2: the title, the whole width — nothing beside it can squeeze it
   («Заполнить отчёт» used to stand between the switch and the buttons and broke almost by syllables at 390 px).
   The switch that does not fit beside the buttons (large text, a very narrow window — see .big-text below) takes a line of its own.
   Up to 480 px the switch says «WB» (the full name stays in aria-label / title), so the row fits from 360 px. */
.cab-abbr{display:none;}
@media (max-width:900px){
  .topbar{flex-wrap:wrap;row-gap:6px;align-items:center;}
  .topbar #menuBtn{order:1;}
  .topbar #cabTop{order:2;display:block;flex:0 1 auto;min-width:0;margin-left:0;margin-right:auto;}
  .topbar .sh-button{order:3;margin-left:0;}
  .topbar .bell-btn{order:4;margin-left:0;}
  .topbar h1{order:5;flex:1 1 100%;min-width:0;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;word-break:normal;hyphens:manual;-webkit-hyphens:manual;}
  .topbar #cabTop .cab-sw button{min-height:38px;}
}
@media (max-width:480px){
  #cabTop .cab-full{display:none;}
  #cabTop .cab-abbr{display:inline;}
}

/* ---------- phone bar: «Чаты» in the centre, larger; the open section is marked by a line above it ----------
   Emphasis = shape and size (a pill around the icon), NOT the accent colour: the accent colour and the line on top always mean «this section is open». */
@media (max-width:900px){
  #bottomNav button{position:relative;}
  #bottomNav:not(.bn-big) button.active::after{content:"";position:absolute;top:-6px;left:50%;transform:translateX(-50%);width:32px;height:3px;border-radius:0 0 3px 3px;background:currentColor;}
  #bottomNav:not(.bn-big) .bn-chats .bn-ico{width:52px;height:28px;margin:-3px 0;border-radius:14px;align-items:center;justify-content:center;background:var(--surface-3);border:1px solid var(--border);box-sizing:border-box;color:var(--text);}
  #bottomNav:not(.bn-big) .bn-chats .bn-lbl{color:var(--text);font-weight:600;}
  #bottomNav:not(.bn-big) .bn-chats.active .bn-ico{background:var(--accent);border-color:var(--accent);color:#fff;}
  #bottomNav:not(.bn-big) .bn-chats.active .bn-lbl{color:inherit;}
  #bottomNav:not(.bn-big) .bn-chats .nav-badge{top:-8px;left:calc(100% - 14px);}
}
@media (forced-colors:active){#bottomNav button.active::after{background:Highlight;}#bottomNav .bn-chats .bn-ico{border-color:ButtonText;}}

/* ---------- «Обзор сети» (stage 1): the same content as before, in the new look ---------- */
.kpis.ov-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px;}
@media (min-width:901px){.kpis.ov-kpis{grid-template-columns:repeat(4,minmax(0,1fr));}}
.ov-kpis .kpi{display:flex;flex-direction:column;gap:6px;padding:16px;border-radius:16px;border:1px solid var(--border);background:var(--card);box-shadow:var(--sh-1);min-width:0;}
.ov-kpis .kpi .lbl{order:-1;display:flex;align-items:flex-start;gap:8px;font-size:13px;font-weight:500;color:var(--muted);line-height:1.3;overflow-wrap:break-word;word-break:normal;}
.ov-kpis .kpi .lbl svg{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--accent);}
.ov-kpis .kpi .val{font-size:26px;font-weight:700;letter-spacing:-.01em;line-height:1.15;font-variant-numeric:tabular-nums;}
.ov-kpis .kpi .muted{font-size:12.5px;line-height:1.35;}
.ov-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;}
@media (min-width:1100px){.ov-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.ov-grid>.ov-wide{grid-column:1/-1;}}
.ov-grid>.card{margin:0;padding:16px 18px;border-radius:16px;}
.ov-grid h3{font-size:15px;font-weight:600;margin:0 0 4px;}
.ov-grid .ov-sub{font-size:12.5px;color:var(--muted);margin:0 0 12px;}
.ov-grid .problist li{padding:10px 0;font-size:14px;gap:12px;align-items:flex-start;border-bottom:1px solid var(--line-2);}
.ov-grid .problist li:last-child{border-bottom:0;}
.ov-grid .problist li>span:first-child{min-width:0;overflow-wrap:break-word;word-break:normal;}
.ov-grid .problist li>.muted{flex:none;text-align:right;font-size:13px;}
.ov-grid .problist li.muted{display:block;}
/* a problem row that opens the report of that point: the whole row is the button, the same look as the text row */
.ov-grid .problist li:has(> .ov-prob){padding:0;}
.ov-prob{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;width:100%;min-height:44px;padding:10px 6px;margin:0 -6px;border:0;border-radius:8px;background:transparent;color:var(--text);font:inherit;font-size:14px;text-align:left;cursor:pointer;box-sizing:content-box;}
.ov-prob:hover{background:var(--surface-2);}
.ov-prob>span:first-child{min-width:0;overflow-wrap:break-word;color:var(--accent-ink);font-weight:500;}
.ov-prob>.muted{flex:0 1 auto;min-width:0;max-width:62%;overflow-wrap:break-word;text-align:right;font-size:13px;}   /* the two statuses of the day (2026-10-15) wrap, never widen the page */
.ov-grid .problist li.ov-more{padding:10px 0;}
.ov-grid .bars{height:170px;gap:10px;}
.ov-grid .bar-track{background:var(--surface-3);border-radius:8px;max-width:40px;}
.ov-grid .bar-fill{background:var(--accent);border-radius:8px 8px 2px 2px;}
.ov-grid .bar-val{font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;}
.ov-grid .bar-l{font-size:12px;color:var(--muted);}

/* ---------- large text (system text size ≥ 150 %, or a window ≤ 320 px = browser zoom ≈ 200 % on a phone): html.big-text, set by js/shell.js ----------
   The bottom bar has two labelled places (the first section of the role and «Все разделы»); every other section and its counter is in the sheet,
   a dot on «Все разделы» says that something there is new. The header is not pinned, so the bar and the header never cover half of the screen. */
@media (max-width:900px){
  #bottomNav.bn-big,body.tab-chats #bottomNav.bn-big{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-columns:auto;}
  #bottomNav.bn-big button{flex-direction:row;justify-content:center;align-items:center;gap:6px;min-height:48px;padding:4px 6px;}
  #bottomNav.bn-big .bn-lbl{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;word-break:normal;text-align:left;line-height:1.15;}
  #bottomNav.bn-big .bn-ico{flex:none;}
  #bottomNav .more-dot{position:absolute;top:-3px;right:-4px;width:10px;height:10px;border-radius:50%;background:var(--bad);border:2px solid var(--card);box-sizing:content-box;}
  #bottomNav .more-dot[hidden]{display:none;}
  .big-text .topbar{position:static;backdrop-filter:none;-webkit-backdrop-filter:none;flex-wrap:wrap;}
  .big-text .topbar h1{flex:1 1 100%;order:5;}
  .big-text #cabTop{flex:1 1 100%;order:6;margin-left:0;margin-right:0;}
  .big-text .topbar #menuBtn{margin-right:auto;}   /* help and bell stay at the right edge when the switch has left the row */
  .big-text #cabTop .cab-full{display:inline;} .big-text #cabTop .cab-abbr{display:none;}   /* a line of its own: room for the full name */
  .big-text #cabTop .cab-sw button{white-space:normal;min-width:0;flex:1 1 0;flex-wrap:wrap;padding:6px 4px;line-height:1.2;text-align:center;}
  .big-text #cabTop .cab-sw button::before{display:none;}   /* no room for the colour dot: the label says the marketplace */
  .big-text .kpis.ov-kpis{grid-template-columns:minmax(0,1fr);}
  .big-text .ov-grid .problist li{flex-wrap:wrap;}
  .big-text .ov-grid .problist li>.muted{text-align:left;}
  .big-text .ov-prob{flex-wrap:wrap;} .big-text .ov-prob>.muted{text-align:left;}
}

/* a low screen (a phone turned sideways, the keyboard up): the top bar scrolls away, nothing is pinned over the fields */
@media (max-height:520px){.topbar{position:static;backdrop-filter:none;-webkit-backdrop-filter:none;}}
@media (max-width:900px){.big-text .profile .pemail{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:break-word;}}   /* the whole name with large text */
