/* Кабинет: боковое меню разделов слева, рабочая область справа; на телефоне меню — полоса сверху. */
.cab { background: var(--bg); }
.cab-top { position: sticky; top: 0; }
.cab-bar {
  display: flex; align-items: center; gap: 12px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.cab-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.cab-user { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.cab-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.cab-nav {
  border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px 40px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto;
}
.cab-nav .grp { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 14px 10px 6px; }
.cab-nav .grp:first-child { padding-top: 0; }
.cab-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.cab-nav a:hover { background: var(--sunk); }
.cab-nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.cab-nav .cnt { background: var(--sale); color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 1px 7px; }
.cab-nav select { margin: 0 10px 6px; }
.cab-main {
  padding-block: 22px 60px; min-width: 0; outline: none;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  max-width: 1180px;
}
@media (min-width: 861px) { .cab-main { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 860px) {
  .cab-shell { grid-template-columns: 1fr; }
  .cab-nav { position: sticky; top: 58px; z-index: 15; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .cab-nav .grp { display: none; }
  .cab-nav a { white-space: nowrap; }
  .cab-nav select { margin: 0; max-width: 180px; }
}
.pagehead { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 4px 0 0; }

/* сводки */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
a.tile-kpi:hover { border-color: var(--accent); }
.tile-kpi b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile-kpi.attn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 50px; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 14px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 110px minmax(0, 1fr) 40px; } }

/* таблицы */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
.t th, .t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.t th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--sunk); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }
.t .num { font-variant-numeric: tabular-nums; }
.t tr.prod td { background: color-mix(in srgb, var(--sunk) 45%, var(--surface)); border-top: 2px solid var(--line); }
.t input.inp { padding: 6px 8px; width: 104px; text-align: right; }
.t input.inp.saving { border-color: var(--accent); }
.t input.inp.saved { border-color: var(--ok); }
.thumb { width: 44px; flex: none; }
.thumb .ph { border-radius: 8px; }
.thumb .ph svg { width: 54%; }
.prodcell { display: flex; gap: 10px; align-items: center; min-width: 240px; }
.reason { font-size: 13px; color: var(--sale); }

/* формы */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.vrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
@media (max-width: 760px) { .vrow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vrow .rm { grid-column: 1 / -1; justify-self: start; } }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.iconbtn:hover { color: var(--sale); border-color: var(--sale); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 4; background: var(--sunk); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .first { position: absolute; left: 6px; top: 6px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 5px; }
.photo .acts { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.photo .acts button { border: 0; background: color-mix(in srgb, var(--surface) 90%, transparent); border-radius: 6px; width: 28px; height: 28px; font-weight: 800; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; aspect-ratio: 3 / 4; display: grid; place-items: center; text-align: center; padding: 10px; color: var(--muted); font-size: 13px; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ленты заданий и отправлений */
.tasks { display: flex; flex-direction: column; gap: 12px; }
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
@media (max-width: 640px) { .task { grid-template-columns: 1fr; } }
.task ul { margin: 6px 0 0; padding-left: 18px; }
.task li { margin-bottom: 2px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.codein { font-size: 28px; letter-spacing: .3em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .cab-tag, .cab-user .muted { display: none; }
}
.cab-user { min-width: 0; }
.cab-user .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
