/* ============================================================
   GOUSTI — main.css
   ============================================================ */

:root {
    --bg:      #0d0d0f;
    --s1:      #16161a;
    --s2:      #1e1e23;
    --s3:      #2a2a30;
    --border:  #26262b;
    --border2: #38383f;
    --text:    #e8e8ea;
    --muted:   #8a8a92;
    --muted2:  #5f5f66;
    --white:   #ffffff;
    --green:   #7ee0b7;
    --red:     #f08c96;
    --yellow:  #d6b478;
    --blue:    #b0b4bb;
    --purple:  #b0b4bb;
    --purple2: #8f959e;
    --purple-soft: rgba(176, 180, 187, .14);
    --sidebar-w: 232px;
    --topbar-h: 64px;
    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;
    --shadow: 0 10px 28px rgba(0,0,0,.4);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Unbounded', var(--font);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* ===== SIDEBAR ===== */
#sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--bg); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 200; overflow-y: auto;
}
.sidebar-logo { padding: 22px 20px 18px; flex-shrink: 0; }
.sidebar-logo-text { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--white); letter-spacing: 2px; }
.sidebar-logo-sub  { font-size: 8px; color: var(--muted); letter-spacing: 2px; margin-top: 3px; }

nav { flex: 1; padding: 4px 12px; }
.nav-section { padding: 16px 8px 6px; font-size: 8px; color: var(--muted2); letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.nav-item {
    display: block; padding: 10px 14px; margin-bottom: 2px;
    font-size: 11px; letter-spacing: 0.3px;
    color: var(--muted); text-decoration: none; transition: all .15s;
    border-radius: var(--radius-sm); font-weight: 500;
}
.nav-item:hover  { color: var(--text); background: var(--s2); }
.nav-item.active { color: #14151a; background: var(--purple); box-shadow: 0 4px 14px rgba(0,0,0,.4); font-weight: 700; }
.sidebar-bottom  { border-top: 1px solid var(--border); padding: 10px 12px; margin-top: 4px; }
.sidebar-user    { padding: 14px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.su-name { font-size: 11px; color: var(--white); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.su-role { font-size: 8px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.btn-logout {
    display: block; text-align: center; padding: 6px 10px;
    font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; transition: all .15s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* ===== TOPBAR ===== */
.topbar {
    display: flex; align-items: center; gap: 16px; justify-content: space-between;
    height: var(--topbar-h); margin-bottom: 18px;
}
.topbar-search {
    flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
    background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 10px 16px; transition: border-color .15s;
}
.topbar-search:focus-within { border-color: var(--purple); }
.topbar-search svg { flex-shrink: 0; color: var(--muted); }
.topbar-search input {
    background: transparent; border: none; outline: none; color: var(--text);
    font-family: var(--font); font-size: 12px; width: 100%;
}
.topbar-search input::placeholder { color: var(--muted2); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--s1); border: 1px solid var(--border); color: var(--muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.topbar-icon-btn:hover { color: var(--text); border-color: var(--border2); }
.topbar-user { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: var(--radius-lg); background: var(--s1); border: 1px solid var(--border); }
.topbar-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: var(--white); font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
}
.topbar-user-name { font-size: 10px; color: var(--text); font-weight: 600; line-height: 1.3; white-space: nowrap; }
.topbar-user-role { font-size: 8px; color: var(--muted); letter-spacing: .5px; }
@media (max-width: 640px) { .topbar-search { display: none; } .topbar-user-name, .topbar-user-role { display: none; } }

/* ===== MAIN ===== */
#main { margin-left: var(--sidebar-w); min-height: 100vh; padding: 20px 28px 32px; }

.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.page-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--white); letter-spacing: .3px; }
.page-sub   { font-size: 10px; color: var(--muted); margin-top: 4px; letter-spacing: .5px; }

/* ===== ALERTS ===== */
.alert { padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 11px; letter-spacing: 0.3px; }
.alert-success { background: rgba(126,224,183,.12); color: var(--green);  border: 1px solid rgba(126,224,183,.25); }
.alert-error   { background: rgba(240,140,150,.12); color: var(--red);    border: 1px solid rgba(240,140,150,.25); }
.alert-info    { background: rgba(176,180,187,.12); color: var(--blue);   border: 1px solid rgba(176,180,187,.25); }
.alert-warning { background: rgba(214,180,120,.12); color: var(--yellow); border: 1px solid rgba(214,180,120,.25); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
    font-family: var(--font);
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
    text-decoration: none; transition: all .15s;
}
.btn-primary { background: var(--purple); color: #14151a; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--s1); border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--border2); color: var(--text); }
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: 9px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== FORMS ===== */
.section-title {
    font-family: var(--font-display);
    font-size: 10px; font-weight: 600; color: var(--muted);
    letter-spacing: 1.5px; text-transform: uppercase;
    margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.form-caption { font-size: 10px; color: var(--white); letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.field input, .field select, .field textarea {
    background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 12px; color: var(--text);
    font-family: var(--font); font-size: 12px;
    outline: none; transition: border-color .15s; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted2); }
/* Подсказки. Раньше стиль был только внутри .field, поэтому вне формы
   надписи наследовали обычный текст — белый и крупный. */
.hint { font-size: 10px; line-height: 1.5; color: var(--muted2); }
.hint b, .hint strong { color: var(--muted); font-weight: 600; }
.field .hint { font-size: 9px; color: var(--muted2); }
.field .auto-tag { font-size: 8px; color: var(--blue); letter-spacing: 0.5px; }
.field input[type="file"] { padding: 6px 8px; font-size: 11px; cursor: pointer; }
.field input[type="file"]::-webkit-file-upload-button {
    background: var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); padding: 4px 9px;
    font-family: var(--font); font-size: 10px; cursor: pointer; margin-right: 8px;
}
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }

/* ===== TABLES ===== */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; background: var(--s1); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.tbl th {
    padding: 11px 14px; text-align: left; font-size: 8px; color: var(--muted);
    border-bottom: 1px solid var(--border); background: transparent;
    text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; font-weight: 700;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--s2); }
.tbl-empty { text-align: center; padding: 36px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
    position: relative; display: flex; flex-direction: column;
    background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 60px 16px 16px; transition: transform .15s, border-color .15s; box-shadow: var(--shadow);
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border2); }
.kpi::before {
    content: ''; position: absolute; left: 16px; top: 16px;
    width: 32px; height: 32px; border-radius: 10px;
}
.kpi::after {
    content: ''; position: absolute; left: 24px; top: 24px; width: 16px; height: 16px;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}
.kpi:nth-of-type(4n+1)::before { background: var(--purple-soft); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi:nth-of-type(4n+2)::before { background: rgba(126,224,183,.16);  box-shadow: inset 0 0 0 1px rgba(126,224,183,.35); }
.kpi:nth-of-type(4n+3)::before { background: rgba(214,180,120,.16);  box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi:nth-of-type(4n)::before    { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi:nth-of-type(4n+1)::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E"); }
.kpi:nth-of-type(4n+2)::after { background: var(--green); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='5' width='22' height='14' rx='2'/%3E%3Cline x1='1' y1='10' x2='23' y2='10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='5' width='22' height='14' rx='2'/%3E%3Cline x1='1' y1='10' x2='23' y2='10'/%3E%3C/svg%3E"); }
.kpi:nth-of-type(4n+3)::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.42 20.58a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82Z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.42 20.58a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82Z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E"); }
.kpi:nth-of-type(4n)::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E"); }
.kpi-label { order: 2; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 6px; font-weight: 600; }
.kpi-val { order: 1; font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--white); }
.kpi-sub { order: 3; font-size: 9px; color: var(--muted); margin-top: 8px; display: inline-block; padding: 3px 8px; border-radius: 20px; background: var(--s2); width: fit-content; }

/* ===== COLOURS ===== */
.pos { color: var(--green); }
.neg { color: var(--red); }
.warn { color: var(--yellow); }
.neutral { color: var(--text); }
.muted-v { color: var(--muted); }
.col-acc { color: var(--white); font-weight: 600; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 8px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.badge-pay       { background: rgba(240,140,150,.14); color: var(--red);    border: 1px solid rgba(240,140,150,.3); }
.badge-ordered   { background: rgba(126,224,183,.14); color: var(--green);  border: 1px solid rgba(126,224,183,.3); }
.badge-delayed   { background: rgba(214,180,120,.14); color: var(--yellow); border: 1px solid rgba(214,180,120,.3); }
.badge-waiting   { background: rgba(176,180,187,.14); color: var(--blue);   border: 1px solid rgba(176,180,187,.3); }
.badge-invoice   { background: var(--purple-soft);   color: #cdd0d6;       border: 1px solid rgba(176,180,187,.35); }
.badge-delivered { background: var(--s2); color: var(--muted);  border: 1px solid var(--border); }

.info-bar { font-size: 9px; color: var(--muted); letter-spacing: 0.5px; margin-bottom: 16px; padding: 9px 13px; background: var(--s1); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ===== SHOP TABS / PERIOD ===== */
/* ===== НАВИГАЦИЯ РАЗДЕЛОВ ===== */
/* Вкладки верхнего уровня: подчёркивание, а не пилюля —
   чтобы отличались от фильтров под ними. */
.sec-tabs { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 14px;
            border-bottom: 1px solid var(--border); }
.sec-tab { padding: 10px 2px; margin-right: 20px; font-size: 14px; font-weight: 600;
           color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
           margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .15s; }
.sec-tab:hover  { color: var(--text); }
.sec-tab.active { color: var(--text); border-bottom-color: var(--green); }
@media (max-width: 560px) { .sec-tab { font-size: 13px; margin-right: 14px; } }

/* Фильтры: сегментированный переключатель. На узком экране
   прокручивается вбок, а не переносится на несколько рядов. */
.shop-tabs { display: inline-flex; background: var(--s2); border: 1px solid var(--border);
             border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 14px;
             max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab {
    padding: 6px 14px; border-radius: 999px; font-size: 11px;
    letter-spacing: .3px; font-weight: 600; border: none;
    color: var(--muted); background: transparent; text-decoration: none;
    white-space: nowrap; transition: all .15s;
}
.shop-tab:hover  { color: var(--text); }
.shop-tab.active { background: var(--s3); color: var(--text); box-shadow: none; }
@media (max-width: 560px) { .shop-tab { padding: 8px 13px; } }

/* Период: год и месяцы одной строкой */
.period-nav { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; flex-shrink: 0; }
.yr-btn {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--s2); color: var(--muted);
    font-size: 14px; display: grid; place-items: center;
    text-decoration: none; transition: all .15s; flex-shrink: 0;
}
.yr-btn:hover { color: var(--text); border-color: var(--border2); }
.yr-val { font-family: var(--font-display); font-size: 15px; font-weight: 700;
          color: var(--white); letter-spacing: .5px; min-width: 46px; text-align: center; }

/* Год и месяцы одной строкой: обернуть .period-nav и .month-grid */
.period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.period-row .period-nav,
.period-row .month-grid { margin-bottom: 0; }
.period-row .month-grid { flex: 1; min-width: 0; }

.month-grid { display: flex; gap: 3px; margin-bottom: 16px; overflow-x: auto;
              scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.month-grid::-webkit-scrollbar { display: none; }
.mo { padding: 7px 11px; text-align: center; border-radius: 8px; font-size: 10px;
      font-weight: 700; letter-spacing: .4px; border: none; color: var(--muted2);
      text-decoration: none; white-space: nowrap; transition: all .15s; flex-shrink: 0; }
.mo:hover  { color: var(--text); background: var(--s2); }
.mo.has    { color: var(--muted); }
.mo.active { background: var(--s3); color: var(--text); }

/* ===== FILES ===== */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.folder-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; transition: all .15s; box-shadow: var(--shadow); }
.folder-card:hover { border-color: var(--border2); background: var(--s2); transform: translateY(-2px); }
.folder-card .f-icon { font-size: 11px; color: var(--purple); letter-spacing: 2px; margin-bottom: 8px; }
.folder-card .f-name { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.folder-card .f-count { font-size: 8px; color: var(--muted); margin-top: 2px; }
.folder-card .f-actions { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }

.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }
.fi-icon { font-size: 8px; color: var(--purple); letter-spacing: 1px; flex-shrink: 0; width: 34px; }
.fi-name { flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-size { font-size: 9px; color: var(--muted); flex-shrink: 0; }
.fi-date { font-size: 9px; color: var(--muted2); flex-shrink: 0; min-width: 80px; }

/* ===== REPORTS (manager) ===== */
.report-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.report-title { font-size: 12px; color: var(--white); letter-spacing: 0.3px; font-weight: 600; }
.report-sub { font-size: 9px; color: var(--muted); margin-top: 3px; }
.report-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 5px; margin-bottom: 10px; }
.chk-item { display: flex; align-items: center; gap: 8px; font-size: 10px; padding: 4px 0; }
.chk-mark { font-size: 8px; font-weight: 700; letter-spacing: 0.5px; padding: 3px 7px; border-radius: 20px; flex-shrink: 0; min-width: 34px; text-align: center; }
.chk-item.ok  .chk-mark { background: rgba(126,224,183,.14); color: var(--green); border: 1px solid rgba(126,224,183,.3); }
.chk-item.bad .chk-mark { background: rgba(240,140,150,.14); color: var(--red);   border: 1px solid rgba(240,140,150,.3); }
.chk-item.ok  { color: var(--muted); }
.chk-item.bad { color: var(--text); }
.report-issues { font-size: 10px; color: var(--red); background: rgba(240,140,150,.08); border: 1px solid rgba(240,140,150,.25); border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 10px; }
.report-note { font-size: 10px; color: var(--text); background: var(--s2); border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 10px; }
.rn-label { display: block; font-size: 8px; color: var(--muted); letter-spacing: 1px; margin-bottom: 3px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.photo-thumb { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-review { border-top: 1px solid var(--border); padding-top: 12px; }
.review-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }

/* ===== ANNOUNCEMENTS (manager) ===== */
.ann-card { background: var(--s1); border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius); padding: 15px 17px; margin-bottom: 10px; box-shadow: var(--shadow); }
.ann-card.ann-normal    { border-left-color: var(--purple); }
.ann-card.ann-important { border-left-color: var(--yellow); }
.ann-card.ann-urgent    { border-left-color: var(--red); }
.ann-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ann-title { font-size: 12px; color: var(--white); font-weight: 600; }
.ann-meta { font-size: 9px; color: var(--muted); margin-top: 3px; }
.ann-body { font-size: 11px; color: var(--text); margin-top: 8px; line-height: 1.5; }

.import-help { font-size: 10px; color: var(--muted); background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 14px; line-height: 1.6; }
.ih-title { font-size: 9px; color: var(--blue); letter-spacing: 1px; margin-bottom: 5px; font-weight: 700; }

.menu-toggle {
    display: none; position: fixed; top: 12px; left: 12px; z-index: 300;
    background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 7px 13px; color: var(--text); font-size: 9px; letter-spacing: 1px;
    font-family: var(--font); font-weight: 600; cursor: pointer;
}

/* ===== LOGIN ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 20% 20%, rgba(176,180,187,.12), transparent 45%), radial-gradient(circle at 80% 80%, rgba(176,180,187,.1), transparent 45%), var(--bg); }
.login-box { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 38px 38px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-logo { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--white); letter-spacing: 2px; margin-bottom: 4px; }
.login-sub { font-size: 9px; color: var(--muted); letter-spacing: 2px; margin-bottom: 28px; }

/* ============================================================
   ИНТЕРФЕЙС ПРОДАВЦА
   ============================================================ */
.seller-body { background: var(--bg); padding-bottom: 40px; }

.s-header { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.s-header-in { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 720px; margin: 0 auto; }
.s-logo { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--white); letter-spacing: 1.5px; }
.s-sub { font-size: 9px; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; }
.s-exit { font-size: 9px; color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 11px; text-decoration: none; letter-spacing: 0.5px; }

.s-nav { display: flex; overflow-x: auto; gap: 6px; padding: 10px 16px; max-width: 720px; margin: 0 auto; scrollbar-width: none; }
.s-nav::-webkit-scrollbar { display: none; }
.s-nav-item {
    flex-shrink: 0; padding: 8px 16px; border-radius: var(--radius-lg);
    font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 600;
    border: 1px solid var(--border); color: var(--muted); background: var(--s1);
    text-decoration: none; transition: all .15s;
}
.s-nav-item.active { background: var(--purple); color: #14151a; border-color: transparent; box-shadow: 0 4px 14px rgba(0,0,0,.35); }

.s-main { max-width: 720px; margin: 0 auto; padding: 4px 16px 20px; }

.s-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.s-card-title { font-family: var(--font-display); font-size: 11px; font-weight: 600; color: var(--white); letter-spacing: 1px; margin-bottom: 10px; }
.s-date { font-size: 10px; color: var(--muted); margin-bottom: 14px; letter-spacing: 0.5px; }

.s-btn-big {
    display: block; width: 100%; padding: 16px;
    background: var(--purple); color: #14151a; border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: 13px; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer; transition: all .15s;
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.s-btn-big:active { transform: scale(0.99); }
.s-btn-big.secondary { background: var(--s1); border: 1px solid var(--border2); color: var(--text); box-shadow: none; }

.s-btn-scan {
    display: block; width: 100%; padding: 12px; margin-bottom: 10px;
    background: transparent; border: 1px dashed var(--border2); border-radius: var(--radius);
    color: var(--blue); font-family: var(--font); font-weight: 600;
    font-size: 10px; letter-spacing: 0.5px; cursor: pointer;
}
.s-btn-scan.secondary { color: var(--muted); margin-top: 8px; }

.s-checkin-row { display: flex; margin-bottom: 10px; }
.s-mark { flex: 1; padding: 15px 17px; border-radius: var(--radius); background: rgba(126,224,183,.1); border: 1px solid rgba(126,224,183,.3); display: flex; justify-content: space-between; align-items: center; }
.s-mark-label { font-size: 11px; color: var(--green); letter-spacing: 0.5px; }
.s-mark-time { font-family: var(--font-display); font-size: 16px; color: var(--green); font-weight: 600; }

.s-task {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; text-decoration: none; transition: all .15s; background: var(--s1);
}
.s-task:active { background: var(--s2); }
.s-task-name { font-size: 11px; color: var(--text); }
.s-task-state { font-size: 9px; letter-spacing: 0.5px; color: var(--yellow); font-weight: 600; }
.s-task.done { border-color: rgba(126,224,183,.35); }
.s-task.done .s-task-state { color: var(--green); }

.s-plan-nums { display: flex; gap: 16px; margin-bottom: 12px; }
.s-plan-nums > div { flex: 1; }
.s-plan-label { font-size: 8px; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; }
.s-plan-val { font-family: var(--font-display); font-size: 16px; color: var(--white); font-weight: 600; }
.s-progress { height: 8px; background: var(--s3); border-radius: 20px; overflow: hidden; margin-bottom: 6px; }
.s-progress-bar { height: 100%; background: linear-gradient(90deg, var(--muted), var(--text)); transition: width .3s; }
.s-plan-pct { font-size: 10px; color: var(--muted); text-align: right; }
.s-note-line { font-size: 11px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.s-note-line.ok { color: var(--green); }

.s-kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.s-kv:last-child { border-bottom: none; }
.s-kv span { color: var(--muted); }
.s-kv b { color: var(--text); }
.s-kv.total { border-top: 1px solid var(--border2); border-bottom: none; margin-top: 4px; padding-top: 10px; font-size: 12px; }
.s-kv.total span { color: var(--white); }

.s-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 11px; cursor: pointer; }
.s-check:last-of-type { border-bottom: none; }
.s-check input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--purple); margin-top: 1px; }
.s-check span { line-height: 1.4; padding-top: 2px; }

.s-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.s-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.s-row:last-child { border-bottom: none; }
.s-row-main { flex: 1; min-width: 0; }
.s-row-title { font-size: 11px; color: var(--text); }
.s-row-sub { font-size: 9px; color: var(--muted); margin-top: 3px; }
.s-badge { font-size: 8px; padding: 4px 8px; border-radius: 20px; letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0; font-weight: 700; }
.s-badge.st-new { background: rgba(214,180,120,.14); color: var(--yellow); border: 1px solid rgba(214,180,120,.3); }
.s-badge.st-ok  { background: rgba(126,224,183,.14); color: var(--green);  border: 1px solid rgba(126,224,183,.3); }
.s-badge.st-bad { background: rgba(240,140,150,.14); color: var(--red);    border: 1px solid rgba(240,140,150,.3); }

.s-result { padding: 13px 15px; border-radius: var(--radius); font-size: 12px; letter-spacing: 0.5px; text-align: center; margin-bottom: 14px; }
.s-result.ok   { background: rgba(126,224,183,.1); color: var(--green);  border: 1px solid rgba(126,224,183,.3); }
.s-result.bad  { background: rgba(240,140,150,.1); color: var(--red);    border: 1px solid rgba(240,140,150,.3); }
.s-result.warn { background: rgba(214,180,120,.1); color: var(--yellow); border: 1px solid rgba(214,180,120,.3); }

.s-manager-note { background: var(--s2); border-left: 2px solid var(--blue); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 10px; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.s-mn-label { font-size: 8px; color: var(--blue); letter-spacing: 1px; margin-bottom: 4px; }

.s-formula { font-size: 10px; color: var(--muted); line-height: 1.6; }
.s-empty { text-align: center; padding: 24px; color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.s-link { display: block; text-align: center; margin-top: 10px; font-size: 10px; color: var(--blue); text-decoration: none; letter-spacing: 0.5px; }

.s-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.s-tab { flex: 1; text-align: center; padding: 11px; border: 1px solid var(--border); background: var(--s1); border-radius: var(--radius); font-size: 10px; letter-spacing: 0.5px; color: var(--muted); text-decoration: none; font-weight: 600; }
.s-tab.active { background: var(--purple); color: #14151a; border-color: transparent; }

.s-ann { padding: 11px 13px; border-left: 2px solid var(--border2); background: var(--s2); border-radius: var(--radius-sm); margin-bottom: 8px; }
.s-ann.ann-important { border-left-color: var(--yellow); }
.s-ann.ann-urgent    { border-left-color: var(--red); }
.s-ann-title { font-size: 11px; color: var(--text); }
.s-ann-date  { font-size: 9px; color: var(--muted); margin-top: 3px; }

.s-ann-full { padding: 15px; border-left: 3px solid var(--border2); background: var(--s2); border-radius: var(--radius); margin-bottom: 12px; }
.s-ann-full.ann-important { border-left-color: var(--yellow); }
.s-ann-full.ann-urgent    { border-left-color: var(--red); }
.s-ann-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.s-ann-prio { font-size: 8px; letter-spacing: 1px; color: var(--muted); }
.s-ann-full .s-ann-title { font-size: 12px; color: var(--white); margin-bottom: 6px; }
.s-ann-body { font-size: 11px; color: var(--text); line-height: 1.5; }
.s-ann-author { font-size: 9px; color: var(--muted); margin-top: 8px; }

.s-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.s-month-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--s1); border-radius: 50%; color: var(--text); text-decoration: none; font-size: 16px; }
.s-month-name { font-family: var(--font-display); font-size: 13px; color: var(--white); letter-spacing: 0.5px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 3px; }

/* ===== MOBILE ===== */
@media (max-width: 900px) {
    #sidebar { transform: translateX(-100%); transition: transform .25s; }
    #sidebar.open { transform: translateX(0); }
    /* Затемнение под меню: без него страница за меню остаётся кликабельной
       и прокручивается, из-за чего кажется, что кнопка «зависла». */
    #sidebar.open::after {
        content: ''; position: fixed; inset: 0; left: 100%;
        background: rgba(0,0,0,.55); z-index: -1;
    }
    body.menu-open { overflow: hidden; }
    #main { margin-left: 0; padding: 16px; padding-top: 56px; }
    .menu-toggle { display: block; }
    .topbar { height: auto; margin-bottom: 14px; }
    .month-grid { grid-template-columns: repeat(6, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .fgrid { grid-template-columns: 1fr; }
    .report-checks { grid-template-columns: 1fr; }
}


/* ===== КАБИНЕТ ПРОДАВЦА НА ШИРОКОМ ЭКРАНЕ ===== */
@media (min-width: 760px) {
    .s-header-in { padding: 16px 24px; max-width: 900px; }
    .s-logo { font-size: 18px; }
    .s-sub { font-size: 10px; }
    .s-nav { max-width: 900px; padding: 12px 24px; overflow-x: visible; flex-wrap: wrap; }
    .s-nav-item { padding: 8px 18px; font-size: 10px; }
    .s-main { max-width: 900px; padding: 8px 24px 40px; }
    .s-card { padding: 20px 22px; }
    .s-card-title { font-size: 12px; }
    .s-btn-big { padding: 14px; font-size: 12px; }
    .s-checkin-row { max-width: 420px; }
    .s-mark { max-width: 420px; }
    .s-plan-nums { max-width: 480px; }
    .s-progress { max-width: 480px; }
    .s-plan-pct { max-width: 480px; }
    .s-formula { max-width: 560px; }
    .s-task { max-width: 560px; }

    /* Две колонки для карточек на главной */
    .s-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
    .s-grid-2 .s-card { margin-bottom: 0; }

    /* Формы в две колонки */
    .s-card form .fgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .s-check { max-width: 620px; }
    .s-two-col { max-width: 480px; }
    .s-card .field { max-width: 480px; }
    .s-card .field textarea { max-width: 620px; }
}

@media (min-width: 1100px) {
    .s-header-in, .s-nav, .s-main { max-width: 1040px; }
}

/* ============================================================
   ПЛАНЕР ЗАДАЧ
   ============================================================ */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    align-items: start;
}
.board-col { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.board-col-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 9px; letter-spacing: 1px; color: var(--muted); font-weight: 700;
    padding: 2px 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.board-count { background: var(--purple-soft); color: #cdd0d6; border-radius: 20px; padding: 2px 8px; font-size: 9px; font-weight: 700; }
.board-empty { font-size: 9px; color: var(--muted2); letter-spacing: 1px; padding: 12px 4px; text-align: center; }

.t-card {
    background: var(--s2); border: 1px solid var(--border);
    border-left: 3px solid var(--border2); border-radius: var(--radius-sm);
    padding: 11px 12px; margin-bottom: 8px;
}
.t-card.prio-urgent { border-left-color: var(--red); }
.t-card.prio-high   { border-left-color: var(--yellow); }
.t-card.prio-normal { border-left-color: var(--purple); }
.t-card.prio-low    { border-left-color: var(--s3); }
.t-title {
    display: block; font-size: 11px; color: var(--text);
    text-decoration: none; line-height: 1.4; margin-bottom: 7px;
}
.t-title:hover { color: var(--white); }
.t-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.t-chip {
    font-size: 8px; letter-spacing: 0.5px; color: var(--muted);
    background: var(--s3); border-radius: 20px; padding: 2px 7px;
}
.t-person { font-size: 9px; color: var(--blue); margin-bottom: 6px; }
.t-due { font-size: 8px; letter-spacing: 0.5px; color: var(--muted); background: var(--s3); border-radius: 20px; padding: 2px 7px; }
.t-due.over { background: rgba(240,140,150,.14); color: var(--red);    border: 1px solid rgba(240,140,150,.3); }
.t-due.now  { background: rgba(214,180,120,.14); color: var(--yellow); border: 1px solid rgba(214,180,120,.3); }
.t-due.soon { background: rgba(176,180,187,.14); color: var(--blue);   border: 1px solid rgba(176,180,187,.3); }
.t-actions { margin-top: 4px; }
.t-select {
    width: 100%; background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--muted); font-family: var(--font); font-size: 9px;
    padding: 4px 6px; outline: none; cursor: pointer;
}
.t-select:focus { border-color: var(--purple); color: var(--text); }

/* Календарь */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 24px; }
.cal-dow { font-size: 8px; letter-spacing: 1px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell {
    background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-sm);
    min-height: 92px; padding: 6px;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--purple); }
.cal-day { font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--purple); font-weight: 700; }
.cal-task {
    display: block; font-size: 9px; line-height: 1.3;
    background: var(--s2); border-left: 2px solid var(--border2);
    border-radius: 4px; padding: 3px 5px; margin-bottom: 3px;
    color: var(--text); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-task:hover { background: var(--s3); }
.cal-task.prio-urgent { border-left-color: var(--red); }
.cal-task.prio-high   { border-left-color: var(--yellow); }
.cal-task.done { opacity: .45; text-decoration: line-through; }

/* Карточка задачи */
.modal-back {
    position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(2px);
    z-index: 400; display: flex; align-items: flex-start; justify-content: center;
    padding: 30px 16px; overflow-y: auto;
}
.modal-card {
    background: var(--s1); border: 1px solid var(--border2); border-radius: var(--radius-lg);
    padding: 24px; width: 100%; max-width: 720px; margin: auto; box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-title-txt { font-family: var(--font-display); font-size: 15px; color: var(--white); line-height: 1.35; }
.modal-sub { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.modal-desc {
    font-size: 11px; color: var(--text); line-height: 1.6;
    background: var(--s2); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
}
.modal-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.modal-kv > div { background: var(--s2); border-radius: var(--radius-sm); padding: 9px 11px; }
.modal-kv span { display: block; font-size: 8px; letter-spacing: 1px; color: var(--muted); margin-bottom: 3px; }
.modal-kv b { font-size: 11px; color: var(--text); font-weight: 500; }

.cl-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.cl-row:last-of-type { border-bottom: none; }
.cl-box {
    width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
    background: var(--s2); border: 1px solid var(--border2); border-radius: 5px;
    color: var(--bg); font-family: var(--font); font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.cl-box.on { background: var(--green); border-color: var(--green); }
.cl-title { flex: 1; font-size: 11px; color: var(--text); }
.cl-title.done { color: var(--muted2); text-decoration: line-through; }

.cmt { background: var(--s2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 7px; }
.cmt-head { font-size: 9px; color: var(--muted); margin-bottom: 4px; }
.cmt-body { font-size: 11px; color: var(--text); line-height: 1.5; }

.board-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--s1); border: 1px solid var(--border); border-radius: 20px; padding: 4px 6px 4px 12px;
}
.board-chip a { font-size: 10px; color: var(--text); text-decoration: none; letter-spacing: 0.5px; }
.chip-x {
    background: transparent; border: none; color: var(--muted2); cursor: pointer;
    font-family: var(--font); font-size: 11px; padding: 0 4px; line-height: 1;
}
.chip-x:hover { color: var(--red); }

@media (max-width: 900px) {
    .board-grid { grid-template-columns: 1fr; }
    .cal-grid { gap: 2px; }
    .cal-cell { min-height: 62px; padding: 3px; }
    .cal-task { font-size: 8px; }
    .modal-back { padding: 12px 8px; }
    .modal-card { padding: 16px; }
}

/* ===== ГАЛОЧКА ВЫПОЛНЕНИЯ ЗАДАЧИ ===== */
.t-top { display: flex; align-items: flex-start; gap: 9px; }
.t-top .t-title { flex: 1; margin-bottom: 0; }

.t-check {
    width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px;
    background: var(--s1); border: 1px solid var(--border2); border-radius: 6px;
    cursor: pointer; position: relative; padding: 0;
    transition: all .15s;
}
.t-check:hover { border-color: var(--green); }
.t-check::after {
    content: ''; position: absolute;
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid transparent; border-width: 0 2px 2px 0;
    transform: rotate(42deg);
    transition: border-color .15s;
}
.t-check:hover::after { border-color: var(--muted); }
.t-check.on { background: var(--green); border-color: var(--green); }
.t-check.on::after { border-color: #0d0d0f; }

.t-card.is-done { opacity: .55; }
.t-card.is-done .t-title { text-decoration: line-through; color: var(--muted); }

.t-list-title { color: var(--white); text-decoration: none; }
.t-list-title:hover { color: var(--white); }
.t-list-title.done { color: var(--muted2); text-decoration: line-through; }
.tbl tr.row-done td { opacity: .6; }

/* ===== РЕЖИМ ВЕБ-ПРИЛОЖЕНИЯ НА IPHONE ===== */
@supports (padding: max(0px)) {
    .s-header { padding-top: env(safe-area-inset-top); }
    .s-main   { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    #sidebar  { padding-top: env(safe-area-inset-top); }
}

/* ===== ЧЕРНОВИК ЗАКАЗА ИЗ СЧЁТА ===== */
.draft-file {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: rgba(176,180,187,.08); border: 1px solid rgba(176,180,187,.25); border-radius: var(--radius-sm);
    padding: 11px 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.df-name { font-size: 11px; color: var(--blue); }
.df-info { font-size: 9px; color: var(--muted); margin-top: 3px; letter-spacing: 0.5px; }

/* ==== Осмысленные иконки KPI-карточек ====
   Задают иконку по смыслу показателя вместо ротации по порядку. */
.kpi.i-money::after { background: var(--green); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%207h20v10H2z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2.5'/%3E%3Cpath%20d='M6%2012h.01M18%2012h.01'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%207h20v10H2z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2.5'/%3E%3Cpath%20d='M6%2012h.01M18%2012h.01'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-cash::after { background: var(--green); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='9'%20cy='9'%20r='6'/%3E%3Cpath%20d='M15.5%205.5a6%206%200%200%201%200%2013'/%3E%3Cpath%20d='M9%206.5v5M7.5%208h3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='9'%20cy='9'%20r='6'/%3E%3Cpath%20d='M15.5%205.5a6%206%200%200%201%200%2013'/%3E%3Cpath%20d='M9%206.5v5M7.5%208h3'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-card::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='1'%20y='5'%20width='22'%20height='14'%20rx='2'/%3E%3Cline%20x1='1'%20y1='10'%20x2='23'%20y2='10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='1'%20y='5'%20width='22'%20height='14'%20rx='2'/%3E%3Cline%20x1='1'%20y1='10'%20x2='23'%20y2='10'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-receipt::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%203v18l2-1.2L9%2021l2-1.2L13%2021l2-1.2L17%2021l2-1.2V3H5z'/%3E%3Cpath%20d='M9%208h6M9%2012h6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%203v18l2-1.2L9%2021l2-1.2L13%2021l2-1.2L17%2021l2-1.2V3H5z'/%3E%3Cpath%20d='M9%208h6M9%2012h6'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-percent::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='19'%20y1='5'%20x2='5'%20y2='19'/%3E%3Ccircle%20cx='6.5'%20cy='6.5'%20r='2.5'/%3E%3Ccircle%20cx='17.5'%20cy='17.5'%20r='2.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='19'%20y1='5'%20x2='5'%20y2='19'/%3E%3Ccircle%20cx='6.5'%20cy='6.5'%20r='2.5'/%3E%3Ccircle%20cx='17.5'%20cy='17.5'%20r='2.5'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-up::after { background: var(--green); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%206%2013.5%2015.5%208.5%2010.5%201%2018'/%3E%3Cpolyline%20points='17%206%2023%206%2023%2012'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%206%2013.5%2015.5%208.5%2010.5%201%2018'/%3E%3Cpolyline%20points='17%206%2023%206%2023%2012'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-down::after { background: var(--red); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%2018%2013.5%208.5%208.5%2013.5%201%206'/%3E%3Cpolyline%20points='17%2018%2023%2018%2023%2012'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='23%2018%2013.5%208.5%208.5%2013.5%201%206'/%3E%3Cpolyline%20points='17%2018%2023%2018%2023%2012'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-chart::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='18'%20y1='20'%20x2='18'%20y2='10'/%3E%3Cline%20x1='12'%20y1='20'%20x2='12'%20y2='4'/%3E%3Cline%20x1='6'%20y1='20'%20x2='6'%20y2='14'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='18'%20y1='20'%20x2='18'%20y2='10'/%3E%3Cline%20x1='12'%20y1='20'%20x2='12'%20y2='4'/%3E%3Cline%20x1='6'%20y1='20'%20x2='6'%20y2='14'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-users::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M17%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='9'%20cy='7'%20r='4'/%3E%3Cpath%20d='M23%2021v-2a4%204%200%200%200-3-3.87'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M17%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='9'%20cy='7'%20r='4'/%3E%3Cpath%20d='M23%2021v-2a4%204%200%200%200-3-3.87'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-clock::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpolyline%20points='12%207%2012%2012%2015.5%2014'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpolyline%20points='12%207%2012%2012%2015.5%2014'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-calendar::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='18'%20rx='2'/%3E%3Cline%20x1='16'%20y1='2'%20x2='16'%20y2='6'/%3E%3Cline%20x1='8'%20y1='2'%20x2='8'%20y2='6'/%3E%3Cline%20x1='3'%20y1='10'%20x2='21'%20y2='10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='18'%20rx='2'/%3E%3Cline%20x1='16'%20y1='2'%20x2='16'%20y2='6'/%3E%3Cline%20x1='8'%20y1='2'%20x2='8'%20y2='6'/%3E%3Cline%20x1='3'%20y1='10'%20x2='21'%20y2='10'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-check::after { background: var(--green); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M22%2011.1V12a10%2010%200%201%201-5.9-9.1'/%3E%3Cpolyline%20points='22%204%2012%2014.1%209%2011.1'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M22%2011.1V12a10%2010%200%201%201-5.9-9.1'/%3E%3Cpolyline%20points='22%204%2012%2014.1%209%2011.1'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-alert::after { background: var(--red); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.3%203.6%201.8%2018a2%202%200%200%200%201.7%203h17a2%202%200%200%200%201.7-3L13.7%203.6a2%202%200%200%200-3.4%200z'/%3E%3Cline%20x1='12'%20y1='9'%20x2='12'%20y2='13'/%3E%3Cline%20x1='12'%20y1='17'%20x2='12.01'%20y2='17'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.3%203.6%201.8%2018a2%202%200%200%200%201.7%203h17a2%202%200%200%200%201.7-3L13.7%203.6a2%202%200%200%200-3.4%200z'/%3E%3Cline%20x1='12'%20y1='9'%20x2='12'%20y2='13'/%3E%3Cline%20x1='12'%20y1='17'%20x2='12.01'%20y2='17'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-pending::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cline%20x1='12'%20y1='8'%20x2='12'%20y2='12'/%3E%3Cline%20x1='12'%20y1='16'%20x2='12.01'%20y2='16'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cline%20x1='12'%20y1='8'%20x2='12'%20y2='12'/%3E%3Cline%20x1='12'%20y1='16'%20x2='12.01'%20y2='16'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-doc::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z'/%3E%3Cpolyline%20points='14%202%2014%208%2020%208'/%3E%3Cline%20x1='8'%20y1='13'%20x2='16'%20y2='13'/%3E%3Cline%20x1='8'%20y1='17'%20x2='13'%20y2='17'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z'/%3E%3Cpolyline%20points='14%202%2014%208%2020%208'/%3E%3Cline%20x1='8'%20y1='13'%20x2='16'%20y2='13'/%3E%3Cline%20x1='8'%20y1='17'%20x2='13'%20y2='17'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-tag::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20.59%2013.41%2013.42%2020.58a2%202%200%200%201-2.83%200L2%2012V2h10l8.59%208.59a2%202%200%200%201%200%202.82Z'/%3E%3Cline%20x1='7'%20y1='7'%20x2='7.01'%20y2='7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20.59%2013.41%2013.42%2020.58a2%202%200%200%201-2.83%200L2%2012V2h10l8.59%208.59a2%202%200%200%201%200%202.82Z'/%3E%3Cline%20x1='7'%20y1='7'%20x2='7.01'%20y2='7'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-box::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M21%2016V8a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016Z'/%3E%3Cpolyline%20points='3.27%206.96%2012%2012.01%2020.73%206.96'/%3E%3Cline%20x1='12'%20y1='22.08'%20x2='12'%20y2='12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M21%2016V8a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016Z'/%3E%3Cpolyline%20points='3.27%206.96%2012%2012.01%2020.73%206.96'/%3E%3Cline%20x1='12'%20y1='22.08'%20x2='12'%20y2='12'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-cart::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='9'%20cy='21'%20r='1'/%3E%3Ccircle%20cx='20'%20cy='21'%20r='1'/%3E%3Cpath%20d='M1%201h4l2.7%2013.4a2%202%200%200%200%202%201.6h9.7a2%202%200%200%200%202-1.6L23%206H6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='9'%20cy='21'%20r='1'/%3E%3Ccircle%20cx='20'%20cy='21'%20r='1'/%3E%3Cpath%20d='M1%201h4l2.7%2013.4a2%202%200%200%200%202%201.6h9.7a2%202%200%200%200%202-1.6L23%206H6'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-store::after { background: var(--purple); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%209%204.5%204h15L21%209'/%3E%3Cpath%20d='M4%209v11a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1V9'/%3E%3Cpath%20d='M3%209a3%203%200%200%200%206%200%203%203%200%200%200%206%200%203%203%200%200%200%206%200'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%209%204.5%204h15L21%209'/%3E%3Cpath%20d='M4%209v11a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1V9'/%3E%3Cpath%20d='M3%209a3%203%200%200%200%206%200%203%203%200%200%200%206%200%203%203%200%200%200%206%200'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-trash::after { background: var(--red); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='3%206%205%206%2021%206'/%3E%3Cpath%20d='M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6m3%200V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='3%206%205%206%2021%206'/%3E%3Cpath%20d='M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6m3%200V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-archive::after { background: var(--muted); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='2'%20y='4'%20width='20'%20height='5'%20rx='1'/%3E%3Cpath%20d='M4%209v10a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1V9'/%3E%3Cline%20x1='10'%20y1='13'%20x2='14'%20y2='13'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='2'%20y='4'%20width='20'%20height='5'%20rx='1'/%3E%3Cpath%20d='M4%209v10a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1V9'/%3E%3Cline%20x1='10'%20y1='13'%20x2='14'%20y2='13'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-star::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolygon%20points='12%202%2015.1%208.6%2022%209.5%2017%2014.4%2018.3%2021.5%2012%2018.1%205.7%2021.5%207%2014.4%202%209.5%208.9%208.6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolygon%20points='12%202%2015.1%208.6%2022%209.5%2017%2014.4%2018.3%2021.5%2012%2018.1%205.7%2021.5%207%2014.4%202%209.5%208.9%208.6'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-truck::after { background: var(--blue); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='1'%20y='6'%20width='13'%20height='11'%20rx='1'/%3E%3Cpath%20d='M14%209h4l3%203.5V17h-7z'/%3E%3Ccircle%20cx='5.5'%20cy='19'%20r='1.8'/%3E%3Ccircle%20cx='17.5'%20cy='19'%20r='1.8'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='1'%20y='6'%20width='13'%20height='11'%20rx='1'/%3E%3Cpath%20d='M14%209h4l3%203.5V17h-7z'/%3E%3Ccircle%20cx='5.5'%20cy='19'%20r='1.8'/%3E%3Ccircle%20cx='17.5'%20cy='19'%20r='1.8'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-key::after { background: var(--yellow); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='7.5'%20cy='15.5'%20r='4.5'/%3E%3Cline%20x1='10.8'%20y1='12.2'%20x2='21'%20y2='2'/%3E%3Cline%20x1='17'%20y1='6'%20x2='19.5'%20y2='8.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='7.5'%20cy='15.5'%20r='4.5'/%3E%3Cline%20x1='10.8'%20y1='12.2'%20x2='21'%20y2='2'/%3E%3Cline%20x1='17'%20y1='6'%20x2='19.5'%20y2='8.5'/%3E%3C/svg%3E"); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.kpi.i-money::before { background: rgba(126,224,183,.16); box-shadow: inset 0 0 0 1px rgba(126,224,183,.35); }
.kpi.i-cash::before { background: rgba(126,224,183,.16); box-shadow: inset 0 0 0 1px rgba(126,224,183,.35); }
.kpi.i-card::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-receipt::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-percent::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi.i-up::before { background: rgba(126,224,183,.16); box-shadow: inset 0 0 0 1px rgba(126,224,183,.35); }
.kpi.i-down::before { background: rgba(240,140,150,.16); box-shadow: inset 0 0 0 1px rgba(240,140,150,.35); }
.kpi.i-chart::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-users::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-clock::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi.i-calendar::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-check::before { background: rgba(126,224,183,.16); box-shadow: inset 0 0 0 1px rgba(126,224,183,.35); }
.kpi.i-alert::before { background: rgba(240,140,150,.16); box-shadow: inset 0 0 0 1px rgba(240,140,150,.35); }
.kpi.i-pending::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi.i-doc::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-tag::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi.i-box::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-cart::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-store::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-trash::before { background: rgba(240,140,150,.16); box-shadow: inset 0 0 0 1px rgba(240,140,150,.35); }
.kpi.i-archive::before { background: rgba(138,138,146,.16); box-shadow: inset 0 0 0 1px rgba(138,138,146,.35); }
.kpi.i-star::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }
.kpi.i-truck::before { background: rgba(176,180,187,.16); box-shadow: inset 0 0 0 1px rgba(176,180,187,.35); }
.kpi.i-key::before { background: rgba(214,180,120,.16); box-shadow: inset 0 0 0 1px rgba(214,180,120,.35); }

/* ==== Уведомления в шапке ==== */
.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 8px; background: var(--red); color: #1a1a1a;
  font-size: 8px; font-weight: 800; line-height: 15px; text-align: center;
  border: 2px solid var(--bg);
}
.notif-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 340px;
  max-height: 420px; overflow-y: auto; z-index: 200;
  background: var(--s1); border: 1px solid var(--border2); border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.notif-panel.open { display: block; }

/* На узком экране панель 340px не помещается и уезжает за край.
   Прижимаем к правому краю окна и ограничиваем шириной вьюпорта. */
@media (max-width: 560px) {
  .notif-panel {
    position: fixed; top: 64px; right: 10px; left: 10px;
    width: auto; max-height: 70vh;
  }
}
.notif-head {
  padding: 12px 14px; font-size: 9px; letter-spacing: 1px; color: var(--muted);
  font-weight: 700; border-bottom: 1px solid var(--border);
}
.notif-new { color: var(--green); letter-spacing: 0; font-size: 9px; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 11px; }
.notif-item {
  display: block; padding: 11px 14px; border-bottom: 1px solid var(--border);
  text-decoration: none; transition: background .12s;
}
.notif-item:hover { background: var(--s2); }
.notif-item-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.notif-author { font-size: 10px; font-weight: 700; color: var(--text); }
.notif-time { font-size: 9px; color: var(--muted2); white-space: nowrap; }
.notif-text { font-size: 11px; color: var(--muted); line-height: 1.45; }
.notif-all {
  display: block; padding: 11px 14px; text-align: center; font-size: 10px;
  color: var(--purple2); text-decoration: none; font-weight: 600;
}
.notif-all:hover { color: var(--text); }

/* ==== Аватар с логотипом и кликабельный профиль ==== */
.topbar-avatar img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 3px; }
a.topbar-user { text-decoration: none; transition: border-color .15s, background .15s; }
a.topbar-user:hover { border-color: var(--border2); background: var(--s2); }
@media (max-width: 640px) { .notif-panel { width: calc(100vw - 32px); right: -8px; } }
