/* Freshli Chef — standalone PWA */

/* :root → css/tokens.css [2026-06-12] */ 
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100vh;
  /* На mobile (TG WebView, телефон) занимает всю ширину.
     На desktop / iPad центруется max-width 480 — иначе всё растянуто. */
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
}

/* Tab-bar на десктопе тоже центрировать с тем же max-width */
.tabbar {
  max-width: 480px;
  margin: 0 auto;
}

/* ========== Boot loader ========== */
.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.boot-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Typography ========== */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.3px; line-height: 1.15; }
.h1 { font-size: 32px; }
.h2 { font-size: 26px; }
.muted { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.label-cap { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); }

/* ========== Buttons ========== */
.btn {
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* ========== Welcome screen ========== */
.welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 8px 24px;
}
.welcome-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.welcome-head .star {
  color: var(--orange);
  font-size: 22px;
  line-height: 1;
}
.welcome-head .logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.welcome-step {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 24px;
  letter-spacing: 0.6px;
}
.welcome-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.5px;
  line-height: 1.12;
}
.welcome-sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}
.welcome-list {
  margin-top: 24px;
  list-style: none;
  font-size: 14px;
  color: var(--text-2);
  line-height: 2;
}
.welcome-list li::before {
  content: '✦';
  color: var(--orange);
  margin-right: 8px;
}
.welcome-cta {
  margin-top: auto;
}

/* ========== Status / dev marker ========== */
.dev-marker {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--amber);
  color: #fff;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  z-index: 100;
  letter-spacing: 0.5px;
}
body.has-dev-marker #app { padding-top: 30px; }

/* ========== Screen wrapper ========== */
.screen { padding-bottom: 100px; }

/* ========== Greeting + context ========== */
.greeting { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.greeting svg { color: var(--orange); flex-shrink: 0; }
.context {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding: 12px 14px;
    background: var(--bg-soft); border-radius: 14px;
    font-size: 13px; color: var(--text-2);
}
.context .left { display: flex; align-items: center; gap: 8px; }
.context .dot { width: 6px; height: 6px; background: var(--text); border-radius: 50%; }
.context .dot.off { background: var(--text-3); }
.context .switch { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text); cursor: pointer; }

/* ========== Prompt card ========== */
.prompt {
    margin-top: 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 22px; padding: 16px 16px 12px;
}
.prompt-input {
    width: 100%; border: none; outline: none; background: transparent;
    font-family: inherit; font-size: 16px; color: var(--text);
    padding: 4px 0 12px; resize: none; min-height: 48px;
}
.prompt-input::placeholder { color: var(--text-3); }
.prompt-row { display: flex; justify-content: space-between; align-items: center; }
.prompt-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer; color: var(--text-2);
    border-radius: 10px; transition: background 0.15s ease;
}
.icon-btn:active { background: var(--bg-soft); }
.send-btn {
    width: 38px; height: 38px;
    background: var(--accent); color: #fff;
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { opacity: 0.3; cursor: default; }

/* ========== Chips ========== */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.chip {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 11px 16px;
    font-size: 14px; font-weight: 500; color: var(--text);
    cursor: pointer; min-height: 44px;
    transition: transform 0.12s ease;
}
.chip:active { transform: scale(0.97); }
.chips .chip:last-child:nth-child(odd) { grid-column: span 2; }
.chip svg { color: var(--text-2); flex-shrink: 0; }
.chip .badge {
    background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 8px; margin-left: 2px;
}

/* ========== Section labels ========== */
.section-label {
    margin-top: 28px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3);
}

/* ========== Glance KPI ========== */
.glance { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gcard {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 16px 14px;
    min-height: 96px;
    display: flex; flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gcard:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.gcard-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    font-weight: 500;
}
.gcard-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-1);
    line-height: 1.15;
}
.gcard-delta { font-size: 11px; margin-top: 2px; color: var(--text-2); font-weight: 500; }
.gcard-delta.neg { color: var(--red); }
.gcard-delta-yoy { font-size: 10px; margin-top: 1px; color: var(--text-3, #888); font-weight: 500; opacity: 0.8; }
.gcard-delta-yoy.neg { color: var(--red); }

/* ========== Info / error cards ========== */
.info-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 18px;
}
.info-card-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.info-card p { font-size: 14px; color: var(--text-2); line-height: 1.45; }

.error-card {
    background: rgba(197,58,58,0.05); border: 1px solid rgba(197,58,58,0.2);
    border-radius: 16px; padding: 18px; margin-top: 24px; text-align: center;
}
.error-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.error-msg { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }

/* ========== Alert cards ========== */
.alert-card {
    margin-top: 14px; padding: 18px; border-radius: 18px;
    background: var(--bg-card); border: 1px solid var(--border);
}
.alert-card.alert-danger { background: rgba(197,58,58,0.05); border-color: rgba(197,58,58,0.2); }
.alert-card.alert-warn { background: rgba(197,138,27,0.06); border-color: rgba(197,138,27,0.25); }
.alert-card.alert-idea { background: rgba(45,140,90,0.05); border-color: rgba(45,140,90,0.2); }
.alert-pill {
    display: inline-block; font-size: 10px; font-weight: 700;
    letter-spacing: 0.8px; padding: 4px 10px; border-radius: 8px;
    text-transform: uppercase; color: #fff;
}
.alert-card.alert-danger .alert-pill { background: var(--red); }
.alert-card.alert-warn .alert-pill { background: var(--amber); }
.alert-card.alert-idea .alert-pill { background: var(--text); color: var(--bg); }
.alert-card h3 { font-size: 16px; font-weight: 700; margin-top: 10px; line-height: 1.3; }
.alert-card p { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.4; }

/* ========== Profile ========== */
.profile-head {
    display: flex; align-items: center; gap: 14px; margin-top: 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 18px;
}
.profile-avatar {
    width: 56px; height: 56px;
    background: var(--accent); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px;
}
.profile-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 0 18px; margin-top: 14px;
}
.profile-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }

/* ========== Tab-bar ========== */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
    display: flex; justify-content: space-around;
    padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
}
.tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    flex: 1; padding: 6px 0;
    font-size: 11px; font-weight: 500; color: var(--text-3);
    cursor: pointer; line-height: 1.2;
    transition: color 0.15s ease;
}
.tab-item.active { color: var(--text); }
.tab-item svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ========== List rows (used inside sheets and other lists) ========== */
.list-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
}
.list-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
    cursor: pointer; min-height: 60px;
    transition: background 0.15s ease;
}
.list-row:last-child { border-bottom: none; }
.list-row:active { background: var(--bg-soft); }
.list-row .row-name { font-size: 14px; font-weight: 600; }
.list-row .row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.list-row svg { color: var(--text-3); flex-shrink: 0; width: 16px; height: 16px; }

/* ========== Bottom sheet ========== */
.sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 9999;
    display: flex; align-items: flex-end; justify-content: center;
    pointer-events: none;
    transition: background 0.22s ease;
}
.sheet-overlay.open { background: rgba(0,0,0,0.45); pointer-events: auto; }
.sheet {
    width: 100%; max-width: 520px; background: var(--bg);
    border-radius: 22px 22px 0 0;
    padding: 8px 22px 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.2, 0.85, 0.3, 1);
    max-height: 85vh; overflow-y: auto;
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-grip { width: 36px; height: 4px; background: rgba(0,0,0,0.15); border-radius: 2px; margin: 6px auto 16px; }
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.sheet-body { font-size: 14px; color: var(--text); }

/* ========== Toast ========== */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 60px);
    background: rgba(26,26,26,0.94); color: #fff;
    padding: 12px 18px; border-radius: 14px;
    font-size: 14px; font-weight: 500; line-height: 1.35;
    max-width: calc(100% - 32px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0; z-index: 10000; pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.2, 0.85, 0.3, 1), opacity 0.25s ease;
}
.app-toast.open { transform: translate(-50%, 0); opacity: 1; }
.app-toast.error { background: #b32424; }
.app-toast.success { background: var(--text); }

/* ========== Chat screen ========== */
.chat-screen {
    display: flex; flex-direction: column;
    height: 100vh;
    /* Tab-bar (~64px) + 14px breathing gap + safe-area, so the composer
       has visible space above the bottom tab-bar. */
    padding: 0 18px calc(78px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
}
.chat-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-head-left { display: flex; align-items: center; gap: 10px; }
.chat-head-star { color: var(--orange); display: flex; }
.chat-head-title { font-size: 16px; font-weight: 700; }
.chat-head-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.chat-reset-btn {
    width: 36px; height: 36px;
    background: var(--bg-soft); color: var(--text-2);
    border: none; border-radius: 10px;
    cursor: pointer; font-size: 18px;
}
.chat-reset-btn:active { background: var(--border); }

.chat-stream {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 0;
    display: flex; flex-direction: column; gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.45;
    word-wrap: break-word;
}
.bubble.user {
    align-self: flex-end;
    background: var(--accent); color: #fff;
    border-bottom-right-radius: 6px;
}
.bubble.assistant {
    align-self: flex-start;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}
.bubble.typing {
    display: inline-flex; gap: 4px;
    padding: 14px 16px;
}
.bubble.typing span {
    width: 7px; height: 7px;
    background: var(--text-3); border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.chat-compose {
    flex-shrink: 0;
    position: relative;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
    padding: 14px 16px 12px;
    margin: 12px 0 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.chat-compose textarea {
    flex: 1 1 100%; min-width: 0;
    min-height: 52px; max-height: 200px;
    border: none; border-radius: 0;
    padding: 4px 0 8px;
    font-family: inherit; font-size: 16px; line-height: 1.4;
    background: transparent; color: var(--text);
    resize: none; outline: none;
}
.chat-compose textarea::placeholder { color: var(--text-3); }
.chat-compose textarea:focus { border-color: transparent; }
.chat-compose .chat-mic { margin-left: auto; }
.chat-send {
    width: 40px; height: 40px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: opacity 0.15s ease;
}
.chat-send:disabled { opacity: 0.3; cursor: default; }

/* Mic button in chat composer */
.chat-mic {
    width: 40px; height: 40px;
    background: var(--bg-card); color: var(--text-2);
    border: 1px solid var(--border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.15s ease;
}
.chat-mic:active { background: var(--bg-soft); }
.chat-mic.recording {
    background: #e3342f; color: #fff; border-color: #e3342f;
    animation: pulse-rec 1.1s ease-in-out infinite;
}
@keyframes pulse-rec {
    0%, 100% { box-shadow: 0 0 0 0 rgba(227,52,47,0.55); }
    50%      { box-shadow: 0 0 0 10px rgba(227,52,47,0); }
}

/* Recording overlay (chat) */
.chat-rec-overlay {
    position: fixed;
    left: 50%; bottom: 96px;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: rgba(20,20,20,0.92); color: #fff;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 50;
    pointer-events: none;
}
.chat-rec-overlay[hidden] { display: none; }
.chat-rec-pulse {
    width: 10px; height: 10px; border-radius: 50%;
    background: #ff4d4d;
    animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.3); }
}

/* ========== Stage 6: Analytics + drill ========== */
.analytics-screen { padding-bottom: 100px; }
.analytics-title { margin: 14px 0 10px; }

.period-switcher {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 4px 0 10px; margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.period-switcher::-webkit-scrollbar { display: none; }
.period-chip {
    flex: 0 0 auto;
    padding: 7px 13px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 13px; color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.period-chip.active {
    background: var(--text); color: var(--bg);
    border-color: var(--text);
}

.kpi-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 4px;
}
.kpi-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 12px 14px;
    min-height: 76px;
}
.kpi-card.skeleton { opacity: 0.5; }
.kpi-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.kpi-sub   { font-size: 11px; color: var(--text-2); margin-top: 4px; line-height: 1.3; }
.kpi-sub.pos { color: var(--text); }
.kpi-sub.neg { color: #c0392b; }
.kpi-delta { font-weight: 600; margin-left: 4px; }
.kpi-delta.pos { color: var(--text); }
.kpi-delta.neg { color: #c0392b; }

.drill-list {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 4px;
}
.drill-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.drill-card:active { background: var(--bg-soft); }
.drill-ico  { color: var(--orange); flex-shrink: 0; }
.drill-text { flex: 1; min-width: 0; }
.drill-title { font-weight: 600; font-size: 15px; }
.drill-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.3; }
.drill-chev  { color: var(--text-3); flex-shrink: 0; }

/* Drill screen common */
.drill-screen { padding-bottom: 100px; }
.drill-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.drill-back {
    background: none; border: none;
    font-size: 14px; color: var(--text-2);
    cursor: pointer; padding: 6px 4px;
    display: inline-flex; align-items: center; gap: 4px;
}
.drill-back svg { width: 16px; height: 16px; }
.drill-h-title { font-size: 17px; font-weight: 700; flex: 1; }

/* Foodcost rows */
.fc-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.fc-row:last-child { border-bottom: none; }
.fc-row-top { display: flex; justify-content: space-between; align-items: baseline; }
.fc-name { font-weight: 600; font-size: 14px; }
.fc-pct { font-weight: 700; font-size: 14px; }
.fc-pct.pos  { color: var(--text); }
.fc-pct.warn { color: #c08e1e; }
.fc-pct.neg  { color: #c0392b; }
.fc-bar {
    margin: 5px 0 4px;
    height: 6px; background: var(--bg-soft, #efe9df); border-radius: 3px;
    overflow: hidden;
}
.fc-bar-fill { height: 100%; transition: width 0.3s ease; }
.fc-bar-fill.pos  { background: var(--text); }
.fc-bar-fill.warn { background: #c08e1e; }
.fc-bar-fill.neg  { background: #c0392b; }
.fc-meta { font-size: 11px; color: var(--text-3); }

.dish-row { display: flex; align-items: center; gap: 12px; }
.dish-info { flex: 1; min-width: 0; }

/* Waiters */
.waiter-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.waiter-row:last-child { border-bottom: none; }
.waiter-rank {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-soft, #efe9df);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text-2);
    flex-shrink: 0;
}
.waiter-row.rank-top    .waiter-rank { background: var(--text); color: var(--bg); }
.waiter-row.rank-bottom .waiter-rank { background: rgba(192,57,43,0.10); color: #c0392b; }
.waiter-info { flex: 1; min-width: 0; }

/* Heatmap */
.heatmap {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 36px repeat(12, 1fr);
    gap: 2px;
}
.hm-header { display: contents; }
.hm-header .hm-h {
    font-size: 10px; color: var(--text-3); text-align: center;
    padding: 4px 0;
}
.hm-row { display: contents; }
.hm-d {
    font-size: 11px; color: var(--text-2);
    display: flex; align-items: center;
    padding-right: 4px;
}
.hm-cell {
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    background-color: rgba(232,107,71,0.05);
    transition: transform 0.1s ease;
}
.hm-cell:active { transform: scale(0.9); }

/* Home plan/fact compact line */
.home-plan {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
}
.home-plan-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 4px;
}
.home-plan-title { font-size: 13px; font-weight: 700; color: var(--text); }
.home-plan-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.home-plan-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-right: auto;
}
.home-plan-source-badge.pos     { background: #E4F0E2; color: #2D6A40; }
.home-plan-source-badge.neutral { background: #ECE6D9; color: #5C5448; }
.home-plan-source-badge:empty   { display: none; }
.home-plan-meta { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.home-plan-status { font-size: 12px; margin-top: 6px; }
.home-plan-status .pos { color: var(--text); font-weight: 600; }
.home-plan-status .neg { color: #c0392b; font-weight: 600; }

/* Home «Сегодня важно» — top-3 priority actions from AI insights */
.home-priority {
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(232,107,71,0.08), rgba(232,107,71,0.02));
    border: 1px solid rgba(232,107,71,0.25);
    border-radius: 14px;
}
.home-priority-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.home-priority-icon { color: var(--orange); display: flex; }
.home-priority-title {
    font-size: 13px; font-weight: 700; color: var(--orange);
    text-transform: uppercase; letter-spacing: 0.04em;
    flex: 1;
}
.home-priority-status { font-size: 11px; color: var(--text-3); }
.priority-row {
    position: relative;
    padding: 10px 28px 10px 0;
    border-top: 1px solid rgba(232,107,71,0.15);
    cursor: pointer;
}
.priority-row:first-child { border-top: none; padding-top: 4px; }
.priority-row:active { opacity: 0.7; }
.priority-tag {
    display: block;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--orange);
    margin-bottom: 3px;
}
.priority-text {
    display: block;
    font-size: 13px; line-height: 1.4;
    color: var(--text);
}
.priority-chev {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    color: var(--text-3);
    display: flex; align-items: center;
}

/* Ideas screen — aggregated AI recommendations from all drills */
.idea-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    cursor: pointer;
}
.idea-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.idea-icon { color: var(--orange); display: flex; }
.idea-title { font-weight: 700; font-size: 15px; flex: 1; }
.idea-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.idea-section:first-of-type {
    border-top: none;
    padding-top: 0;
}
.idea-section-h {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.idea-section-body { font-size: 13px; line-height: 1.5; color: var(--text); }
.idea-section-body p { margin: 0 0 4px; }
.idea-section-body ul { margin: 4px 0 4px 0; padding-left: 18px; }
.idea-section-body li { margin-bottom: 2px; }

/* Dynamics bars (vertical list of horizontal bars) */
.dyn-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.dyn-row {
    display: grid; grid-template-columns: 100px 1fr 90px;
    align-items: center; gap: 8px;
    font-size: 12px;
}
.dyn-date { color: var(--text-2); }
.dyn-bar-wrap { height: 14px; background: var(--bg-soft, #efe9df); border-radius: 7px; overflow: hidden; }
.dyn-bar-fill { height: 100%; transition: width 0.3s ease; }
.dyn-bar-fill.pos { background: var(--text); }
.dyn-bar-fill.neg { background: #c0392b; }
.dyn-val { text-align: right; font-weight: 600; }

/* Plan/fact progress bar — slim 8px line. Bar is scaled internally so fact always fits. */
.plan-bar {
    position: relative;
    height: 8px;
    background: #ECE6D9;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.plan-bar-fill {
    height: 100%;
    background: #3F8F5C;
    transition: width 0.4s ease;
    border-radius: 4px;
}
.plan-bar-marker {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 2px;
    background: #1F1B16;
    z-index: 2;
    opacity: 0.55;
}
.plan-bar-overflow-fill { display: none; }
.plan-meta {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-3);
    margin-top: 4px;
}

/* Status chip on plan block (right of title) */
.home-plan-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.home-plan-status-chip.pos    { background: #E4F0E2; color: #2D6A40; }
.home-plan-status-chip.neutral{ background: #ECE6D9; color: #5C5448; }
.home-plan-status-chip.warn   { background: #FCE7CC; color: #8C5A1F; }
.home-plan-status-chip.neg    { background: #F8D9D4; color: #8C2A1F; }

/* Forecast explanation block under the plan bar */
.home-plan-yoy {
    margin-top: 10px;
}
.muted-inline { color: var(--text-3); }
.plan-forecast {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #E8E0D2;
}
.plan-forecast-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.plan-forecast-line {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
}
.plan-forecast-line.muted-inline {
    color: var(--text-3);
    font-size: 11px;
}
.plan-forecast-line .pos { color: #2D6A40; font-weight: 600; }
.plan-forecast-line .neg { color: #8C2A1F; font-weight: 600; }
.plan-forecast-line .warn-inline { color: #C97A2B; }
.plan-forecast-line .plan-inline { color: var(--text-2); font-weight: 600; }
.plan-forecast-line + .plan-forecast-line { margin-top: 3px; }

/* 6-cell glance — uses base .gcard now */
.glance.glance-6 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .glance.glance-6 { grid-template-columns: repeat(3, 1fr); } }
.gcard-unit { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 4px; }
.gcard-muted { opacity: 0.55; }

/* Critical-only chip on Home (P0/P1 escalation). Hidden by default. */
.home-critical-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 8px 0;
    background: #FFF4E6;
    border: 1px solid #E8A745;
    border-radius: 12px;
    font-size: 13px;
    color: #1F1B16;
    cursor: pointer;
    min-height: 44px;
}
.home-critical-chip[hidden] { display: none !important; }
.home-critical-icon { color: #B33A2A; font-size: 16px; }
.home-critical-text { flex: 1; font-weight: 500; }
.home-critical-arrow { color: var(--text-3); font-size: 16px; }

/* Period segmented control above KPI grid */
.period-segments {
    display: flex;
    gap: 6px;
    margin: 6px 0 8px;
    background: #ECE6D9;
    border-radius: 10px;
    padding: 3px;
}
.period-seg {
    flex: 1;
    padding: 7px 8px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #5C5448;
    border-radius: 8px;
    cursor: pointer;
}
.period-seg.active {
    background: #FFFDF8;
    color: #1F1B16;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(31,27,22,0.06);
}
.glance-loading { opacity: 0.5; pointer-events: none; }

/* Note under KPI grid when sample is too small */
.glance-note {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    padding: 4px 8px;
}

/* AI insight card — used on every drill */
.insight-card {
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(232,107,71,0.06), rgba(232,107,71,0.02));
    border: 1px solid rgba(232,107,71,0.25);
    border-radius: 14px;
}
.insight-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.insight-icon { font-size: 16px; }
.insight-title {
    font-size: 13px; font-weight: 700; color: var(--orange);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.insight-status { margin-left: auto; font-size: 11px; }
.insight-body { font-size: 13px; line-height: 1.5; color: var(--text); }
.insight-h { font-weight: 700; margin-top: 10px; margin-bottom: 4px; font-size: 13px; }
.insight-h:first-child { margin-top: 0; }
.insight-p { margin: 0 0 6px; }
.insight-list { margin: 4px 0 6px 0; padding-left: 18px; }
.insight-list li { margin-bottom: 3px; }
.insight-spacer { height: 4px; }
.insight-skeleton { display: flex; flex-direction: column; gap: 6px; }
.insight-skeleton-line {
    height: 10px; border-radius: 5px;
    background: linear-gradient(90deg, rgba(232,107,71,0.08), rgba(232,107,71,0.18), rgba(232,107,71,0.08));
    background-size: 200% 100%;
    animation: ins-shimmer 1.4s ease-in-out infinite;
}
.insight-skeleton-line.short { width: 60%; }
@keyframes ins-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Efficiency drill — waiter drops + shift load */
.eff-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    margin-top: 8px;
}
.eff-card-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 10px;
}
.eff-name { font-weight: 700; font-size: 15px; }
.eff-sev { font-size: 12px; font-weight: 700; }
.eff-sev.warn { color: #c08e1e; }
.eff-sev.neg  { color: #c0392b; }
.eff-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-soft, #efe9df);
    border-radius: 10px;
}
.eff-stat-l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.eff-stat-v { font-size: 15px; font-weight: 700; margin-top: 2px; }
.eff-stat-base { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.eff-hyp-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.muted-inline { color: var(--text-3); font-size: 11px; }
.eff-hyp-list {
    margin: 0; padding-left: 18px;
    font-size: 13px; color: var(--text); line-height: 1.5;
}
.eff-hyp-list li { margin-bottom: 3px; }

.shift-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.shift-row:last-child { border-bottom: none; }
.shift-hour {
    font-size: 13px; font-weight: 700;
    width: 50px; flex-shrink: 0;
    color: var(--text-2);
}
.shift-info { flex: 1; min-width: 0; }
.shift-drop { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.shift-drop.warn { color: #c08e1e; }
.shift-drop.neg  { color: #c0392b; }

/* Staff limits drill rows */
.staff-row {
    display: flex; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.staff-row:last-child { border-bottom: none; }
.staff-status {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-soft, #efe9df);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.staff-status.pos  { background: rgba(42,138,62,0.10); color: var(--text); }
.staff-status.warn { background: rgba(192,142,30,0.10); color: #c08e1e; }
.staff-status.neg  { background: rgba(192,57,43,0.10); color: #c0392b; }
.staff-info { flex: 1; min-width: 0; }
.row-note { font-size: 11px; color: var(--text-3); margin-top: 4px; font-style: italic; line-height: 1.3; }
.row-sub.pos { color: var(--text); }
.row-sub.warn { color: #c08e1e; }
.row-sub.neg { color: #c0392b; }

/* Home prompt-card voice button — same recording state */
#prompt-voice.recording {
    background: #e3342f; color: #fff; border-radius: 50%;
    animation: pulse-rec 1.1s ease-in-out infinite;
}

/* Tool-call status inline in assistant bubbles */
.tool-status-list {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 8px;
    font-size: 12px; line-height: 1.35;
}
.tool-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--bg-soft, #f0eae0);
    border-radius: 999px;
    color: var(--text-2);
    width: fit-content;
    max-width: 100%;
    word-break: break-word;
}
.tool-status.running { color: var(--text-2); }
.tool-status.done    { color: var(--text); background: rgba(42,138,62,0.10); }
.tool-status.fail    { color: #c0392b; background: rgba(192,57,43,0.10); }
.tool-status .ts-icon {
    display: inline-block; min-width: 12px; text-align: center;
    font-weight: 600;
}
.tool-status.running .ts-icon {
    animation: spin 1.2s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}
.bubble.assistant .bubble-text + .tool-status-list,
.bubble.assistant .tool-status-list:not(:first-child) { margin-top: 8px; margin-bottom: 0; }

/* Pulsing dots shown after tool completes, before final text streams in.
   Without it, the user sees a frozen "✓ tool" and thinks the chat is stuck. */
.tool-thinking {
    display: inline-flex; gap: 5px;
    padding: 6px 2px 2px;
}
.tool-thinking span {
    width: 6px; height: 6px;
    background: var(--text-3); border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.tool-thinking span:nth-child(2) { animation-delay: 0.2s; }
.tool-thinking span:nth-child(3) { animation-delay: 0.4s; }

.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-2);
}
.chat-empty-star { color: var(--orange); display: flex; justify-content: center; margin-bottom: 10px; }
.chat-empty h3 { font-size: 22px; margin-bottom: 8px; color: var(--text); }
.chat-empty p { font-size: 14px; line-height: 1.5; max-width: 280px; margin: 0 auto 24px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest-chip {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 9px 14px;
    font-size: 13px; color: var(--text);
    cursor: pointer; font-family: inherit;
    transition: background 0.15s ease;
}
.suggest-chip:active { background: var(--bg-soft); }

/* === Alert cards (P0/P1) — экран Срочное === */
.alert-card.alert-p0 {
    background: rgba(197,58,58,0.06);
    border-color: rgba(197,58,58,0.22);
}
.alert-card.alert-p1 {
    background: rgba(197,138,27,0.05);
    border-color: rgba(197,138,27,0.20);
}
.alert-pill-p0 { background: var(--red); }
.alert-pill-p1 { background: var(--amber); }
.alert-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.alert-period { font-size: 11px; color: var(--text-3); }
.alert-title {
    font-size: 15px; font-weight: 700;
    margin-top: 10px; line-height: 1.35;
}
.alert-body {
    margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--text-2);
}
.alert-body p { margin: 8px 0; }
.alert-body h3 { font-size: 14px; font-weight: 700; margin-top: 14px; }
.alert-body h4 { font-size: 13px; font-weight: 700; margin-top: 12px; }
.alert-body ul { margin: 6px 0 6px 20px; padding: 0; list-style: disc; }
.alert-body li { margin: 4px 0; }
.alert-body b { color: var(--text); }
.alert-actions {
    display: flex; gap: 8px; margin-top: 14px;
}
.alert-actions .btn-secondary,
.alert-actions .btn-primary {
    flex: 1; font-size: 13px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
    cursor: pointer;
}
.alert-actions .btn-primary {
    background: var(--text); color: var(--bg); border-color: var(--text);
}
.alert-actions button:disabled { opacity: 0.6; cursor: default; }
.alert-section-label {
    font-size: 11px; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-top: 6px; margin-bottom: 4px;
}
.alert-empty {
    margin-top: 28px; padding: 22px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; text-align: center;
}
.alert-empty-title { font-size: 17px; font-weight: 700; }
.alert-empty-sub { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* === Alert close-form (inline note) === */
.alert-close-form {
    margin-top: 12px;
}
.alert-note-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    min-height: 56px;
    outline: none;
}
.alert-note-input:focus {
    border-color: var(--text-2);
}
.alert-close-form .alert-actions {
    margin-top: 10px;
}
/* === ABC matrix tags (без эмодзи) === */
.matrix-tag {
    display: inline-block; font-size: 10px; font-weight: 700;
    letter-spacing: 0.4px; padding: 2px 6px; border-radius: 6px;
    margin-left: 6px; text-transform: uppercase; vertical-align: middle;
}
.matrix-tag.matrix-star    { background: rgba(45,140,90,0.15); color: #2D6A40; }
.matrix-tag.matrix-cash_cow { background: rgba(70,108,180,0.12); color: #4467AD; }
.matrix-tag.matrix-horse,
.matrix-tag.matrix-workhorse { background: rgba(197,138,27,0.15); color: #8C5C0E; }
.matrix-tag.matrix-dog     { background: rgba(160,160,160,0.18); color: #888; }

/* Подпись «план» под маркером 100% на план-баре */
.plan-bar-marker {
    position: relative;
}
.plan-bar-marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-3);
    margin-top: 2px;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.4px;
}

/* === Тренды (drill trends) bar-chart === */
.trend-bars { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.trend-row {
    display: grid;
    grid-template-columns: 56px 1fr 80px 50px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
}
.trend-label { color: var(--text-2); }
.trend-bar-track { height: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.trend-bar-fill { height: 100%; background: var(--text); border-radius: 3px; }
.trend-val { text-align: right; color: var(--text); font-weight: 500; }
.trend-delta { text-align: right; font-weight: 600; }
.trend-delta.pos { color: #2D6A40; }
.trend-delta.neg { color: #8C2A1F; }

/* Rules-based insights (v68+) — list of small cards under each drill */
.insight-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 6px;
}
.insight-card {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.insight-card.insight-warn {
    background: linear-gradient(135deg, rgba(232,107,71,0.07), rgba(232,107,71,0.02));
    border-color: rgba(232,107,71,0.30);
}
.insight-card.insight-info {
    background: var(--bg-card);
    border-color: var(--border);
}
.insight-card .insight-kind {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-2); margin-bottom: 6px;
}
.insight-card.insight-warn .insight-kind { color: var(--orange, #E86B47); }
.insight-card .insight-text {
    font-size: 13px; line-height: 1.5; color: var(--text);
}

/* Severity dots — заменяют 🔴🟡🟢 эмодзи в drill-ах */
.dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: 1px;
}
.dot-pos { background: #4d9c3a; }     /* good — green */
.dot-warn { background: #d8a317; }    /* warning — amber */
.dot-neg { background: #c0392b; }     /* bad — red */
.dot-neutral { background: #9c9485; } /* neutral — muted */

/* Rank-circle для топ-связок (заменяет 🥇🥈🥉) */
.rank-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
}
.rank-circle.gold { background: #f1c43a; color: #5a3e08; }
.rank-circle.silver { background: #c4c4c4; color: #2e2e2e; }
.rank-circle.bronze { background: #cd7f32; color: #3d1f00; }

/* === Desktop shell (>=1024px) — Freshli style: sidebar | main (контент + чат снизу) === */
@media (min-width: 1024px) {
  body.desktop-mode {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-areas: "sidebar main";
    grid-template-rows: 100vh;
    min-height: 100vh;
    max-width: 1640px;
    margin: 0 auto;
    background: #faf4e8;
  }
  body.desktop-mode #desktop-sidebar { grid-area: sidebar; }
  body.desktop-mode #desktop-main    { grid-area: main; }

  body.desktop-mode #desktop-sidebar {
    background: linear-gradient(180deg, #f0e7d6 0%, #ece2cf 100%);
    border-right: 1px solid rgba(140, 100, 60, 0.12);
    padding: 24px 16px;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  /* Main wrapper — flex column: scrollable content (#app) + sticky chat-bottom. */
  body.desktop-mode #desktop-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: transparent;
  }

  body.desktop-mode #app {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-width: 820px !important;
    margin: 0 auto !important;
    width: 100%;
    padding: 36px 36px 28px;
    box-sizing: border-box;
    background: transparent;
  }

  /* Чат-панель снизу. Default mode — фиксированная высота, видна как «командная строка».
     Чат-mode (/chat) — расширяется на всю main, dashboard скрыт. */
  body.desktop-mode #desktop-chat {
    flex: 0 0 auto;
    height: 360px;
    border-top: 1px solid rgba(140, 100, 60, 0.14);
    background: #fffefa;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  body.desktop-mode #desktop-chat .chat-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
  }
  body.desktop-mode #desktop-chat .chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
  }
  body.desktop-mode #desktop-chat .chat-compose {
    border-top: 1px solid var(--border-soft);
    padding: 12px 18px;
  }
  body.desktop-mode #desktop-chat .chat-head {
    display: none; /* в desktop-mode заголовок чата дублирует sidebar — скрываем */
  }

  /* Chat-mode: dashboard скрыт, чат занимает весь main. */
  body.desktop-mode.layout-chat #app { display: none; }
  body.desktop-mode.layout-chat #desktop-chat {
    flex: 1 1 auto;
    height: auto;
    border-top: none;
    background: transparent;
  }
  body.desktop-mode.layout-chat #desktop-chat .chat-screen {
    background: transparent;
  }

  /* Mobile tabbar скрыт на desktop. */
  body.desktop-mode .tabbar { display: none !important; }
}

/* === Sidebar внутренние элементы (Freshli warm restaurant style) === */
.ds-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 18px;
}
.ds-brand-mark {
  width: 20px; height: 20px;
  color: var(--text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ds-brand-mark svg {
  width: 18px; height: 18px;
}
.ds-brand-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  font-family: var(--serif, "Source Serif Pro", Georgia, serif);
  letter-spacing: 0.01em;
}
.ds-brand-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

/* === Multi-restaurant selector (header) === */
.ds-brand-text { position: relative; min-width: 0; }
.ds-rest-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 2px 6px 2px 4px;
  max-width: 160px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(80, 60, 40, 0.72);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ds-rest-switch:hover { background: rgba(31, 30, 29, 0.08); border-color: rgba(31, 30, 29, 0.22); }
.ds-rest-switch svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.8; }
.ds-rest-switch .ds-rest-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px;
}
.ds-rest-caret { opacity: 0.55; transition: transform 0.15s ease; }
.ds-rest-switch[aria-expanded="true"] .ds-rest-caret { transform: rotate(180deg); }

.ds-rest-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1200;
  min-width: 200px;
  max-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: #F8F8F6;
  border: 1px solid rgba(31, 30, 29, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(40, 35, 20, 0.18);
}
.ds-rest-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #3a2e22;
  transition: background 0.1s ease;
}
.ds-rest-menu-item:hover { background: rgba(31, 30, 29, 0.1); }
.ds-rest-menu-item.active { background: rgba(31, 30, 29, 0.16); font-weight: 600; }
.ds-rest-menu-ic { display: inline-flex; color: var(--orange); flex-shrink: 0; }
.ds-rest-menu-ic svg { width: 16px; height: 16px; }
.ds-rest-menu-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-rest-menu-tag {
  font-size: 10px;
  color: rgba(120, 90, 50, 0.7);
  background: rgba(180, 140, 60, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ds-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(140, 100, 60, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: #3a2e22;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 22px;
  transition: all 160ms ease;
  box-shadow: 0 1px 2px rgba(140, 100, 60, 0.06);
}
.ds-new-chat:hover {
  background: linear-gradient(135deg, #d97f4b 0%, #b85a2c 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(184, 90, 44, 0.28);
  transform: translateY(-1px);
}
.ds-new-chat:hover svg { color: #fff; }

.ds-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(140, 100, 60, 0.65);
  padding: 0 10px;
  margin: 18px 0 8px;
}

.ds-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ds-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: #3a2e22;
  font-size: 13.5px;
  user-select: none;
  transition: all 140ms ease;
}
.ds-nav-item:hover {
  background: rgba(217, 127, 75, 0.08);
  color: #b85a2c;
}
.ds-nav-item.active {
  background: linear-gradient(135deg, rgba(217, 127, 75, 0.15) 0%, rgba(184, 90, 44, 0.18) 100%);
  color: #b85a2c;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #b85a2c;
}
.ds-nav-item.active svg { color: #b85a2c; }
.ds-nav-item svg { flex-shrink: 0; opacity: 0.65; transition: opacity 140ms; }
.ds-nav-item:hover svg, .ds-nav-item.active svg { opacity: 1; }

.ds-nav-empty {
  font-size: 11.5px;
  color: rgba(140, 100, 60, 0.45);
  padding: 8px 12px;
  font-style: italic;
  font-family: var(--serif, Georgia, serif);
}

.ds-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(140, 100, 60, 0.14);
}
  /* Hide desktop shell on login/onboarding routes */
  body.desktop-mode.layout-login #desktop-sidebar,
  body.desktop-mode.layout-login #desktop-chat { display: none !important; }
  body.desktop-mode.layout-login #desktop-main { grid-template-columns: 1fr; }

/* 14-cell KPI glance (mobile 2 cols, desktop 4-7 cols) */
.glance.glance-14 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 720px) {
    .glance.glance-14 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
    .glance.glance-14 { grid-template-columns: repeat(7, 1fr); }
}

/* big cards с группировкой по секциям */
.glance.glance-14 {
    display: block;
    margin: 16px 0;
}
.gsection-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    margin: 24px 0 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.gsection-title:first-child { margin-top: 0; }
.gsection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 720px) {
    .gsection-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1100px) {
    .gsection-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
}
/* .gcard-big = alias for base .gcard, identical style */

/* Hide desktop chat panel completely — CEO решил он не нужен */
body.desktop-mode #desktop-chat { display: none !important; }
body.desktop-mode #desktop-main { grid-template-rows: 1fr !important; }

/* AI card — единый стиль, тёплый бренд (cream + orange accent) */
.gcard.ai-operdir-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border: none;
    min-height: 120px;
    margin: 8px 0 14px;
}
.gcard.ai-operdir-card .aio-badges { margin-left: auto; display: flex; gap: 6px; }
.gcard.ai-operdir-card .aio-body { font-size: 14px; line-height: 1.5; margin-top: 8px; }
.gcard.ai-operdir-card .aio-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.gcard.ai-operdir-card:hover { transform: none; box-shadow: none; }

/* All cards in a row — same height */
.gsection-grid > .gcard { height: 100%; }
.gsection-grid { align-items: stretch; }
.gcard-delta, .gcard-delta-yoy {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gcard-delta { margin-top: auto; padding-top: 8px; }


/* Аналитика — collapsible widget sections */
.analytics-screen { padding-bottom: 40px; }
.analytics-title { margin: 12px 0 12px; }
.cache-badge .link-btn {
    background: none; border: none; cursor: pointer;
    color: #d97706; padding: 0 0 0 6px; font-size: 12px;
    text-decoration: underline; text-underline-offset: 2px;
}
.awidget { margin: 18px 0 8px; }
.awidget-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; cursor: pointer; user-select: none;
    border-bottom: 1px solid #EAE5DC;
    margin-bottom: 12px;
}
.awidget-title {
    font-size: 16px; font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.1px;
}
.awidget-arrow {
    color: var(--text-3);
    transition: transform 0.2s ease;
}
.awidget-arrow.open { transform: rotate(180deg); }
.awidget-body { padding-bottom: 4px; }
.gcard-value-small {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 4px;
    line-height: 1.3;
}
.gcard-link {
    font-size: 12px; color: #d97706;
    margin-top: auto; padding-top: 8px;
    font-weight: 500;
}
.gcard[data-nav] { cursor: pointer; }

/* FIX: единый 4col grid для analytics — */
.analytics-screen .gsection-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
}
@media (min-width: 720px) {
    .analytics-screen .gsection-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
.analytics-screen .awidget-title {
    font-size: 17px;
    font-weight: 600;
}
.analytics-screen .awidget-header {
    border-bottom: none;
    padding: 16px 0 8px;
    margin-bottom: 4px;
}
.analytics-screen .awidget-arrow svg { opacity: 0.5; }

/* Desktop wide-screen: убрать mobile-first max-width на #app */
body.desktop-mode #app {
    max-width: 100% !important;
    padding: 24px 32px;
    box-sizing: border-box;
}
body.desktop-mode {
    max-width: none !important;
}
/* Analytics на широком экране — больше cards в ряд */
@media (min-width: 1400px) {
    .analytics-screen .gsection-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}
@media (min-width: 1800px) {
    .analytics-screen .gsection-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}
/* Glance-14 на ширине */
@media (min-width: 1400px) {
    .gsection-grid:not(.analytics-screen .gsection-grid) {
        grid-template-columns: repeat(6, 1fr);
    }
}


/* ============================================================
   CLAUDE-CODE DESIGN POLISH (2026-05-21 v2)
   Тонкая настройка существующего стиля под Claude Code tokens.
   БЕЗ ломки сетки и layout'а — только палитра/радиусы/типографика.
============================================================ */

/* :root → css/tokens.css [2026-06-12] */ 
/* Cards — увеличенный padding и видимая граница */
.gcard {
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
  box-shadow: none !important;
}
.gcard:hover {
  border-color: #B8B5A8 !important;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(20,20,19,0.04) !important;
}

/* AI / hero card — побольше радиус (как в Claude cookie modal) */
.ai-operdir-card {
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  padding: 24px 26px !important;
}

/* Awidget (Аналитика секции) — Claude Code radius 24px */
.awidget {
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  background: var(--bg-card) !important;
  margin-bottom: 18px;
  overflow: hidden;
}
.awidget-header {
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--border-soft) !important;
}
.awidget-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-family: var(--serif), Georgia, serif !important;
}
.awidget-body {
  padding: 14px 16px !important;
}

/* Card values — серифные, как в Claude Code */
.gcard-value {
  font-family: var(--serif), Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 24px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.005em !important;
}
.gcard-label {
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--text-3) !important;
  font-weight: 500 !important;
  margin-bottom: 6px !important;
}
.gcard-delta {
  color: var(--text-3) !important;
  font-size: 11px !important;
}

/* Primary buttons (CTA) — чёрный фон, светлый текст */
.btn-primary,
.cta-primary,
.btn.primary,
button.primary {
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  border: 1px solid var(--accent) !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-weight: 500 !important;
}
.btn-primary:hover { background: #2A2A28 !important; }

/* Period chips — Claude Code минималистичные */
.period-chip {
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-2) !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
.period-chip.active {
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  border-color: var(--accent) !important;
}

/* Sidebar — чище */
body.desktop-mode #desktop-sidebar {
  background: var(--bg-card) !important;
  border-right: 1px solid var(--border) !important;
}

/* H1/H2 — серифные как Claude Code */
.serif.h2,
h2.h2,
.analytics-title {
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  color: var(--text) !important;
}

/* Section titles — серифные, 18-20px */
.gsection-title,
.label-cap {
  font-family: var(--serif), Georgia, serif !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  margin: 24px 0 12px !important;
}
.gsection-title:first-child { margin-top: 8px !important; }

/* Glance hero rail — больше воздуха между карточками */
.glance-14,
.gsection-grid {
  gap: 12px !important;
}


/* ============================================================
   FIX (2026-05-21 v2.1): AI card должна быть тёмной
   как Cookie settings modal в Claude Code
============================================================ */
.ai-operdir-card {
  background: #1F1E1B !important;      /* dark — like Claude cookie modal */
  border: 1px solid #2D2C28 !important;
  border-radius: 20px !important;
  padding: 24px 26px !important;
  color: #F8F8F6 !important;
}
.ai-operdir-card .aio-body,
.ai-operdir-card p,
.ai-operdir-card * {
  color: inherit !important;
}
.ai-operdir-card .aio-actions {
  margin-top: 14px !important;
  padding-top: 14px !important;
  border-top: 1px solid rgba(250,249,245,0.08) !important;
}
/* строки alerts внутри AI — белые с приглушённым цветом */
.ai-operdir-card .aio-actions > * {
  color: #F8F8F6 !important;
  opacity: 0.92 !important;
}
.ai-operdir-card .aio-actions .alert-amount,
.ai-operdir-card .aio-actions [class*="amount"],
.ai-operdir-card .aio-actions [class*="value"] {
  color: #F8F8F6 !important;
  font-family: var(--serif), Georgia, serif !important;
  font-weight: 500 !important;
}
.ai-operdir-card .aio-header,
.ai-operdir-card > div:first-child {
  color: #C9C8C2 !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}


/* ============================================================
   SETTINGS MODAL (Личный кабинет) — popup
   с Claude Code дизайном (2026-05-21)
============================================================ */
.settings-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 20, 19, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: sm-fade-in 160ms ease-out;
}
@keyframes sm-fade-in { from { opacity: 0 } to { opacity: 1 } }

.settings-modal {
    display: grid;
    grid-template-columns: 240px 1fr;
    width: min(960px, 92vw);
    height: min(720px, 86vh);
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(20,20,19,0.18);
    position: relative;
}

/* Left nav */
.sm-nav {
    background: var(--bg, #F8F8F6);
    border-right: 1px solid var(--border, #D1CFC5);
    padding: 18px 12px;
    overflow-y: auto;
}
.sm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 18px;
    border-bottom: 1px solid var(--border-soft, #E8E5DC);
    margin-bottom: 14px;
}
.sm-brand svg { color: var(--text, #121212); flex-shrink: 0; }
.sm-brand-title {
    font-family: var(--serif), Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #121212);
    line-height: 1.2;
}
.sm-brand-sub {
    font-size: 11px;
    color: var(--text-3, #8F8E87);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.sm-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3, #8F8E87);
    padding: 14px 10px 6px;
}
.sm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-2, #5C5B57);
    font-size: 14px;
    transition: background 80ms, color 80ms;
}
.sm-nav-item:hover {
    background: rgba(20,20,19,0.04);
    color: var(--text, #121212);
}
.sm-nav-item.active {
    background: var(--text, #121212);
    color: var(--accent-text, #F8F8F6);
}
.sm-nav-item.active svg { color: var(--accent-text, #F8F8F6); }
.sm-nav-item svg { flex-shrink: 0; }

/* Right content */
.sm-content {
    padding: 36px 40px;
    overflow-y: auto;
    position: relative;
}
.sm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border, #D1CFC5);
    background: var(--bg-card, #FFFFFF);
    color: var(--text-2, #5C5B57);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 80ms;
}
.sm-close:hover { background: var(--bg, #F8F8F6); color: var(--text, #121212); }

.sm-title {
    font-family: var(--serif), Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text, #121212);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.sm-sub {
    font-size: 14px;
    color: var(--text-2, #5C5B57);
    line-height: 1.5;
    margin-bottom: 24px;
}

.sm-form { display: grid; gap: 14px; max-width: 520px; }
.sm-field { display: grid; gap: 6px; }
.sm-field label {
    font-size: 12px;
    color: var(--text-3, #8F8E87);
    font-weight: 500;
}
.sm-field input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text, #121212);
    font-family: inherit;
}
.sm-field input:focus {
    outline: none;
    border-color: var(--text, #121212);
}
.sm-field input:disabled {
    background: var(--bg, #F8F8F6);
    color: var(--text-2, #5C5B57);
    cursor: not-allowed;
}

.sm-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.sm-btn-primary {
    background: var(--text, #121212);
    color: var(--accent-text, #F8F8F6);
    border: 1px solid var(--text, #121212);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 80ms;
}
.sm-btn-primary:hover:not(:disabled) { background: #2A2A28; }
.sm-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.sm-hint { font-size: 12px; color: var(--text-3, #8F8E87); }

.sm-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 12px;
    overflow: hidden;
}
.sm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft, #E8E5DC);
    background: var(--bg-card, #FFFFFF);
}
.sm-toggle-row:last-child { border-bottom: none; }
.sm-toggle-row b { font-size: 14px; color: var(--text, #121212); font-weight: 500; }
.sm-row-sub { font-size: 12px; color: var(--text-3, #8F8E87); margin-top: 2px; }

.sm-badge-on, .sm-badge-off {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}
.sm-badge-on { background: #E8F2EA; color: #2D8C5A; }
.sm-badge-off { background: var(--bg, #F8F8F6); color: var(--text-3, #8F8E87); border: 1px solid var(--border, #D1CFC5); }
.sm-arrow { color: var(--text-3, #8F8E87); font-size: 18px; }

.sm-plan-card {
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 12px;
    padding: 24px 28px;
    background: var(--bg, #F8F8F6);
    max-width: 360px;
}
.sm-plan-name {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3, #8F8E87);
    margin-bottom: 6px;
}
.sm-plan-price {
    font-family: var(--serif), Georgia, serif;
    font-size: 32px;
    font-weight: 500;
    color: var(--text, #121212);
    line-height: 1;
}
.sm-plan-price span {
    font-size: 14px;
    font-family: inherit;
    color: var(--text-3, #8F8E87);
    font-weight: 400;
}
.sm-plan-meta {
    font-size: 12px;
    color: var(--text-2, #5C5B57);
    margin-top: 10px;
}

/* Block sidebar scroll when modal open */
body.settings-open { overflow: hidden; }

/* Mobile: stack nav above content */
@media (max-width: 720px) {
    .settings-modal {
        grid-template-columns: 1fr;
        height: 100vh;
        width: 100vw;
        border-radius: 0;
    }
    .sm-nav { border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
    .sm-content { padding: 24px 20px; }
    .sm-brand { padding-bottom: 12px; margin-bottom: 8px; }
}


/* ============================================================
   CLAUDE.AI CHAT TOKENS (2026-05-21 v3 — final)
   Точные цвета с claude.ai (chat interface, не marketing).
   bg: #F8F8F6 · text: #121212 · border: rgba(10,10,10,0.09)
   Плотность данных СОХРАНЯЕТСЯ — без правок сетки/паддингов.
============================================================ */
/* :root → css/tokens.css [2026-06-12] */ 
/* Тонкий полировочный слой: убрать любые лишние тёплые тона */
body, html { background: #F8F8F6 !important; }
body.desktop-mode #desktop-sidebar { background: #FFFFFF !important; border-right: 1px solid rgba(10,10,10,0.09) !important; }

/* Active nav item в sidebar — был peach/cream, теперь нейтральный */
.ds-nav-item.active {
    background: rgba(18, 18, 18, 0.06) !important;
    color: #121212 !important;
}
.ds-nav-item.active svg { color: #121212 !important; }

/* Border radius — Claude.ai uses 9.6px (≈10px) on buttons */
.gcard, .awidget, .ai-operdir-card { border-color: rgba(10,10,10,0.09) !important; }
.period-chip, .sm-btn-primary, .sm-close, .sm-field input { border-radius: 10px !important; }

/* Settings modal — затемнение слегка темнее (Claude дарковый overlay) */
.settings-overlay { background: rgba(18, 18, 18, 0.55) !important; }

/* sidebar бренд-логотип молния — крупнее и чётче */
.ds-brand-mark { color: #121212 !important; }


/* ============================================================
   IMPORTS MODAL — drag-drop + preview + history (2026-05-21)
============================================================ */
.imports-modal .sm-content { padding: 32px 36px; }
.imp-info { padding: 14px; font-size: 12px; color: var(--text-2); }
.imp-info ul { margin: 6px 0 0 20px; }
.imp-info li { margin: 4px 0; }
.imp-info b { color: var(--text); }

.imp-drop {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 100ms, background 100ms;
    margin: 20px 0 12px;
}
.imp-drop:hover, .imp-drop.drag-over {
    border-color: var(--text);
    background: var(--bg);
}
.imp-drop-icon { color: var(--text-3); margin-bottom: 10px; }
.imp-drop-text { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.imp-link { color: var(--text); font-weight: 500; text-decoration: underline; }

.imp-loading { padding: 16px; color: var(--text-2); font-size: 14px; }
.imp-error {
    padding: 12px 16px; background: #FFF5F5; border: 1px solid #FECACA;
    border-radius: 8px; color: #C53A3A; font-size: 13px; margin: 12px 0;
}
.imp-success {
    padding: 12px 16px; background: #ECFDF5; border: 1px solid #A7F3D0;
    border-radius: 8px; color: #047857; font-size: 14px; font-weight: 500; margin: 12px 0;
}

.imp-preview-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0 8px;
    background: var(--bg-card);
}
.imp-preview-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.imp-preview-fmt { font-family: var(--serif), Georgia, serif; font-size: 18px; font-weight: 500; color: var(--text); }
.imp-preview-fn { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.imp-actions { display: flex; gap: 8px; }
.imp-btn-primary {
    background: var(--text); color: var(--accent-text);
    border: 1px solid var(--text); border-radius: 8px;
    padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.imp-btn-primary:hover { background: #2A2A28; }
.imp-btn-secondary {
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 16px; font-size: 14px; cursor: pointer;
}
.imp-btn-secondary:hover { background: var(--bg); }

.imp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.imp-stat {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--bg);
}
.imp-stat-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-3); font-weight: 500;
}
.imp-stat-val {
    font-family: var(--serif), Georgia, serif; font-size: 18px; font-weight: 500;
    color: var(--text); margin-top: 4px;
}

.imp-section { margin-top: 24px; }
.imp-section-title {
    font-family: var(--serif), Georgia, serif;
    font-size: 16px; font-weight: 500; color: var(--text);
    margin-bottom: 8px;
}

.imp-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.imp-table th {
    background: var(--bg); padding: 8px 12px; text-align: left;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-3); font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.imp-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.imp-table tr:last-child td { border-bottom: none; }
.imp-table .r { text-align: right; }


/* ============================================================
   ABC BADGES (drill/waiters + drill/abc) — 5-axis tags
============================================================ */
.abc-row {
    display: inline-flex;
    gap: 3px;
    margin-left: 10px;
    vertical-align: middle;
}
.abc-badge {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #FFFFFF;
    cursor: help;
}
.abc-a { background: #2D8C5A; }
.abc-b { background: #C58A1B; color: #FFFFFF; }
.abc-c { background: #C53A3A; }


/* ============================================================
   PLANNING SCREEN — budget table
============================================================ */
.planning-screen { padding: 0; }
.plan-controls { display: flex; align-items: center; gap: 14px; margin: 16px 0 12px; flex-wrap: wrap; }
.plan-period-pick { display: flex; align-items: center; gap: 8px; }
.plan-arrow {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); cursor: pointer; font-size: 14px;
}
.plan-arrow:hover { background: var(--bg); }
.plan-year { font-family: var(--serif), Georgia, serif; font-size: 18px; font-weight: 500; }
.plan-months { display: flex; gap: 4px; flex-wrap: wrap; }
.plan-month {
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2);
    padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.plan-month:hover { background: var(--bg); }
.plan-month.active { background: var(--text); color: var(--accent-text); border-color: var(--text); }

.plan-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.plan-btn {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
    border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.plan-btn:hover { background: var(--bg); }
.plan-btn.primary { background: var(--text); color: var(--accent-text); border-color: var(--text); }
.plan-btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.plan-status { font-size: 12px; color: var(--text-2); }

.plan-summary { margin-bottom: 16px; }
.plan-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-card);
}
.plan-kpi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.plan-kpi-val { font-family: var(--serif), Georgia, serif; font-size: 18px; font-weight: 500; color: var(--text); }

.plan-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.plan-table-scroll { overflow-x: auto; max-height: 65vh; overflow-y: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.plan-table th {
    background: var(--bg); padding: 8px 10px; text-align: left;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.plan-table th.r { text-align: right; }
.plan-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.plan-table td.r { text-align: right; }
.plan-table td.pname { font-weight: 500; min-width: 220px; }
.plan-table td.dim { color: var(--text-3); font-size: 11px; }
.plan-table td.pos { color: #2D8C5A; font-weight: 500; }
.plan-table td.neg { color: #C53A3A; font-weight: 500; }
.plan-table tr:hover { background: var(--bg); }

.plan-input {
    width: 100px;
    text-align: right;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--bg-card);
}
.plan-input:focus { outline: none; border-color: var(--text); }
.plan-input:placeholder-shown { color: var(--text-3); }

.plan-btn.auto {
    background: #F4F2EE;
    border: 1px solid rgba(10,10,10,0.09);
    color: #121212;
    font-weight: 500;
}
.plan-btn.auto:hover { background: #EDEAE2; }


/* ============================================================
   PERSONNEL SCREEN — 4 tabs (Сотр / Расп / Табель / Аналитика)
============================================================ */
.personnel-screen { padding: 0; }
.pers-tabs { display: flex; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.pers-tab {
    background: transparent; border: none; padding: 8px 14px;
    font-size: 14px; color: var(--text-2); cursor: pointer;
    border-bottom: 2px solid transparent; font-weight: 500;
    margin-bottom: -1px;
}
.pers-tab:hover { color: var(--text); }
.pers-tab.active { color: var(--text); border-bottom-color: var(--text); }

.pers-period { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.pers-body { margin-top: 14px; }

.pers-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-card);
    margin-bottom: 14px;
}
.pers-kpi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.pers-kpi-val { font-family: var(--serif), Georgia, serif; font-size: 18px; font-weight: 500; color: var(--text); }

.pers-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; flex-wrap: wrap; gap: 10px;
}
.role-pill {
    display: inline-block; padding: 3px 9px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px; font-size: 11px;
    color: var(--text-2); margin-right: 4px;
}
.pers-link {
    color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500;
    border-bottom: 1px solid var(--text-3);
}
.pers-link:hover { border-bottom-color: var(--text); }

.pers-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden;
}
.pers-table th {
    background: var(--bg); padding: 8px 10px; text-align: left;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.pers-table th.r { text-align: right; }
.pers-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.pers-table td.r { text-align: right; }
.pers-table td.dim { color: var(--text-3); font-size: 11px; }
.pers-table tr:hover { background: var(--bg); }

.pers-table-scroll { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
.sched-table th.d, .sched-table td.d { padding: 4px 6px; text-align: right; min-width: 28px; }
.sched-table td.d.has { background: rgba(45, 140, 90, 0.07); font-weight: 500; }
.sched-table td.d.dim { color: var(--text-3); }
.sched-table th.sticky-left, .sched-table td.sticky-left {
    position: sticky; left: 0; background: var(--bg-card); z-index: 1; min-width: 180px;
    border-right: 1px solid var(--border);
}
.sched-table th.sticky-left { background: var(--bg); }


/* ============================================================
   FIXES 2026-05-21 evening — quick polish
============================================================ */
/* Активный месяц/таб должен быть читаемым */
.plan-month.active,
.pers-tab.active,
.period-chip.active {
    background: #121212 !important;
    color: #F8F8F6 !important;
    border-color: #121212 !important;
}

/* Числа в таблицах: разрядные пробелы + табличные цифры + ₽ не переносится */
.plan-table td, .pers-table td,
.gcard-value, .plan-kpi-val, .pers-kpi-val,
.imp-stat-val {
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.plan-table td.pname { white-space: normal; }

.plan-input {
    font-feature-settings: 'tnum' 1;
    font-variant-numeric: tabular-nums;
}

/* RAG: источники из книг шефа */
.kb-sources-block {
    margin-top: 24px;
    padding: 16px 20px;
    border: 1px solid rgba(10,10,10,0.09);
    border-radius: 12px;
    background: #FBFAF6;
}
.kb-sources-head {
    font-weight: 600;
    color: #121212;
    margin-bottom: 8px;
    font-size: 14px;
}
.kb-sources-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kb-source-li {
    font-size: 13px;
    color: #444;
    padding: 2px 0;
}
.kb-book {
    color: #121212;
    font-weight: 500;
}
.kb-page {
    color: #888;
}
.kb-sources-note {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* === Поток 1: AI Dish Flow === */
.chef-dish-flow .cdf-block { margin-top: 16px; }
.chef-dish-flow .cdf-recap { font-size: 14px; color: var(--text-muted, #6b7280); margin-bottom: 12px; padding: 10px 14px; background: var(--surface-soft, #f6f6f6); border-radius: 8px; }
.chef-dish-flow .cdf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.chef-dish-flow .style-picker { margin: 16px 0; }
.chef-dish-flow .style-picker-title { font-size: 13px; color: var(--text-muted, #6b7280); margin-bottom: 8px; }

.style-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.style-chip { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); background: #fff; cursor: pointer; min-width: 140px; transition: all 0.15s; text-align: left; }
.style-chip:hover { border-color: var(--accent, #1f2937); }
.style-chip.active { background: var(--accent-soft, #eef2ff); border-color: var(--accent, #1f2937); }
.style-chip-label { font-weight: 600; font-size: 14px; }
.style-chip-hint { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 2px; line-height: 1.3; }

.concept-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 720px) { .concept-grid { grid-template-columns: 1fr 1fr 1fr; } }
.concept-card { padding: 14px 16px; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.concept-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.concept-name { font-weight: 700; font-size: 16px; }
.concept-meta { font-size: 12px; color: var(--text-muted, #6b7280); white-space: nowrap; }
.concept-hook { font-style: italic; color: var(--text-muted, #555); font-size: 13px; }
.concept-list { padding-left: 18px; margin: 4px 0; font-size: 13px; }
.concept-list li { margin: 2px 0; }
.concept-tech { font-size: 13px; }
.concept-why { font-size: 12px; color: var(--text-muted, #6b7280); }
.kb-sources { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border, #e5e7eb); }

.recipe-snapshot { padding: 12px 14px; background: var(--surface-soft, #f8f8f8); border-radius: 10px; margin-bottom: 12px; }
.recipe-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }

.chat-stream { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 8px 0; margin: 8px 0; }
.chat-msg { padding: 8px 12px; border-radius: 10px; max-width: 85%; font-size: 14px; line-height: 1.4; }
.chat-msg-user { align-self: flex-end; background: var(--accent, #1f2937); color: #fff; }
.chat-msg-ai { align-self: flex-start; background: var(--surface-soft, #f0f0f0); }
.chat-msg-text { white-space: pre-wrap; word-wrap: break-word; }

.ttk-head { padding: 12px 0; }
.ttk-name { font-weight: 700; font-size: 18px; }
.ttk-meta { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 4px; }
.ttk-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ttk-table th, .ttk-table td { padding: 6px 8px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; }
.ttk-table th { font-weight: 600; color: var(--text-muted, #6b7280); font-size: 11px; text-transform: uppercase; }
.ttk-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ttk-tech { padding-left: 20px; margin: 12px 0; font-size: 13px; }
.ttk-tech li { margin: 4px 0; }
.ttk-organ { font-size: 13px; margin: 8px 0; color: var(--text-muted, #555); }

.published-card { padding: 24px; text-align: center; background: var(--surface-soft, #f8f8f8); border-radius: 12px; margin: 24px 0; }
.published-title { font-size: 24px; font-weight: 700; color: var(--accent, #1f2937); margin-bottom: 8px; }
.published-name { font-size: 16px; margin-bottom: 12px; }

.chef-onb .onb-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font-size: 14px; font-family: inherit; }
.chef-onb .onb-err { margin-top: 12px; padding: 10px; background: #fee; border: 1px solid #fcc; border-radius: 6px; color: #c33; font-size: 13px; }
/* === /Поток 1 === */


/* === Поток 3: Money === */
.money-pnl .pnl-table-wrap { overflow-x: auto; margin-top: 12px; }
.money-pnl .pnl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.money-pnl .pnl-table th, .money-pnl .pnl-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border, #eee); }
.money-pnl .pnl-table th.cat-col, .money-pnl .pnl-table td.cat-col { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--bg, #fff); z-index: 1; }
.money-pnl .pnl-table tr.cat-gross  td { font-weight: 600; background: rgba(56,178,172,0.08); }
.money-pnl .pnl-table tr.cat-ebitda td { font-weight: 700; background: rgba(56,178,172,0.15); }
.money-pnl .pnl-table tr.cat-net    td { font-weight: 700; background: rgba(56,178,172,0.22); }
.money-pnl .pnl-table td.neg { color: #c53030; }
.money-pnl .sign { display: inline-block; width: 14px; color: var(--muted, #999); font-weight: 600; }
.money-pnl .sign-plus { color: #38a169; }
.money-pnl .sign-minus { color: #c53030; }
.money-pnl .sign-eq { color: #319795; }
.money-pnl .pnl-margins { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.money-pnl .margin-card { flex: 1; min-width: 130px; padding: 12px; border-radius: 12px; background: var(--bg-2, #f7f7f7); }
.money-pnl .margin-card .lbl { font-size: 11px; color: var(--muted, #999); text-transform: uppercase; }
.money-pnl .margin-card .val { font-size: 22px; font-weight: 700; margin-top: 4px; }

.money-cashflow .cf-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 12px 0; }
.money-cashflow .cf-day { flex: 1; display: flex; flex-direction: column-reverse; min-width: 4px; gap: 2px; }
.money-cashflow .cf-bar.in { background: #38a169; }
.money-cashflow .cf-bar.out { background: #c53030; }
.money-cashflow .cf-bar { width: 100%; min-height: 1px; border-radius: 2px 2px 0 0; }

.drill-screen .kpi-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.drill-screen .kpi-card { flex: 1; min-width: 130px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2, #f7f7f7); }
.drill-screen .kpi-card .lbl { font-size: 11px; color: var(--muted, #999); text-transform: uppercase; }
.drill-screen .kpi-card .val { font-size: 18px; font-weight: 700; margin-top: 4px; }
.drill-screen .kpi-card.good { background: rgba(56,161,105,0.12); }
.drill-screen .kpi-card.bad { background: rgba(197,48,48,0.10); }
.drill-screen .kpi-card.warn { background: rgba(214,158,46,0.12); }
.drill-screen .kpi-card.neutral { background: var(--bg-2, #f7f7f7); }

.drill-screen .data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.drill-screen .data-table th, .drill-screen .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border, #eee); }
.drill-screen .data-table td.num, .drill-screen .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.drill-screen .data-table tr.warn { background: rgba(214,158,46,0.08); }
.drill-screen .data-table tr.overdue { background: rgba(197,48,48,0.10); }
.drill-screen .data-table tr.paid { color: var(--muted, #999); }
.drill-screen .data-table tr.paid td.num { color: var(--muted, #999); }
.drill-screen .data-table td.neg { color: #c53030; }
.drill-screen .badge { padding: 2px 8px; border-radius: 8px; font-size: 11px; background: var(--bg-2, #f7f7f7); }
.drill-screen .badge.paid { background: rgba(56,161,105,0.18); color: #276749; }
.drill-screen .badge.overdue { background: rgba(197,48,48,0.18); color: #9b2c2c; }
.drill-screen .badge.warn { background: rgba(214,158,46,0.18); color: #976807; }

.drill-screen .filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; padding: 0 12px; }
.drill-screen .filters .btn-sm.active { background: var(--accent, #319795); color: white; }
.drill-screen .tabs { display: flex; gap: 4px; padding: 0 12px; margin: 8px 0; }
.drill-screen .tab { padding: 8px 14px; border-radius: 8px; border: none; background: var(--bg-2, #f7f7f7); cursor: pointer; }
.drill-screen .tab.active { background: var(--accent, #319795); color: white; }

.drill-screen .row-actions { display: flex; gap: 8px; align-items: center; }
.drill-screen .btn-sm { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); background: white; cursor: pointer; font-size: 13px; }
.drill-screen .btn-sm.primary { background: var(--accent, #319795); color: white; border-color: var(--accent, #319795); }
.drill-screen .empty { padding: 24px 16px; text-align: center; color: var(--muted, #999); }
.drill-screen .alert-box { padding: 10px 14px; border-radius: 8px; background: rgba(214,158,46,0.18); color: #976807; margin: 8px 12px; }
.drill-screen .alert-box.danger { background: rgba(197,48,48,0.18); color: #9b2c2c; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal .modal-card { background: white; padding: 20px; border-radius: 14px; min-width: 320px; max-width: 90vw; max-height: 90vh; overflow-y: auto; }
.modal .modal-card h3 { margin: 0 0 12px 0; }
.modal .modal-card label { display: block; margin: 10px 0; font-size: 13px; }
.modal .modal-card input, .modal .modal-card select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); margin-top: 4px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .modal-actions button { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); background: white; cursor: pointer; }
.modal .modal-actions button.primary { background: var(--accent, #319795); color: white; border-color: var(--accent, #319795); }

.money-wallet .wallet-hero { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.money-wallet .big-card { flex: 1; min-width: 200px; padding: 20px; border-radius: 16px; background: var(--bg-2, #f7f7f7); }
.money-wallet .big-card.good { background: rgba(56,161,105,0.10); }
.money-wallet .big-card.warn { background: rgba(214,158,46,0.10); }
.money-wallet .big-card .lbl { font-size: 11px; color: var(--muted, #999); text-transform: uppercase; }
.money-wallet .big-card .big { font-size: 32px; font-weight: 700; margin: 8px 0 4px 0; }
.money-wallet .big-card .muted { font-size: 11px; color: var(--muted, #999); }
.money-wallet .sparkline-wrap { padding: 16px 12px; color: var(--accent, #319795); }

/* === Поток 4: Personnel+HR === */
.p4-section { padding: 4px 0; }
.p4-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 10px; margin-bottom: 14px;
}
.p4-card {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 12px 14px;
}
.p4-card-main { background: linear-gradient(180deg,#f5f3ff,#ede9fe); border-color:#c4b5fd; }
.p4-alert     { background: #fffbeb; border-color:#fcd34d; }
.p4-card-label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.p4-card-val   { font-size: 18px; font-weight: 600; }
.p4-h3 { margin: 18px 0 8px; font-size: 16px; }

.p4-table-wrap { overflow-x: auto; border: 1px solid var(--border,#e5e7eb); border-radius: 10px; background:#fff; }
.p4-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p4-table th, .p4-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.p4-table th { font-weight: 600; background: #f8fafc; color: #475569; position: sticky; top: 0; }
.p4-table tr:hover td { background: #f8fafc; }
.p4-pos { color: #059669; }
.p4-neg { color: #dc2626; }

.p4-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.p4-btn-primary   { background:#7c3aed; color:#fff; border:none; padding:8px 14px; border-radius:8px; cursor:pointer; font-weight:500; }
.p4-btn-primary:hover { background:#6d28d9; }
.p4-btn-secondary { background:#0ea5e9; color:#fff; border:none; padding:8px 14px; border-radius:8px; cursor:pointer; }
.p4-btn-ghost     { background:transparent; color:#475569; border:1px solid #cbd5e1; padding:6px 10px; border-radius:8px; cursor:pointer; }
.p4-btn-edit      { background:transparent; border:none; cursor:pointer; font-size:16px; color:#475569; }
.p4-btn-edit:hover { color:#7c3aed; }

.p4-editor { margin-top: 14px; padding: 16px; }
.p4-editor-title { font-weight:600; margin-bottom:10px; }
.p4-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.p4-form label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 4px; }
.p4-form input, .p4-form select { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; }
.p4-form .p4-full { grid-column: 1 / -1; }

.p4-checklist { list-style: none; padding: 0; margin: 8px 0; }
.p4-checklist li { padding: 4px 0; }
.p4-checklist label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.p4-done { text-decoration: line-through; color: #94a3b8; }
.p4-hr-card { margin-bottom: 12px; }
.p4-hr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }

/* drag-drop schedule */
.p4-sched-wrap { overflow-x: auto; border: 1px solid var(--border,#e5e7eb); border-radius: 10px; background:#fff; }
.p4-sched-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.p4-sched-table th, .p4-sched-table td { border: 1px solid #f1f5f9; padding: 4px 6px; text-align: center; }
.p4-sched-table thead th { background:#f8fafc; position: sticky; top:0; z-index: 2; }
.p4-sched-name { text-align: left !important; min-width: 160px; background:#fff; position: sticky; left: 0; z-index: 1; }
.p4-role-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.p4-sched-cell { cursor: pointer; min-width: 32px; height: 32px; transition: background 0.15s; }
.p4-sched-cell.p4-cell-on  { background: #e0f2fe; font-weight: 600; color: #0c4a6e; }
.p4-sched-cell.p4-cell-off { background: #fff; color: #cbd5e1; }
.p4-sched-cell.p4-cell-conflict { background: #fee2e2 !important; color: #991b1b; }
.p4-sched-cell:hover { background: #c7d2fe !important; }
.p4-sched-cell.p4-dragging { opacity: 0.4; }
.p4-sched-cell.p4-drag-over { box-shadow: inset 0 0 0 2px #7c3aed; }

@media print {
  .pers-tabs, .pers-period, .p4-actions, .p4-btn-edit { display: none !important; }
  .p4-sched-cell { border: 1px solid #999 !important; }
  .p4-section { font-size: 11px; }
}

/* === Поток 5: Launch === */
.ttks-toolbar { margin: 12px 0; }
.p5-import-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #121212;
    color: #fff;
    border: 1px solid #333;
    font-size: 15px;
    cursor: pointer;
    transition: all .2s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.p5-import-btn:hover:not(:disabled) { background: #232323; border-color: #444; }
.p5-import-btn:disabled { opacity: .65; cursor: not-allowed; background: #2a2a2a; }
.p5-spin {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid #fff3; border-top-color: #fff;
    border-radius: 50%; animation: p5spin .8s linear infinite;
}
@keyframes p5spin { to { transform: rotate(360deg); } }
.p5-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1f1f1f; color: #fff; padding: 12px 18px; border-radius: 10px;
    box-shadow: 0 8px 24px #0006; z-index: 9999; max-width: 92vw;
    opacity: 0; transition: opacity .25s ease;
    font-size: 14px;
}
.p5-toast.ok { background: #16361f; color: #b6ffcd; border: 1px solid #2a7c3f; }
.p5-toast.err { background: #361616; color: #ffcaca; border: 1px solid #8a3030; }

/* === Поток 5: signup pages === */
.p5-signup { max-width: 480px; margin: 0 auto; padding: 16px; }
.p5-su-h1 { margin: 8px 0 4px; }
.p5-su-sub { margin: 0 0 24px; }
.p5-signup-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 24px 0; }
.p5-signup-card {
    text-align: left; padding: 20px;
    background: #121212; border: 1px solid #2a2a2a; border-radius: 16px;
    color: #fff; cursor: pointer; transition: all .2s ease;
    display: block; width: 100%;
}
.p5-signup-card:hover { border-color: #444; background: #1f1f1f; transform: translateY(-1px); }
.p5-signup-card-alt { background: #0f0f0f; }
.p5-su-emoji { font-size: 28px; margin-bottom: 8px; }
.p5-su-card-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.p5-su-card-sub { font-size: 13px; color: #999; margin-bottom: 12px; }
.p5-su-card-price { font-size: 16px; color: #fff; font-weight: 500; margin-bottom: 8px; }
.p5-su-card-cta { font-size: 13px; color: #80c5ff; }
.p5-positioning { margin: 24px 0; }
.p5-positioning-list { padding: 0; margin: 0; list-style: none; }
.p5-positioning-list li { padding: 4px 0; color: #aaa; font-size: 13px; }
.p5-positioning-list li::before { content: "✓ "; color: #6cc56e; }
.p5-signup-foot { margin-top: 24px; text-align: center; color: #999; font-size: 13px; }
.p5-link { color: #80c5ff; text-decoration: none; }
.p5-link:hover { text-decoration: underline; }

.p5-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.p5-field { display: flex; flex-direction: column; gap: 4px; }
.p5-field > span { font-size: 13px; color: #ccc; }
.p5-field input {
    padding: 12px 14px;
    background: #121212; border: 1px solid #2e2e2e; border-radius: 10px;
    color: #fff; font-size: 15px; outline: none;
}
.p5-field input:focus { border-color: #80c5ff; }
.p5-checkbox { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; color: #ccc; font-size: 13px; }
.p5-checkbox input { margin-top: 3px; }
.p5-submit { margin-top: 8px; }
.p5-skip { margin-top: 8px; opacity: .8; }
.p5-error { color: #ff7676; background: #361616; border: 1px solid #8a3030; padding: 10px 14px; border-radius: 8px; font-size: 13px; }

.p5-chef-perks { margin: 16px 0 24px; display: flex; flex-direction: column; gap: 6px; }
.p5-perk { padding: 6px 10px; background: #16361f; color: #b6ffcd; border-radius: 8px; font-size: 13px; }
.p5-perk-pro { background: #2a1f3d; color: #d6c4ff; border: 1px solid #6b4ea0; }

.p5-signup-done { text-align: center; padding: 32px 16px; }
.p5-su-done-emoji { font-size: 48px; margin-bottom: 16px; }
.p5-su-next { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* === Поток 5 sprint 3: account / admin === */
.p5-acc { max-width: 920px; margin: 0 auto; padding: 16px; }
.p5-acc-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0; padding-bottom: 4px; }
.p5-acc-tab {
    flex-shrink: 0; padding: 8px 14px; background: #121212; color: #aaa;
    border: 1px solid #2a2a2a; border-radius: 8px; font-size: 13px; cursor: pointer;
    white-space: nowrap;
}
.p5-acc-tab.active { background: #2a2a2a; color: #fff; border-color: #444; }
.p5-acc-body { margin-top: 16px; }
.p5-acc-card {
    background: #121212; border: 1px solid #2a2a2a; border-radius: 12px;
    padding: 20px; margin-bottom: 16px;
}
.p5-acc-card h3 { margin: 0 0 12px; font-size: 18px; }
.p5-acc-card h4 { margin: 12px 0 8px; font-size: 14px; color: #ccc; }
.p5-acc-card hr { border: 0; border-top: 1px solid #2e2e2e; margin: 20px 0; }
.p5-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
.p5-stat { background: #0f0f0f; padding: 14px; border-radius: 10px; border: 1px solid #2a2a2a; }
.p5-stat.warn { border-color: #8a5a30; background: #1a1208; }
.p5-stat-v { font-size: 22px; font-weight: 600; color: #fff; }
.p5-stat-l { font-size: 12px; color: #999; margin-top: 4px; }
.p5-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.p5-table th, .p5-table td { border-bottom: 1px solid #2a2a2a; padding: 8px 6px; text-align: left; }
.p5-table th { background: #0f0f0f; color: #aaa; font-weight: 500; }
.p5-list { list-style: none; padding: 0; margin: 0; }
.p5-list li { padding: 8px 0; border-bottom: 1px solid #1f1f1f; font-size: 13px; }
.p5-features { display: flex; flex-wrap: wrap; gap: 6px; }
.p5-feat { padding: 4px 10px; background: #16361f; color: #b6ffcd; border-radius: 6px; font-size: 12px; }
.p5-mini-btn { padding: 2px 8px; background: #2a2a2a; color: #fff; border: 1px solid #444; border-radius: 5px; font-size: 11px; cursor: pointer; }
.p5-mini-btn:hover { background: #353535; }
.p5-success { color: #b6ffcd; background: #16361f; padding: 8px 12px; border-radius: 6px; margin-top: 8px; }
.p5-badge { padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.p5-badge-warn { background: #361f08; color: #ffbf6c; }
.p5-prio-low { background: #1f3a1f; color: #b6ffcd; }
.p5-prio-normal { background: #1f2f3a; color: #80c5ff; }
.p5-prio-high { background: #3a2f1f; color: #ffcaa0; }
.p5-prio-critical { background: #3a161a; color: #ff7676; }
.p5-ticket { background: #0f0f0f; border: 1px solid #2a2a2a; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.p5-ticket-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
/* === Поток 2: Analytics+Plan+Home === */

/* Tabs */
.p2-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.p2-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: inherit;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}
.p2-tab.active { background: rgba(70,130,230,0.25); border-color: rgba(70,130,230,0.6); }
.p2-tab:hover { background: rgba(255,255,255,0.08); }

.p2-tab-body { padding: 12px 0; }
.p2-loading { padding: 20px; text-align: center; color: #a0a8c0; }
.p2-error { padding: 16px; color: #ff7070; background: rgba(255,80,80,0.07); border-radius: 8px; }
.p2-note { padding: 8px 12px; background: rgba(255,255,255,0.04); border-left: 3px solid rgba(70,130,230,0.6);
           border-radius: 6px; margin: 8px 0; font-size: 13px; color: #c0c8d8; }
.p2-note.p2-warn { border-left-color: #d6a330; color: #e8d29f; }

.p2-controls {
    display: flex; gap: 12px; flex-wrap: wrap;
    align-items: center; padding: 8px 0 12px;
}
.p2-controls label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #c0c8d8; }

.p2-select, .p2-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: inherit; padding: 5px 8px; border-radius: 6px; font-size: 13px;
}
.p2-input-num { width: 80px; }

.p2-btn {
    background: rgba(70,130,230,0.18); color: inherit;
    border: 1px solid rgba(70,130,230,0.5);
    padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.p2-btn:hover  { background: rgba(70,130,230,0.32); }
.p2-btn-primary { background: rgba(70,180,120,0.22); border-color: rgba(70,180,120,0.6); }
.p2-btn-warn    { background: rgba(230,140,70,0.18); border-color: rgba(230,140,70,0.6); }
.p2-export-btn  { float: right; }

.p2-stats { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0 12px; }
.p2-pill {
    background: rgba(255,255,255,0.06); padding: 4px 10px; border-radius: 999px;
    font-size: 12px; border: 1px solid rgba(255,255,255,0.08);
}
.p2-roas { background: rgba(70,180,120,0.18); border-color: rgba(70,180,120,0.5); }

/* Tables */
.p2-table-wrap { overflow-x: auto; border-radius: 8px; background: rgba(255,255,255,0.02); }
.p2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p2-table th, .p2-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.p2-table th { background: rgba(255,255,255,0.04); font-weight: 600; color: #c0c8d8; font-size: 12px; letter-spacing: 0.3px; text-transform: uppercase; }
.p2-table tr:hover td { background: rgba(255,255,255,0.025); }
.p2-up   { color: #6fc77a; }
.p2-down { color: #ff8a8a; }
.p2-pareto-over { color: #d6a330; }
.p2-pessim { color: #ff8a8a; }
.p2-base   { color: #c0c8d8; font-weight: 600; }
.p2-optim  { color: #6fc77a; }

/* Lights */
.p2-light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.p2-light-green   { background: #6fc77a; }
.p2-light-yellow  { background: #d6a330; }
.p2-light-red     { background: #ff8a8a; }
.p2-light-neutral { background: #555; }
tr.p2-light-green  { background: rgba(111,199,122,0.06); }
tr.p2-light-yellow { background: rgba(214,163,48,0.06);  }
tr.p2-light-red    { background: rgba(255,138,138,0.07); }

/* Heatmap grid */
.p2-heatbox { padding: 8px 0; }
.p2-heat-wrap { overflow-x: auto; }
.heat-grid { display: grid; gap: 2px; min-width: 600px; }
.heat-row { display: grid; grid-template-columns: 32px repeat(24, 1fr); gap: 2px; }
.heat-cell { height: 22px; display: flex; align-items: center; justify-content: center;
             font-size: 10px; color: rgba(255,255,255,0.6); border-radius: 3px; }
.heat-corner { background: transparent; }
.heat-hour-label, .heat-dow-label { font-weight: 600; }
.heat-data { background: rgba(70,130,230,0.05); cursor: pointer; }
.heat-data:hover { outline: 1px solid rgba(255,255,255,0.5); }

/* Sparklines */
.p2-spark { display: inline-block; vertical-align: middle; margin-left: 8px; color: rgba(120,180,255,0.85); }
.p2-spark svg { display: block; }

/* Drag-drop ghost */
.p2-sort-ghost { opacity: 0.4; }

/* Explain button on cards */
.p2-explain-btn {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(70,130,230,0.16); border: 1px solid rgba(70,130,230,0.45);
    color: inherit; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.p2-explain-btn:hover { background: rgba(70,130,230,0.32); }
.kpi-card, .gcard { position: relative; }

/* Explain popup */
.p2-explain-popup, .p2-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #1a1d2c; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 0;
    max-width: 90vw; max-height: 85vh; width: 480px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); z-index: 10001;
}
.p2-pop-head, .p2-modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
    font-weight: 600;
}
.p2-pop-close, .p2-modal-close, .p2-sheet-close {
    background: transparent; border: none; color: inherit;
    font-size: 22px; cursor: pointer; line-height: 1;
}
.p2-pop-body, .p2-modal-body { padding: 14px 16px; font-size: 14px; line-height: 1.5; max-height: 70vh; overflow-y: auto; }

/* Timeline rail */
.p2-timeline-rail {
    margin-top: 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 12px;
}
.p2-rail-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; letter-spacing: 0.8px; color: #a0a8c0; margin-bottom: 8px;
    text-transform: uppercase;
}
.p2-rail-refresh { background: transparent; border: none; color: inherit; cursor: pointer; font-size: 14px; }
.p2-rail-body { display: flex; flex-direction: column; gap: 6px; }
.p2-rail-event { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px;
                 background: rgba(255,255,255,0.03); border-radius: 6px; font-size: 12px; }
.p2-rail-time  { font-variant-numeric: tabular-nums; color: #a0a8c0; min-width: 38px; }
.p2-rail-title { font-weight: 600; }
/* [stage14-ux-audit] better contrast: was #c0c8d8 11px → #dde3ef 13px, line-height for readability */
.p2-rail-msg   { color: #dde3ef; font-size: 13px; line-height: 1.45; word-break: break-word; }
/* [stage14-ux-audit] bold/em visible in dark theme */
.p2-rail-msg strong { color: #fff; font-weight: 600; }
.p2-rail-msg em { color: #f0e8d0; font-style: italic; }
.p2-rail-msg code { font-family: 'SF Mono', Menlo, monospace; font-size: 0.92em;
                    background: rgba(255,255,255,0.08); padding: 1px 4px; border-radius: 3px; }
/* [stage14-ux-audit] "Подробнее" accordion toggle inside timeline event */
.p2-rail-more  { display: inline-block; margin-top: 6px; padding: 2px 0;
                 background: transparent; border: none; cursor: pointer;
                 color: #8eb8e0; font-size: 11px; font-weight: 600; }
.p2-rail-more:hover { color: #b4d2f0; }
.p2-rail-text  { min-width: 0; flex: 1; }
.p2-sev-critical { border-left: 3px solid #ff6060; }
.p2-sev-high     { border-left: 3px solid #ff9050; }
.p2-sev-medium   { border-left: 3px solid #d6a330; }
.p2-sev-low      { border-left: 3px solid #6080a0; }
.p2-sev-info     { border-left: 3px solid #5070a0; }
.p2-rail-empty   { padding: 8px; color: #a0a8c0; font-size: 12px; text-align: center; }

/* Morning AI banner */
.p2-morning-banner {
    margin: 8px 0 14px;
    padding: 10px 12px;
    background: rgba(160,120,230,0.08);
    border: 1px solid rgba(160,120,230,0.25);
    border-radius: 10px;
}
.p2-morning-btn {
    background: transparent; border: none; color: inherit;
    cursor: pointer; font-size: 13px; font-weight: 600;
}
.p2-morning-text { margin-top: 8px; font-size: 13px; line-height: 1.5; color: #1c1c1c; font-weight: 500; }

/* Compare */
.p2-compare-controls input { width: 140px; }

/* Export sheet */
.p2-sheet {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #1a1d2c; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 0; min-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); z-index: 10000;
}
.p2-sheet-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
    font-weight: 600;
}
.p2-sheet-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.p2-export-list { display: flex; flex-direction: column; gap: 6px; }
.p2-export-list .p2-btn { text-align: left; }

/* Planning */
.planning-v2-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.p2-period-pill { display: flex; gap: 10px; }

/* ========== EmptyState ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  color: #6B6259;
}
.empty-state-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.85;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: #2A2620;
  margin-bottom: 6px;
}
.empty-state-hint {
  font-size: 14px;
  line-height: 1.4;
  color: #6B6259;
  max-width: 320px;
  margin-bottom: 16px;
}
.empty-state-cta {
  display: inline-block;
  padding: 10px 20px;
  background: #2A2620;
  color: #F1F1EE;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.empty-state-cta:hover { opacity: 0.85; }
.empty-state-cta:active { transform: scale(0.98); }

/* ========== Skeleton (loading placeholder) ========== */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.skeleton-pulse {
  background: linear-gradient(90deg, #E8E2D6 0%, #F0EADE 50%, #E8E2D6 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-row {
  height: 14px;
}
.skeleton-chart {
  height: 140px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.skeleton-card .skeleton-row {
  height: 18px;
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-pulse { animation: none; opacity: 0.6; }
}

/* === Tab-rows right-aligned === (A14 · 2026-05-22)
   Desktop (≥1024px): таб-ряды и cards-row растягиваются до правого края.
   Mobile (<1024px): сохраняется горизонтальный скролл / mobile grid. */
@media (min-width: 1024px) {
    /* Drill / Analytics period switchers — chips fill the width evenly */
    .drill-screen .period-switcher,
    .analytics-screen .period-switcher,
    .plan-screen .period-switcher,
    .pers-screen .period-switcher,
    .planning-screen .period-switcher {
        overflow-x: visible;
        flex-wrap: wrap;
        gap: 8px;
    }
    .drill-screen .period-switcher > .period-chip,
    .analytics-screen .period-switcher > .period-chip,
    .plan-screen .period-switcher > .period-chip,
    .pers-screen .period-switcher > .period-chip,
    .planning-screen .period-switcher > .period-chip {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Analytics v2 tabs */
    .analytics-v2-screen .p2-tabs {
        overflow-x: visible;
        flex-wrap: wrap;
        gap: 8px;
    }
    .analytics-v2-screen .p2-tabs > .p2-tab {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
    }

    /* Money / Drill KPI strip (Выручка / Чеки / Гостей / Ср.чек) — 4 в ряд */
    .drill-screen .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    /* Money drill "Разделы" cards — 4 в ряд горизонтально */
    .drill-screen .drill-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    .drill-screen .drill-list > .drill-card {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* === Charts v3 (2026-05-22) === */
.fc-heatmap { display: block; max-width: 100%; }
.fc-hm-cell { cursor: pointer; transition: filter 0.12s; stroke: transparent; stroke-width: 1; }
.fc-hm-cell:hover { filter: brightness(1.08); stroke: rgba(0,0,0,0.55); stroke-width: 1.4; }
.fc-area { display: block; max-width: 100%; }
.fc-area .fc-annot { cursor: pointer; }
.fc-area .fc-pt { cursor: pointer; }

.chart-card { background: #fbfaf6; border: 1px solid rgba(0,0,0,0.06); border-radius: 10px; padding: 14px 12px 10px; margin-top: 8px; box-shadow: 0 1px 0 rgba(0,0,0,0.02); }
.chart-legend { margin-top: 10px; font-size: 11px; color: #6e6e6e; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cl-line { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--green); }
.cl-solid { background: var(--green); }
.cl-dash { background: transparent; border-top: 2px dashed #bdbdbd; height: 0; }
.cl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Shift-load heatmap wrap + tooltip + legend */
.sl-hm-wrap { position: relative; margin-top: 10px; }
.sl-hm-tip {
    position: absolute; display: none; pointer-events: none;
    background: rgba(20,20,20,0.94); color: #fff; padding: 7px 10px;
    border-radius: 6px; font-size: 11px; line-height: 1.45;
    z-index: 10; max-width: 240px; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.sl-hm-legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 11px; color: #444; }
.sl-hm-leg-item { display: inline-flex; align-items: center; gap: 5px; }
.sl-hm-leg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

.sl-row { transition: background 0.18s, transform 0.18s; }
.sl-row.sl-row-active { background: rgba(212,160,23,0.18); transform: translateX(2px); box-shadow: inset 3px 0 0 #d4a017; }
.sl-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.2; white-space: nowrap; }

/* Analytics heatmap tooltip */
.an-hm { position: relative; }
.an-hm-tip {
    position: absolute; display: none; pointer-events: none;
    background: rgba(20,20,20,0.94); color: #fff; padding: 7px 10px;
    border-radius: 6px; font-size: 11px; line-height: 1.45;
    z-index: 10; max-width: 220px; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Sparkline cards — keep absolute on bottom-right, premium look */
.p2-spark { position: absolute; right: 10px; bottom: 10px; opacity: 0.95; }
.gcard { position: relative; }

@media (max-width: 768px) {
    .sl-hm-wrap { overflow-x: auto; }
    .fc-heatmap { min-width: 540px; }
    .chart-card { padding: 10px 6px 6px; }
    .p2-spark { right: 6px; bottom: 6px; }
}

/* ============================================================
   Stage 25d — AI smart-cards (enrichment)
   Freshli light theme: #F8F8F6 page / #fff cards / #ececec border
   ============================================================ */

.opdir-feed-group { margin-bottom: 18px; }
.opdir-feed-group-h {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 2px;
}

.opdir-feed-card {
    background: #fff;
    border: 1px solid #ececec;
    border-left: 3px solid #ececec;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(20, 20, 20, 0.03);
    transition: box-shadow .15s ease;
}
.opdir-feed-card:hover { box-shadow: 0 2px 8px rgba(20, 20, 20, 0.06); }

.opdir-feed-card-urgent    { border-left-color: #d44; }
.opdir-feed-card-important { border-left-color: #dba23a; }
.opdir-feed-card-info      { border-left-color: var(--accent); }

.opdir-feed-card-main { display: flex; flex-direction: column; gap: 3px; }
.opdir-feed-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #121212;
    line-height: 1.35;
}
.opdir-feed-card-body {
    font-size: 12px;
    color: #555;
    line-height: 1.45;
    margin-top: 2px;
}

.opdir-feed-card-foot {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* legacy "В задачу" button (no enrichment) */
.opdir-feed-card-foot .opdir-to-task {
    font-size: 12px;
    color: #3b82f6;
    background: #fff;
    border: 1px solid #cdd6e3;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}
.opdir-feed-card-foot .opdir-to-task:hover { background: #f3f6fb; }
.opdir-feed-card-foot .opdir-to-task:disabled { opacity: .6; cursor: default; }
.opdir-feed-card-foot .opdir-to-task.ok { color: #2a7c3f; border-color: #2a7c3f; }
.opdir-feed-card-foot .opdir-to-task.err { color: #d44; border-color: #d44; }

/* ---- smart-card (enrichment block) ---- */
.opdir-smart {
    margin-top: 10px;
    background: #F8F8F6;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 10px 12px;
}
.opdir-smart-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.opdir-verdict {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1;
}
.opdir-verdict-real    { background: #fde0e0; color: #8a1d1d; }
.opdir-verdict-false   { background: #ececec; color: #555; }
.opdir-verdict-context { background: #f7ecd2; color: #8a6020; }

.opdir-smart-ai {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    color: #999;
    text-transform: uppercase;
}

.opdir-smart-comment {
    font-size: 13px;
    color: #121212;
    line-height: 1.5;
    margin: 4px 0 10px 0;
}

.opdir-smart-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.opdir-smart-action {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease;
}
.opdir-smart-action:hover { background: #5a6929; border-color: #5a6929; }
.opdir-smart-action:disabled { opacity: .6; cursor: default; }

.opdir-to-task-smart {
    font-size: 12px;
    color: #3b82f6;
    background: #fff;
    border: 1px solid #cdd6e3;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease;
}
.opdir-to-task-smart:hover { background: #f3f6fb; }
.opdir-to-task-smart:disabled { opacity: .6; cursor: default; }
.opdir-to-task-smart.ok  { color: #2a7c3f; border-color: #2a7c3f; }
.opdir-to-task-smart.err { color: #d44;    border-color: #d44; }

/* [stage25e] Summary grid — 8 sections card row */
.opdir-summary { padding: 4px 0; }
.opdir-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1100px) { .opdir-summary-grid { grid-template-columns: repeat(2, 1fr); } }
.opdir-summary-card { background: #fff; border: 1px solid #ececec; border-radius: 10px; padding: 12px 14px; }
.opdir-summary-card-empty { background: transparent; border: 1px dashed #ececec; min-height: 60px; }
.opdir-sum-label { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; font-weight: 600; }
.opdir-sum-value { font-size: 22px; font-weight: 700; color: #121212; line-height: 1.2; }
.opdir-sum-unit { font-size: 13px; font-weight: 500; color: #555; }
.opdir-sum-sub { font-size: 11px; color: #888; margin-top: 4px; }
.opdir-sum-sub-ok { color: var(--green); font-weight: 600; }
.opdir-sum-sub-warn { color: #dba23a; font-weight: 600; }

/* ==========================================================================
   Stage 26d · Analytics → Доходы — warehouse split + donut + 3-way lineplot
   Freshli theme: cream #F8F8F6 page, white cards, olive var(--accent) accent.
   ========================================================================== */

.av2-warehouse-wrap {
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 14px 16px 16px;
}
.av2-warehouse-table .av2-table-row {
    grid-template-columns: 1.4fr 1fr 1.3fr;
    border-bottom: 1px solid #f0eee8;
    padding: 9px 0;
}
.av2-warehouse-table .av2-tc-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2a2a2a;
}
.av2-wh-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}
.av2-bar-fill--olive { background: var(--green); }

/* --- Donut «Структура выручки» --- */
.av2-donut-wrap {
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 16px 16px 18px;
}
.av2-donut-layout {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.av2-donut-svg-box {
    flex: 0 0 auto;
    background: #F8F8F6;
    border-radius: 14px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.av2-donut-svg { display: block; }
.av2-donut-legend {
    flex: 1 1 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}
.av2-donut-legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 6px 10px;
    background: #F8F8F6;
    border-radius: 8px;
    border: 1px solid #f0eee8;
}
.av2-donut-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.av2-donut-legend-name {
    color: #2a2a2a;
    font-weight: 500;
}
.av2-donut-legend-pct {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
    min-width: 48px;
    text-align: right;
}
.av2-donut-legend-val {
    font-variant-numeric: tabular-nums;
    color: #6e6e6e;
    font-size: 12px;
    min-width: 90px;
    text-align: right;
}

/* --- 3-way lineplot «Динамика выручки» (Факт / Прошл.неделя / Прошл.год) --- */
.av2-line3-wrap {
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 14px 16px 18px;
}
.av2-line3-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #4a4a4a;
}
.av2-line3-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.av2-line3-swatch {
    display: inline-block;
    width: 22px;
    height: 3px;
    background: var(--c, var(--accent));
    border-radius: 2px;
    vertical-align: middle;
}
.av2-line3-swatch--dash {
    background: transparent;
    height: 0;
    border-top: 2px dashed var(--c, #999);
    width: 22px;
}
.av2-line3-svg-box {
    background: #F8F8F6;
    border-radius: 12px;
    padding: 10px 8px 6px;
    overflow: hidden;
}
.av2-line3-svg { display: block; width: 100%; height: auto; }

@media (max-width: 720px) {
    .av2-donut-layout { gap: 16px; }
    .av2-donut-legend-item { grid-template-columns: 14px 1fr auto; }
    .av2-donut-legend-val { display: none; }
}

/* Stage 26e — mini P&L waterfall (Pekloos parity) */
.stage26e-waterfall {
    margin: 14px 0 6px;
    padding: 10px 10px 8px;
    background: #fff;
    border: 1px solid #ecebe3;
    border-radius: 14px;
}
.stage26e-waterfall .av2-table-title {
    font-size: 13px;
    font-weight: 600;
    color: #2a2a26;
    margin: 2px 4px 8px;
}
.av2-waterfall-svg {
    display: block;
    width: 100%;
    height: auto;
    background: #F8F8F6;
    border-radius: 10px;
    padding: 4px 0 2px;
}
.av2-waterfall-axis {
    stroke: #d8d6cc;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}
.av2-waterfall-bar { transition: opacity .15s ease; }
.av2-waterfall-bar--pos { fill: var(--green); }
.av2-waterfall-bar--neg { fill: #d44; }
.av2-waterfall-val {
    font-size: 11px;
    font-weight: 600;
    fill: #2a2a26;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.av2-waterfall-pct {
    font-size: 10px;
    fill: #fff;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.av2-waterfall-label {
    font-size: 10.5px;
    fill: #5a5a55;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.av2-waterfall-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #5a5a55;
    margin: 6px 4px 2px;
}
.av2-waterfall-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.av2-waterfall-sw {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.av2-waterfall-sw--pos { background: var(--green); }
.av2-waterfall-sw--neg { background: #d44; }

@media (max-width: 480px) {
    .av2-waterfall-val { font-size: 10px; }
    .av2-waterfall-label { font-size: 9.5px; }
    .av2-waterfall-pct { font-size: 9px; }
}

/* ============================================================
 * [stage26e-ai] AI screen — tabs, groups, runs history, run-now
 * ============================================================ */

/* Header actions: next-run timer + run-now button. */
.opdir-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.opdir-head-actions { display: flex; align-items: center; gap: 8px; }
.opdir-next-run {
    font-size: 11px;
    color: #888;
    background: #f3f3ee;
    border: 1px solid #ececec;
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.opdir-run-now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.opdir-run-now:hover:not(:disabled) { background: #5a6929; border-color: #5a6929; }
.opdir-run-now:disabled { opacity: .6; cursor: default; }
.opdir-run-now.is-running { background: #888; border-color: #888; }
.opdir-run-now svg { display: block; }

/* Tabs (sub-tab navigation). */
.opdir-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #ececec;
    margin: 8px 0 16px;
    padding: 0;
}
.opdir-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.opdir-tab:hover { color: #121212; }
.opdir-tab.active { color: #121212; border-bottom-color: var(--accent); }

/* Collapsible groups in feed. */
.opdir-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .15s;
}
.opdir-group-head:hover { background: #F8F8F6; }
.opdir-group-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.opdir-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.opdir-group-label { font-size: 12px; }
.opdir-group-count {
    background: rgba(0,0,0,.05);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}
.opdir-group-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #555;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}
.opdir-group-loss { color: #d44; font-weight: 600; }
.opdir-group-chev { display: inline-flex; opacity: .55; }
.opdir-group-body {
    padding: 6px 0 10px;
}
.opdir-feed-card-loss {
    margin-top: 6px;
    font-size: 11px;
    color: #d44;
    font-weight: 600;
}

/* Runs sub-tab — KPI cards. */
.opdir-runs-kpi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.opdir-kpi-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
}
.opdir-kpi-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
    font-weight: 600;
}
.opdir-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #121212;
    line-height: 1.1;
}

/* Run cards. */
.opdir-runs-list { display: flex; flex-direction: column; gap: 8px; }
.opdir-run-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 10px 14px;
}
.opdir-run-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.opdir-run-date { font-size: 13px; font-weight: 600; color: #121212; }
.opdir-run-dur { font-size: 11px; color: #999; }
.opdir-run-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.opdir-run-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    background: #f3f3ee;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    color: #555;
}
.opdir-run-pill-n { font-weight: 700; }
.opdir-run-pill-l { color: #888; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.opdir-run-pill.pill-crit { background: #fde0e0; color: #8a1d1d; }
.opdir-run-pill.pill-crit .opdir-run-pill-l { color: #b04a4a; }
.opdir-run-pill.pill-warn { background: #f7ecd2; color: #8a6020; }
.opdir-run-pill.pill-warn .opdir-run-pill-l { color: #a78340; }
.opdir-run-pill.pill-info { background: #e8eed4; color: #4d5d22; }
.opdir-run-pill.pill-info .opdir-run-pill-l { color: #6d7d44; }

.opdir-run-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
}
.opdir-run-toggle:hover { color: #5a6929; }
.opdir-run-chev { display: inline-flex; opacity: .65; }

.opdir-run-items {
    margin-top: 6px;
    border-top: 1px solid #f3f3ee;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.opdir-run-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}
.opdir-run-item-sev {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    text-align: center;
}
.opdir-run-item.sev-crit .opdir-run-item-sev { background: #fde0e0; color: #8a1d1d; }
.opdir-run-item.sev-warn .opdir-run-item-sev { background: #f7ecd2; color: #8a6020; }
.opdir-run-item.sev-info .opdir-run-item-sev { background: #e8eed4; color: #4d5d22; }
.opdir-run-item-title { color: #121212; }
.opdir-run-item-val { color: #888; font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 600px) {
    .opdir-head { flex-direction: column; align-items: stretch; }
    .opdir-head-actions { flex-wrap: wrap; }
    .opdir-runs-kpi { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .opdir-kpi-value { font-size: 18px; }
    .opdir-run-item { grid-template-columns: 80px 1fr auto; font-size: 11px; }
}

/* ===== Wave 5 — Живая смена (KPI · QR-чекин · посещаемость) ===== */
.liveshift-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.liveshift-kpi {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e7e2d6);
  border-radius: var(--radius, 16px);
  padding: 14px 12px;
  text-align: center;
}
.liveshift-kpi-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(31, 30, 29, 0.12);
  color: var(--accent);
}
.liveshift-kpi-val {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text, #2a2a22);
}
.liveshift-kpi-of {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted, #8a8470);
  margin-left: 4px;
}
.liveshift-kpi-lbl {
  font-size: 12px;
  color: var(--text-muted, #8a8470);
  margin-top: 4px;
}

.liveshift-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.liveshift-bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.liveshift-qr-btn,
.liveshift-bar-btns .btn-primary,
.liveshift-bar-btns .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.liveshift-qr-btn { background: var(--accent); color: #F8F8F6; border-color: var(--accent); }
.liveshift-qr-btn:hover { background: #5a6a2a; }

.liveshift-attendance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.liveshift-att-col {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e7e2d6);
  border-radius: var(--radius, 16px);
  padding: 10px;
  min-height: 80px;
}
.liveshift-att-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #2a2a22);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft, #efeadc);
}
.liveshift-att-head b {
  margin-left: auto;
  background: rgba(31, 30, 29, 0.12);
  color: var(--accent);
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 12px;
}
.liveshift-att-list { display: flex; flex-direction: column; gap: 6px; }
.liveshift-att-empty { font-size: 12px; padding: 6px 2px; }
.liveshift-att-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.liveshift-att-body { min-width: 0; }
.liveshift-att-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #2a2a22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liveshift-att-sub {
  font-size: 11px;
  color: var(--text-muted, #8a8470);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liveshift-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.liveshift-avatar-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 30, 29, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.liveshift-st-in .liveshift-avatar-fb { background: rgba(31, 30, 29, 0.18); }
.liveshift-st-out .liveshift-avatar-fb { background: rgba(138, 132, 112, 0.18); color: #8a8470; }
.liveshift-st-out .liveshift-att-name { color: var(--text-muted, #8a8470); }

/* QR modal */
.liveshift-qr-modal { max-width: 340px; text-align: center; }
.liveshift-qr-modal h3 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.liveshift-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin: 12px 0;
  background: #fff;
  border: 1px solid var(--border, #e7e2d6);
  border-radius: 12px;
  padding: 12px;
}
.liveshift-qr-img { width: 100%; max-width: 240px; height: auto; image-rendering: pixelated; }
.liveshift-qr-link { font-size: 12px; word-break: break-all; color: var(--accent); }
.liveshift-qr-hint { font-size: 12px; }

@media (max-width: 560px) {
  .liveshift-attendance { grid-template-columns: 1fr; }
  .liveshift-kpi-val { font-size: 20px; }
}

/* ============================================================
   [wave5] PERSONNEL — Зоны/станции фильтры + Удалённые сотрудники
   (Pekloos parity, scope: Сотрудники-tab only)
============================================================ */
.personnel-zones-bar .emp-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.personnel-zones-bar .emp-filter-ic {
    display: inline-flex; align-items: center; color: var(--text-3);
}
.personnel-zones-bar .emp-select {
    appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px; font-family: inherit;
    color: var(--text); cursor: pointer;
    max-width: 200px;
}
.personnel-zones-bar .emp-select:focus { outline: none; border-color: var(--text); }
.personnel-zones-bar .emp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 12px; font-family: inherit; cursor: pointer;
    color: var(--text-2);
}
.personnel-zones-bar .emp-chip:hover { background: var(--bg); }
.personnel-zones-bar .emp-chip.active {
    background: var(--accent); border-color: var(--accent); color: #fff;
}
.personnel-zones-bar .emp-chip svg { display: block; }
.pers-table tr.emp-deleted-row td { color: var(--text-3); }
.pers-table tr.emp-deleted-row td b { color: var(--text-2); font-weight: 500; }
.emp-del-badge {
    display: inline-block; margin-left: 6px;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
    color: #C53A3A; border: 1px solid rgba(197,58,58,0.3);
    border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}

/* ===== Wave 5: Чек-листы (checklist-*) ===================================== */
.checklist-screen { padding: 4px 0 80px; }
.checklist-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.checklist-title-wrap { display: flex; align-items: center; gap: 8px; }
.checklist-title-icon { color: var(--orange); display: inline-flex; }
.checklist-head h2 { margin: 0; }

.checklist-tabs { display: flex; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.checklist-tab {
  background: none; border: none; padding: 8px 12px; cursor: pointer;
  color: var(--text-3); font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color .15s;
}
.checklist-tab:hover { color: var(--text); }
.checklist-tab.active { color: var(--text); border-bottom-color: var(--accent); }

.checklist-body { margin-top: 8px; }
.checklist-empty { padding: 32px 16px; text-align: center; }
.checklist-error { padding: 16px; color: #b3261e; text-align: center; }

/* Period picker */
.checklist-period { display: flex; gap: 6px; margin-bottom: 14px; }
.checklist-period-btn {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; color: var(--text-2); cursor: pointer;
}
.checklist-period-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* PCT badge */
.checklist-pct { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.checklist-pct.ok { background: rgba(45,140,90,0.14); color: var(--green); }
.checklist-pct.warn { background: rgba(219,162,58,0.18); color: #946a14; }
.checklist-pct.bad { background: rgba(179,38,30,0.12); color: #b3261e; }

.checklist-cat-chip {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-soft); color: var(--text-2); margin-left: 6px;
}

/* Journal */
.checklist-journal-list { display: flex; flex-direction: column; gap: 8px; }
.checklist-journal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.checklist-journal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checklist-journal-name { font-weight: 600; font-size: 15px; }
.checklist-journal-meta { font-size: 12px; margin-top: 4px; }
.checklist-journal-note { font-size: 13px; margin-top: 6px; color: var(--text-2); padding-top: 6px; border-top: 1px solid var(--border); }

/* Analytics */
.checklist-analytics { display: flex; flex-direction: column; gap: 16px; }
.checklist-kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checklist-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.checklist-kpi-val { font-size: 26px; font-weight: 700; color: var(--green); }
.checklist-kpi-lbl { font-size: 12px; margin-top: 2px; }
.checklist-section-h { font-size: 14px; font-weight: 600; margin: 4px 0; color: var(--text); }

.checklist-chart { display: flex; flex-direction: column; gap: 12px; }
.checklist-bar-row { display: flex; flex-direction: column; gap: 4px; }
.checklist-bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; align-items: center; }
.checklist-bar-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist-bar-val { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.checklist-bar-svg { width: 100%; height: 8px; display: block; }
.checklist-bar-track { fill: var(--bg-soft); }
.checklist-bar-fill.ok { fill: var(--green); }
.checklist-bar-fill.warn { fill: #dba23a; }
.checklist-bar-fill.bad { fill: #b3261e; }


.checklist-user-list { display: flex; flex-direction: column; gap: 6px; }
.checklist-user-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.checklist-user-name { font-size: 14px; }
.checklist-user-right { display: flex; align-items: center; gap: 10px; }

/* Library */
.checklist-lib-grid { display: flex; flex-direction: column; gap: 10px; }
.checklist-lib-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.checklist-lib-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.checklist-lib-namewrap { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.checklist-lib-name { font-weight: 600; font-size: 15px; }
.checklist-lib-meta { font-size: 12px; margin-top: 4px; }
.checklist-lib-items { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.checklist-lib-item { font-size: 13px; color: var(--text-2); padding-left: 16px; position: relative; }
.checklist-lib-item::before { content: ''; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.checklist-lib-item.req { color: var(--text); }
.checklist-lib-item.req::before { background: #dba23a; }
.checklist-lib-more { font-size: 12px; padding-left: 16px; }

.checklist-icon-btn { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; display: inline-flex; border-radius: 6px; }
.checklist-icon-btn:hover { color: var(--text); background: var(--bg-soft); }
.checklist-del:hover { color: #b3261e; }

.checklist-run-btn, .checklist-add-item-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.checklist-add-item-btn { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.checklist-run-btn:active, .checklist-add-item-btn:active { transform: scale(0.98); }

/* Forms (create + run) */
.checklist-create-form { display: flex; flex-direction: column; gap: 12px; }
.checklist-field { display: flex; flex-direction: column; gap: 4px; }
.checklist-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checklist-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.checklist-input {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; color: var(--text); width: 100%; box-sizing: border-box;
  font-family: inherit;
}
.checklist-input:focus { outline: none; border-color: var(--accent); }

.checklist-items-builder { display: flex; flex-direction: column; gap: 8px; }
.checklist-item-row { display: flex; align-items: center; gap: 8px; }
.checklist-item-input { flex: 1; }
.checklist-req-label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.checklist-item-rm { flex-shrink: 0; }

.checklist-btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.checklist-btn-primary:disabled { opacity: 0.5; }
.checklist-btn-secondary {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; font-size: 15px; cursor: pointer; flex: 1;
}
.checklist-create-submit { margin-top: 8px; }

/* Run modal */
.checklist-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.checklist-modal {
  background: var(--bg-card); width: 100%; max-width: 520px;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
.checklist-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.checklist-modal-head h3 { margin: 0; font-size: 17px; }
.checklist-run-items { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.checklist-run-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.checklist-run-cb { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.checklist-run-txt { font-size: 14px; line-height: 1.35; }
.checklist-modal-actions { display: flex; gap: 10px; margin-top: 14px; }

@media (max-width: 480px) {
  .checklist-kpi-row { grid-template-columns: 1fr 1fr; }
  .checklist-field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Wave 5 (Команда) — Расписание toolbar + мастер-график.
   Olive theme: var(--accent) / cream #F8F8F6 / warn #dba23a.
   ============================================================ */
.schedule-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 8px 10px;
  background: #F8F8F6; border: 1px solid #ececec; border-radius: 10px;
}
.schedule-toolbar svg { vertical-align: middle; }

/* Chip-tabs: Неделя | Месяц */
.schedule-chip-tabs { display: inline-flex; gap: 4px; background: #fff; border: 1px solid #ececec; border-radius: 8px; padding: 3px; }
.schedule-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: transparent; color: #6b7280;
  padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.schedule-chip:hover { color: var(--accent); }
.schedule-chip.is-active { background: var(--accent); color: #fff; }

/* Toggle: Факт | План */
.schedule-toggle { display: inline-flex; gap: 0; border: 1px solid var(--accent); border-radius: 8px; overflow: hidden; }
.schedule-toggle-btn {
  border: none; background: #fff; color: var(--accent);
  padding: 5px 13px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.schedule-toggle-btn + .schedule-toggle-btn { border-left: 1px solid var(--accent); }
.schedule-toggle-btn.is-active { background: var(--accent); color: #fff; }

/* Dropdown «Заполнить» */
.schedule-fill { position: relative; display: inline-block; }
.schedule-fill-btn, .schedule-master-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none;
  padding: 6px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.schedule-fill-btn:hover, .schedule-master-btn:hover { background: #5a6a2a; }
.schedule-master-btn { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.schedule-master-btn:hover { background: #f3f5ec; }
.schedule-fill-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 230px; background: #fff; border: 1px solid #ececec;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(26,26,26,0.12); padding: 5px;
}
.schedule-fill-menu[hidden] { display: none; }
.schedule-fill-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: #121212;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; text-align: left;
}
.schedule-fill-item:hover { background: #f3f5ec; color: var(--accent); }

/* Мастер-график редактор */
.schedule-master-host { margin-bottom: 12px; }
.schedule-master-card {
  background: #fff; border: 1px solid #ececec; border-radius: 12px;
  padding: 14px; box-shadow: 0 4px 16px rgba(26,26,26,0.06);
}
.schedule-master-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.schedule-master-head b { font-size: 15px; color: #121212; }
.schedule-master-close { border: none; background: transparent; font-size: 22px; line-height: 1; color: #9ca3af; cursor: pointer; padding: 0 6px; }
.schedule-master-close:hover { color: #dba23a; }
.schedule-master-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
.schedule-master-day { background: #F8F8F6; border: 1px solid #ececec; border-radius: 9px; padding: 8px 7px; }
.schedule-master-dow { font-weight: 600; font-size: 12px; color: var(--accent); text-align: center; margin-bottom: 7px; }
.schedule-master-list { display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.schedule-master-row { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid #ececec; border-radius: 7px; padding: 6px; }
.schedule-master-row input {
  width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 5px;
  padding: 4px 6px; font-size: 12px; color: #121212; background: #fff;
}
.schedule-master-row input:focus { outline: none; border-color: var(--accent); }
.schedule-master-time { display: inline-block; width: 48% !important; }
.schedule-master-row .schedule-master-time:nth-of-type(3) { margin-right: 4%; }
.schedule-master-del {
  align-self: flex-end; border: none; background: transparent; color: #c4554d;
  cursor: pointer; padding: 2px; line-height: 0;
}
.schedule-master-del:hover { color: #dba23a; }
.schedule-master-add {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
  margin-top: 7px; border: 1px dashed #c8d0ab; background: transparent; color: var(--accent);
  padding: 5px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.schedule-master-add:hover { background: #f3f5ec; border-color: var(--accent); }
.schedule-master-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.schedule-master-actions button { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 760px) {
  .schedule-master-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-toolbar { gap: 8px; }
}

/* [Wave5 legal] Чек-листы — бейдж обязательного по закону */
.checklist-legal-badge{display:inline-block;margin-left:6px;padding:2px 8px;border-radius:6px;background:#fbe9e7;color:#c0392b;font-size:11px;font-weight:600;border:1px solid #e6b0aa;white-space:nowrap;cursor:help}

/* ───────────────── [wave6a] Задачи: проекты (top-level контейнер) ───────────────── */
.tasks-project-bar { display:flex; align-items:center; gap:10px; margin-bottom:12px; padding:8px 10px; background:#f7f3e8; border:1px solid #e8e0cc; border-radius:12px; }
.tasks-project-bar-icon { display:inline-flex; align-items:center; justify-content:center; color:var(--accent); }
.tasks-project-bar-icon svg { width:20px; height:20px; }
.tasks-project-select-wrap { flex:1; min-width:0; }
.tasks-project-select { width:100%; max-width:340px; background:#fff; border:1px solid #ececec; border-radius:8px; color:#121212; padding:8px 10px; font-size:14px; font-weight:600; cursor:pointer; box-sizing:border-box; }
.tasks-project-select:focus { border-color:var(--accent); outline:none; }
.tasks-project-new { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:18px; background:var(--accent); color:#fff; border:none; cursor:pointer; font-weight:600; font-size:13px; white-space:nowrap; }
.tasks-project-new:hover { background:#5c6b2b; }
.tasks-project-new svg { width:15px; height:15px; }
.tasks-project-modal { position:fixed; inset:0; z-index:10001; background:rgba(0,0,0,0.55); display:flex; align-items:center; justify-content:center; padding:5vh 4vw; }
.tasks-project-modal-inner { background:#fff; border-radius:14px; padding:24px 28px; max-width:440px; width:100%; box-shadow:0 20px 60px rgba(0,0,0,0.25); position:relative; }
.tasks-project-modal-close { position:absolute; top:14px; right:18px; background:none; border:none; color:#555; font-size:24px; cursor:pointer; line-height:1; }
.tasks-project-modal-title { display:flex; align-items:center; gap:8px; font-size:18px; font-weight:700; color:#121212; margin-bottom:16px; padding-right:30px; }
.tasks-project-modal-title-icon { display:inline-flex; color:var(--orange); }
.tasks-project-modal-title-icon svg { width:20px; height:20px; }
.tasks-project-swatches { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.tasks-project-swatch { width:30px; height:30px; border-radius:50%; border:2px solid transparent; cursor:pointer; padding:0; box-shadow:0 0 0 1px rgba(0,0,0,0.06) inset; }
.tasks-project-swatch.active { border-color:#121212; box-shadow:0 0 0 2px #fff inset, 0 0 0 1px rgba(0,0,0,0.1); }
@media (max-width: 760px) {
  .tasks-project-bar { flex-wrap:wrap; }
  .tasks-project-new span { display:none; }
  .tasks-project-select { max-width:none; }
}

/* ════════════════════════════════════════════════════════════
   WAVE 6a — «Настройки → Организация» (admin-org). Olive/cream.
   ════════════════════════════════════════════════════════════ */
.admin-org { --olive: var(--accent); padding-bottom: 40px; }
.admin-org h1.h2 { margin: 8px 0 4px; }

.admin-tabs {
  display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 18px;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 8px 14px; cursor: pointer;
  background: transparent; color: var(--text-2);
  border: none; border-bottom: 2px solid transparent; font-size: 13px; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-tab .admin-ic { width: 16px; height: 16px; }

.admin-ic { width: 18px; height: 18px; flex: 0 0 auto; }

.admin-body { min-height: 80px; }

.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.admin-card-h {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--text);
}
.admin-card-h .admin-ic { color: var(--accent); }

.admin-kv { display: flex; flex-direction: column; gap: 2px; }
.admin-kv-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.admin-kv-row:last-child { border-bottom: 0; }
.admin-kv-k { color: var(--text-3); font-size: 13px; }
.admin-kv-v { color: var(--text); font-size: 14px; font-weight: 500; text-align: right; }

.admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.admin-row:last-child { border-bottom: 0; }
.admin-row-col { flex-direction: column; align-items: flex-start; gap: 4px; }
.admin-row-main { flex: 1 1 auto; min-width: 0; }
.admin-row-title { font-size: 14px; font-weight: 500; color: var(--text); }
.admin-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; word-break: break-word; }

.admin-badge {
  flex: 0 0 auto; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--bg-soft); color: var(--text-2);
}
.admin-badge.ok  { background: rgba(45,140,90,0.12); color: var(--green); }
.admin-badge.off { background: rgba(140,140,140,0.12); color: var(--text-3); }

.admin-select, .admin-input {
  padding: 7px 10px; border-radius: 10px; font-size: 13px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  font-family: inherit;
}
.admin-select { flex: 0 0 auto; }
.admin-input { flex: 1 1 auto; min-width: 0; }
.admin-select:focus, .admin-input:focus { outline: none; border-color: var(--accent); }

.admin-icon-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text-3); border: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.admin-icon-btn:hover { background: rgba(197,58,58,0.08); color: var(--red); }
.admin-icon-btn .admin-ic { width: 16px; height: 16px; }

.admin-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
  background: var(--accent); color: #fff; border: 0; font-family: inherit;
}
.admin-btn:hover { filter: brightness(1.06); }
.admin-btn .admin-ic { width: 16px; height: 16px; }

.admin-invite-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}

.admin-muted { color: var(--text-3); font-size: 13px; padding: 6px 0; }
.admin-error {
  padding: 14px 16px; border-radius: var(--radius);
  background: rgba(197,58,58,0.08); color: var(--red); font-size: 14px;
}

/* ════════════════════════════════════════════════════════════
   WAVE 6a — Billing full-screen (Pekloos parity)
   Theme: olive var(--accent), cream #F8F8F6, warn #dba23a
   ════════════════════════════════════════════════════════════ */
.billing-screen { --bil-olive: var(--accent); --bil-warn: #dba23a; }

.billing-screen .profile-card { padding: 16px 18px; }

.billing-ico { display: inline-flex; align-items: center; vertical-align: middle; color: var(--text-2); }
.billing-ico svg { display: block; }
.billing-ico-accent { color: var(--bil-olive); }
.billing-ico-ok { color: var(--bil-olive); }

/* ── Current plan card ── */
.billing-current-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px; flex-wrap: wrap;
}
.billing-plan-name { font-size: 18px; font-weight: 700; color: var(--text); }

.billing-badge {
    padding: 2px 9px; border-radius: 999px; font-size: 11px;
    font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.billing-badge-active  { background: var(--bil-olive); color: #fff; }
.billing-badge-trial   { background: var(--bil-warn);  color: #1c1c1c; }
.billing-badge-pending { background: var(--border);    color: var(--text-2); }
.billing-badge-expired { background: #b04a3a;          color: #fff; }
.billing-badge-cancel  { background: #fff; color: #b04a3a; border: 1px solid #b04a3a; }

.billing-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
}
.billing-row:last-child { border-bottom: none; }
.billing-row-label { color: var(--text-3); }
.billing-row-val   { color: var(--text); font-weight: 500; text-align: right; }
.billing-card-status { display: inline-flex; align-items: center; gap: 6px; }

.billing-days { color: var(--text-3); font-size: 12px; font-weight: 400; }
.billing-warn { color: var(--bil-warn); }
.billing-warn .billing-days { color: var(--bil-warn); }

.billing-bar {
    height: 6px; border-radius: 4px; background: var(--bg-soft);
    overflow: hidden; margin: -4px 0 8px;
}
.billing-bar-fill { height: 100%; background: var(--bil-olive); border-radius: 4px; transition: width .3s ease; }
.billing-bar-full { background: var(--bil-warn); }

/* ── Action buttons ── */
.billing-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.billing-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 7px; font-size: 13px; padding: 11px 10px;
}
.billing-action-danger {
    color: #b04a3a; border: 1px solid #b04a3a; background: transparent;
}
.billing-action-danger:hover { background: rgba(176,74,58,0.06); }

/* ── Section titles ── */
.billing-section-title {
    margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}

/* ── Plan comparison ── */
.billing-compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.billing-plan-col {
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 10px;
    display: flex; flex-direction: column; gap: 4px;
}
.billing-plan-current { border-color: var(--bil-olive); box-shadow: 0 0 0 1px var(--bil-olive); }
.billing-plan-col-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.billing-plan-col-name { font-weight: 700; font-size: 14px; color: var(--text); }
.billing-plan-col-price { font-weight: 700; font-size: 15px; color: var(--text); }
.billing-plan-col-year { font-size: 11px; color: var(--text-3); }
.billing-plan-col-seats { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.billing-feat-list { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.billing-feat-list li { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.billing-pick-btn { margin-top: auto; font-size: 13px; padding: 9px; }

/* ── Payment history table ── */
.billing-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.billing-table th, .billing-table td {
    border-bottom: 1px solid var(--border-soft); padding: 9px 6px; text-align: left;
    background: transparent; color: var(--text);
}
.billing-table th { color: var(--text-3); font-weight: 500; }
.billing-table tr:last-child td { border-bottom: none; }
.billing-inv-status { font-size: 12px; font-weight: 600; }
.billing-inv-paid      { color: var(--bil-olive); }
.billing-inv-pending   { color: var(--bil-warn); }
.billing-inv-failed    { color: #b04a3a; }
.billing-inv-cancelled { color: var(--text-3); }
.billing-inv-refunded  { color: var(--text-3); }
.billing-empty-hint { margin: 0; }

/* ── Sheets / modals ── */
.billing-sheet-plans { display: grid; gap: 12px; }
.billing-sheet-plan { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.billing-plan-preselect { border-color: var(--bil-olive); box-shadow: 0 0 0 1px var(--bil-olive); }
.billing-sheet-plan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.billing-sheet-plan-name { font-weight: 700; font-size: 15px; color: var(--text); }
.billing-sheet-plan-price { font-weight: 700; margin-bottom: 2px; }
.billing-sheet-plan-year { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.billing-sheet-plan-btns { display: flex; gap: 8px; }
.billing-cycle-btn { flex: 1; font-size: 13px; padding: 10px; }
.billing-sheet-note { font-size: 12px; color: var(--text-3); margin: 4px 0 0; line-height: 1.4; }

.billing-invoice-form { display: flex; flex-direction: column; gap: 10px; }
.billing-inv-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.billing-inv-input {
    border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px;
    font-size: 16px; background: var(--bg-card); color: var(--text);
}
.billing-inv-input:focus { outline: none; border-color: var(--bil-olive); }
.billing-inv-submit { margin-top: 4px; }

.billing-cancel-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 6px 0; }
.billing-cancel-ico { color: #b04a3a; }
.billing-cancel-text { font-size: 14px; color: var(--text-2); line-height: 1.5; margin: 0; }
.billing-cancel-btns { display: flex; gap: 10px; width: 100%; }
.billing-cancel-keep { flex: 1; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); }
.billing-cancel-go { flex: 1; }

.billing-empty { padding: 16px; }
.billing-empty p { margin: 0 0 12px; }

@media (max-width: 480px) {
    .billing-actions { grid-template-columns: 1fr; }
    .billing-compare-grid { grid-template-columns: 1fr; }
}

/* ============================================================== */
/* WAVE 7: Reviews auto-reply (5★ / positive). Append-only.       */
/* ============================================================== */
.reviews-autoreply-btn { transition: background 0.15s, border-color 0.15s; }
.reviews-autoreply-btn:hover { background: #f0f2e8; border-color: var(--accent); }

.reviews-autoreply-backdrop { animation: reviews-autoreply-fade 0.12s ease-out; }
@keyframes reviews-autoreply-fade { from { opacity: 0; } to { opacity: 1; } }

.reviews-autoreply-modal .reviews-autoreply-row:last-of-type { border-bottom: none; }
.reviews-autoreply-status { background: #f0f2e8; border-radius: 8px; padding: 8px 12px; }

.reviews-autoreply-badge { line-height: 1; }

/* ============================================================
   Wave 7 — AI экран: week-summary + card metadata + filter chips
   Freshli light theme: #F8F8F6 page / #fff cards / #ececec border / olive var(--accent)
   ============================================================ */

/* ---- B: метаданные карточки (тип · статус · relative) ---- */
.opdir-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0ec;
    font-size: 11px;
    color: #8C8C8C;
}
.opdir-card-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.opdir-card-meta-item:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: #cfcfcf;
}
.opdir-card-meta-ico { display: inline-flex; opacity: .6; }
.opdir-card-meta-ico svg { width: 12px; height: 12px; display: block; }

/* ---- C: фильтры-чипы по категориям ---- */
.opdir-filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 2px;
}
.opdir-filter-ico { display: inline-flex; color: #8C8C8C; margin-right: 2px; }
.opdir-filter-ico svg { width: 14px; height: 14px; display: block; }
.opdir-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #5C5C5C;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 999px;
    padding: 5px 11px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.opdir-chip:hover { border-color: #d8d8d2; }
.opdir-chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.opdir-chip-count {
    font-size: 11px;
    font-weight: 700;
    opacity: .7;
    background: rgba(0, 0, 0, .05);
    border-radius: 999px;
    padding: 0 6px;
    min-width: 16px;
    text-align: center;
}
.opdir-chip.is-active .opdir-chip-count { background: rgba(255, 255, 255, .22); opacity: 1; }

/* ---- A: «Итоги недели» (collapsible week-summary) ---- */
.opdir-weekly {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}
.opdir-weekly-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #121212;
}
.opdir-weekly-head-left { display: inline-flex; align-items: center; gap: 9px; }
.opdir-weekly-ico { display: inline-flex; color: var(--accent); }
.opdir-weekly-ico svg { width: 16px; height: 16px; display: block; }
.opdir-weekly-chev { display: inline-flex; color: #8C8C8C; }
.opdir-weekly-chev svg { width: 14px; height: 14px; display: block; }
.opdir-weekly-body-wrap { border-top: 1px solid #f0f0ec; }
.opdir-weekly-body { padding: 14px 16px 16px; }

.opdir-week-headline {
    font-size: 14px;
    font-weight: 600;
    color: #121212;
    line-height: 1.4;
    margin-bottom: 12px;
}

.opdir-week-trends {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.opdir-week-trend {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #F8F8F6;
    border: 1px solid #f0f0ec;
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 84px;
}
.opdir-week-trend-label { font-size: 11px; color: #8C8C8C; }
.opdir-week-trend-val { font-size: 15px; font-weight: 700; color: #121212; }
.opdir-week-delta { font-size: 11px; font-weight: 600; }
.opdir-week-delta-ok { color: #2a7c3f; }
.opdir-week-delta-bad { color: #d44; }

.opdir-week-block { margin-top: 12px; }
.opdir-week-block-h {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #8C8C8C;
    margin-bottom: 6px;
}
.opdir-week-ach .opdir-week-block-h { color: #2a7c3f; }
.opdir-week-prob .opdir-week-block-h { color: #d44; }
.opdir-week-rec .opdir-week-block-h { color: var(--accent); }
.opdir-week-list { margin: 0; padding-left: 18px; }
.opdir-week-list li {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 4px;
}
.opdir-week-note {
    margin-top: 12px;
    font-size: 11px;
    color: #a0a0a0;
    font-style: italic;
}

/* ── [wave8] Ликвидность: GMROI/Продажи% легенда + статус кэша ─────────────── */
.storage-helpers-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #8a8a82;
    margin: 2px 2px 0 2px;
}
.storage-helpers-status svg { width: 13px; height: 13px; }
.storage-helpers-status-txt { color: #8a8a82; }
.storage-helpers-dot { color: #c5c5bc; }
.storage-helpers-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}
.storage-helpers-refresh:active { background: rgba(31, 30, 29,0.10); }
.storage-helpers-refresh:disabled { opacity: 0.6; cursor: default; }
.storage-helpers-refresh svg { width: 13px; height: 13px; }
.storage-helpers-refresh.spinning .storage-helpers-ricon {
    animation: storageHelpersSpin 0.8s linear infinite;
}
@keyframes storageHelpersSpin { to { transform: rotate(360deg); } }
.storage-helpers-legend { margin-top: 8px; }
.storage-helpers-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(31, 30, 29,0.30);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}
.storage-helpers-legend-toggle:active { background: rgba(31, 30, 29,0.08); }
.storage-helpers-legend-toggle svg { width: 13px; height: 13px; }
.storage-helpers-legend-toggle.open { background: rgba(31, 30, 29,0.08); }
.storage-helpers-legend-panel {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #e8e6dc;
    border-radius: 10px;
    background: #F8F8F6;
}
.storage-helpers-legend-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.storage-helpers-legend-tag {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    min-width: 72px;
}
.storage-helpers-legend-tag.pos  { color: var(--accent); }
.storage-helpers-legend-tag.warn { color: #c08e1e; }
.storage-helpers-legend-tag.neg  { color: #c0392b; }
.storage-helpers-legend-desc { font-size: 12px; color: #555; line-height: 1.4; }
.storage-helpers-legend-note {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0ded3;
    font-size: 11px;
    color: #8a8a82;
    line-height: 1.45;
}

/* ─────────────────────────────────────────────────────────────
   WAVE 8 (polish) — «Поддержка»: единая форма обращения.
   Тема olive var(--accent) / cream #F8F8F6. Без emoji, Lucide SVG.
   ───────────────────────────────────────────────────────────── */
.support-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 20, 19, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: sm-fade-in 160ms ease-out;
    padding: 16px;
}
.support-modal {
    width: min(460px, 94vw);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(20, 20, 19, 0.22);
    display: flex;
    flex-direction: column;
}
.support-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border-soft, #E8E5DC);
}
.support-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif), Georgia, serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text, #121212);
}
.support-title span { line-height: 1; }
.support-title svg { color: var(--accent); flex-shrink: 0; }
.support-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--text-3, #8F8E87);
    border-radius: 8px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.support-close:hover { background: var(--bg, #F8F8F6); color: var(--text, #121212); }
.support-body {
    padding: 16px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.support-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2, #5C5B55);
    margin-top: 10px;
}
.support-select,
.support-input,
.support-textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    color: var(--text, #121212);
    background: var(--bg, #F8F8F6);
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.support-textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.support-select:focus,
.support-input:focus,
.support-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 30, 29, 0.14);
}
.support-foot {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: flex-end;
}
.support-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #F8F8F6;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 120ms ease, opacity 120ms ease;
}
.support-send:hover { background: #5a6a2a; }
.support-send:disabled { opacity: 0.55; cursor: default; }
.support-send svg { flex-shrink: 0; }

/* Опциональная floating-кнопка */
.support-fab {
    position: fixed;
    right: 18px; bottom: 18px;
    width: 48px; height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #D1CFC5);
    border-radius: 50%;
    background: var(--bg-card, #FFFFFF);
    color: var(--accent);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(20, 20, 19, 0.16);
    z-index: 10001;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.support-fab:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(20, 20, 19, 0.22); }

/* ===== Home: Факт/План — два больших таба (stage37) ===== */
.home-fp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    cursor: pointer;
}
.home-fp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.15s ease;
}
.home-fp:hover .home-fp-card { box-shadow: 0 4px 16px rgba(0,0,0,0.05); }
.home-fp-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    font-weight: 600;
}
.home-fp-fact {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    line-height: 1.1;
}
.home-fp-plan {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
}
.home-fp-plan-lbl { color: var(--text-3); }
.home-fp-plan-val { font-weight: 600; color: var(--text-2); }
.home-fp-prog {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--text-2);
}
.home-fp-prog.pos { background: rgba(45,140,90,0.12); color: var(--green); }
.home-fp-prog.warn { background: rgba(217,119,87,0.14); color: var(--orange); }
@media (max-width: 380px) {
    .home-fp { grid-template-columns: 1fr; }
    .home-fp-fact { font-size: 26px; }
}

/* ===== Home: 4-card факт/прогноз/план (stage43) ===== */
.home-fp-4 { grid-template-columns: 1fr 1fr; }
.home-fp-card--plan { background: var(--bg-soft); border-color: transparent; }
.home-fp-card--plan .home-fp-fact { font-size: 22px; color: var(--text-2); }
.home-fp-fact--sm { font-size: 22px; }

/* ============================================================
   DESIGN UNIFICATION — Phase 1 (2026-06-03)
   Единый радиус карточек во всех namespace (был 10/14/16/18).
   Аппенд в конце = выигрывает по каскаду. Откат: удалить блок.
   ============================================================ */
.gcard, .kpi-card, .drill-card, .av2-tile, .alert-card, .insight-card,
.big-card, .ai-operdir-card, .margin-card, .modal-card, .p5-acc-card,
.profile-card, .p5-signup-card {
  border-radius: 14px !important;
}

/* ============================================================
   DESIGN UNIFICATION — Phase 2/3 foundation (2026-06-03)
   Единый контракт состояний для всех экранов.
   ЗАГРУЗКА:  <div class="skeleton"><div class="skeleton-card"></div>
              <div class="skeleton-pulse"></div><div class="skeleton-pulse"></div></div>
   ПУСТО:     <div class="empty-state"><div class="empty-state-icon">EMOJI</div>
              <div class="empty-state-title">T</div><div class="empty-state-sub">S</div>
              [<button class="empty-state-cta" data-nav="X">CTA</button>]</div>
   ============================================================ */
.skeleton-pulse { height: 14px; }
.skeleton-pulse--lg { height: 22px; }
.skeleton-card {
  height: 76px; border-radius: 14px; margin-bottom: 4px;
  background: linear-gradient(90deg,#E8E2D6 0%,#F0EADE 50%,#E8E2D6 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 12px 0; }
.empty-state { color: var(--text-2); }
.empty-state-sub { font-size: 13px; color: var(--text-3); max-width: 340px; line-height: 1.45; margin-bottom: 14px; }

/* ============================================================
   DESIGN UNIFICATION — Phase 4 (2026-06-03)
   ЕДИНЫЙ источник токенов. Перекрывает 3 старых :root-блока
   (поколения F5F0E8 / Claude Code / claude.ai) — теперь правда здесь.
   Значения = ранее побеждавшие (вид не меняется) + бренд-токены.
   ============================================================ */
/* :root → css/tokens.css [2026-06-12] */ 
/* matrix-puzzle tag (BCG: низкий объём/высокая маржа) */
.matrix-tag.matrix-puzzle { background: rgba(70,108,180,0.12); color: #4467AD; }

/* === v4: сайдбар-футер с аватаром + терра-FAB чата в таббаре === */
.ds-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 6px;
  border-top: 1px solid var(--border-soft);
  cursor: pointer; border-radius: var(--radius-sm);
}
.ds-user:hover { background: rgba(10, 10, 10, 0.03); }
.ds-ava {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.ds-ava img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.ds-ava i { font-style: normal; }
.ds-ava:not(.noimg) i { visibility: hidden; }
.ds-user-text { line-height: 1.25; min-width: 0; }
.ds-user-text b { display: block; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-user-text span { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.tab-item.tab-chat { position: relative; }
.tab-chat-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; box-shadow: 0 4px 12px rgba(217, 119, 87, 0.38);
}
.tab-chat-fab svg { width: 20px; height: 20px; }
.tab-item.tab-chat.active .tab-chat-fab { background: var(--text); box-shadow: 0 4px 12px rgba(10, 10, 10, 0.3); }
