/* public/css/app.css */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Jost:wght@300;400;500;600&display=swap');

:root {
  /* Тёплая светлая схема — фон #d0b8ad, тёмный текст */
  --bg:     #d0b8ad;   /* Основной фон */
  --s1:     #e2cfc7;   /* Карточки / панели */
  --s2:     #edddd7;   /* Вторичные поверхности (инпуты, строки) */
  --s3:     #f5ece8;   /* Третичные поверхности */
  --border: #b8a098;   /* Граница */
  --border2:#9e8478;   /* Граница при hover */
  --rose:   #7a3a28;   /* Основной акцент — тёмно-терракотовый */
  --rose2:  #a05040;   /* Светлее */
  --sage:   #2a6e4a;   /* Зелёный — приход / положительное */
  --sage2:  #3a9060;
  --gold:   #8a5c1a;   /* Золотой — предупреждение */
  --gold2:  #b07820;
  --cream:  #1a0e08;   /* Основной текст — почти чёрный */
  --cream2: #3a2218;   /* Вторичный текст */
  --muted:  #5a4038;   /* Приглушённый текст */
  --muted2: #8a6858;   /* Очень приглушённый */
  --red:    #c02010;   /* Красный — ошибки / убытки */
  --sidebar-w: 240px;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Jost',sans-serif; background:var(--bg); color:var(--cream); min-height:100vh; display:flex; font-size:15px; line-height:1.5; font-weight:500; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--s1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-flower {
  font-size: 24px;
  animation: breathe 4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.sidebar-title { font-family:'Cormorant Garamond',serif; font-size:16px; font-weight:600; color:var(--cream); line-height:1.2; }
.sidebar-sub   { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.7px; margin-top:2px; }

/* Навигация — скроллится, не уходит за экран */
.sidebar-nav {
  padding: 8px 8px;
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  /* Кастомный скроллбар */
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  border: none; background: transparent; color: var(--muted);
  font-family:'Jost',sans-serif; font-size:13px; font-weight:400;
  cursor: pointer; transition: all .18s; text-align: left; width: 100%;
  flex-shrink: 0; white-space: nowrap;
}
.nav-item:hover { background: var(--s2); color: var(--cream); }
.nav-item.active {
  background: var(--s2); color: var(--cream);
  border: 1px solid var(--border2);
  font-weight: 500;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

/* Нижняя панель — всегда видна */
.sidebar-bottom {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-card { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; overflow: hidden; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--muted); text-transform: capitalize; }
.sidebar-actions { display: flex; gap: 5px; }
.sa-btn {
  flex: 1; padding: 7px 6px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 14px; transition: all .2s; color: var(--muted2);
}
.sa-btn:hover { border-color: var(--rose); background: rgba(122,58,40,.1); color: var(--rose); }

/* (topbar-mobile-actions removed) */
.topbar-act-btn {
  width: 34px; height: 34px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--s2); color: var(--muted2);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
}
.topbar-act-btn:hover { border-color: var(--rose); color: var(--rose); }
.topbar-act-btn.logout:hover { border-color: var(--red); color: var(--red); background: rgba(192,32,16,.08); }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  height: 56px; background: var(--s1); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.menu-btn { display:none; background:none; border:none; color:var(--cream); font-size:20px; cursor:pointer; }
.topbar-title { font-family:'Cormorant Garamond',serif; font-size:18px; font-weight:600; flex:1; }
.clock { font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }

/* ── PAGES ── */
.page { display:none; padding:24px; animation:fadeUp .3s ease-out; }
.page.active { display:block; }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ── KPI ── */
.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.kpi { background:var(--s1); border:1px solid var(--border); border-radius:14px; padding:18px 20px; position:relative; overflow:hidden; transition:transform .2s; }
.kpi:hover { transform:translateY(-2px); }
.kpi::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.kpi.rose::before { background:linear-gradient(90deg,var(--rose),var(--rose2)); }
.kpi.sage::before { background:linear-gradient(90deg,var(--sage),var(--sage2)); }
.kpi.gold::before { background:linear-gradient(90deg,var(--gold),var(--gold2)); }
.kpi.red::before  { background:linear-gradient(90deg,var(--red),#d47060); }
.kpi-ico  { font-size:26px; margin-bottom:10px; }
.kpi-val  { font-size:26px; font-weight:600; color:var(--cream); line-height:1; }
.kpi-lbl  { font-size:11px; color:var(--muted); margin-top:5px; text-transform:uppercase; letter-spacing:.6px; }

/* ── PROMO ── */
.promo-banner {
  background:linear-gradient(135deg,#c8a898,#c0b0a4);
  border:1px solid var(--border); border-radius:14px;
  padding:16px 20px; display:flex; align-items:center; gap:14px;
  margin-bottom:20px; position:relative; overflow:hidden;
}
.promo-banner::after { content:'🌸🌿🌷'; position:absolute; right:18px; font-size:28px; opacity:.25; letter-spacing:6px; }
.promo-icon  { font-size:30px; }
.promo-title { font-family:'Cormorant Garamond',serif; font-size:15px; font-weight:600; margin-bottom:3px; }
.promo-text  { font-size:12px; color:var(--muted); }

/* ── CARDS / ROWS ── */
.dash-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.card { background:var(--s1); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.card-head { padding:16px 20px 12px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.card-title { font-family:'Cormorant Garamond',serif; font-size:16px; font-weight:600; color:var(--cream2); }
.card-body  { padding:18px 20px; }

/* ── CHART ── */
.bar-chart { display:flex; align-items:flex-end; gap:7px; height:120px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:5px; }
.bar-stack { display:flex; flex-direction:column; justify-content:flex-end; gap:2px; flex:1; width:100%; }
.b-out { border-radius:4px 4px 0 0; background:linear-gradient(180deg,var(--rose),rgba(200,112,90,.3)); min-height:2px; transition:height .6s; }
.b-in  { border-radius:4px; background:linear-gradient(180deg,var(--sage),rgba(125,168,122,.3)); min-height:2px; transition:height .6s; }
.b-lbl { font-size:10px; color:var(--muted); }
.chart-legend { display:flex; gap:14px; margin-top:12px; }
.legend-item  { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--muted); }
.ldot { width:7px; height:7px; border-radius:50%; }

/* ── TOP / FEED ── */
.top-item { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.top-item:last-child { border-bottom:none; }
.top-rank  { font-size:11px; color:var(--muted); min-width:16px; }
.top-emoji { font-size:18px; }
.top-info  { flex:1; }
.top-name  { font-size:13px; font-weight:500; }
.top-cat   { font-size:11px; color:var(--muted); }
.top-bar   { width:70px; height:4px; background:var(--s3); border-radius:2px; overflow:hidden; }
.top-bar-fill { height:100%; background:var(--rose); border-radius:2px; transition:width .6s; }
.top-val   { font-size:12px; color:var(--muted); min-width:26px; text-align:right; }

.feed-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:12px; }
.feed-item:last-child { border-bottom:none; }
.fdot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.fdot.in  { background:var(--sage); }
.fdot.out { background:var(--rose); }
.fdot.add { background:var(--gold); }
.fdot.del { background:var(--red); }
.feed-text { flex:1; color:var(--cream2); }
.feed-time { font-size:10px; color:var(--muted); white-space:nowrap; }

/* ── TOOLBAR ── */
.toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.search-wrap { position:relative; flex:1; min-width:200px; }
.search-wrap input { width:100%; background:var(--s1); border:1px solid var(--border); color:var(--cream); padding:9px 14px 9px 38px; border-radius:10px; font-family:'Jost',sans-serif; font-size:13px; outline:none; transition:border-color .2s; }
.search-wrap input:focus { border-color:var(--rose); }
.search-wrap input::placeholder { color:var(--muted2); }
.si { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted2); pointer-events:none; }
select { background:var(--s1); border:1px solid var(--border); color:var(--cream); padding:9px 12px; border-radius:10px; font-family:'Jost',sans-serif; font-size:13px; outline:none; cursor:pointer; }
select:focus { border-color:var(--rose); }
.btn { padding:9px 16px; border:none; border-radius:10px; font-family:'Jost',sans-serif; font-size:13px; font-weight:500; cursor:pointer; transition:all .2s; display:flex; align-items:center; gap:6px; white-space:nowrap; }
.btn-primary { background:var(--rose); color:#fff; }
.btn-primary:hover { background:var(--rose2); transform:translateY(-1px); }
.btn-ghost { background:var(--s1); color:var(--muted); border:1px solid var(--border); }
.btn-ghost:hover { border-color:var(--rose); color:var(--rose2); }
.view-toggle { display:flex; gap:4px; }
.vt { width:32px; height:32px; border-radius:7px; border:1px solid var(--border); background:var(--s1); color:var(--muted); cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.vt.active,.vt:hover { border-color:var(--rose); color:var(--rose); }

/* ── CATEGORY TABS ── */
.cats { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:16px; }
.cat-btn { padding:6px 14px; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--muted); font-family:'Jost',sans-serif; font-size:12px; cursor:pointer; transition:all .2s; }
.cat-btn:hover { border-color:var(--rose); color:var(--rose); }
.cat-btn.active { background:var(--rose); border-color:var(--rose); color:#fff; }

/* ── ALERTS ── */
.alerts-wrap { display:flex; flex-direction:column; gap:7px; margin-bottom:16px; }
.alert-item { background:rgba(184,85,64,.1); border:1px solid rgba(184,85,64,.25); border-radius:9px; padding:10px 14px; font-size:12px; color:#e09080; display:flex; align-items:center; gap:9px; }

/* ── TABLE ── */
.table-wrap { background:var(--s1); border:1px solid var(--border); border-radius:14px; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; }
table { width:100%; border-collapse:collapse; }
thead th { padding:12px 14px; text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.7px; color:var(--muted2); font-weight:500; border-bottom:1px solid var(--border); background:var(--s2); cursor:pointer; user-select:none; white-space:nowrap; }
thead th:hover { color:var(--rose); }
tbody tr { border-bottom:1px solid var(--border); transition:background .15s; }
tbody tr:last-child { border-bottom:none; }
tbody tr:hover { background:var(--s2); }
td { padding:12px 14px; font-size:14px; vertical-align:middle; }

.item-thumb { width:40px; height:40px; border-radius:8px; overflow:hidden; background:var(--s3); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:20px; cursor:pointer; flex-shrink:0; }
.item-thumb img { width:100%; height:100%; object-fit:cover; }
.item-name-cell { display:flex; align-items:center; gap:10px; }
.item-name { font-weight:500; font-size:13px; }
.item-sku  { font-size:11px; color:var(--muted2); margin-top:1px; }

.qty-cell { display:flex; align-items:center; gap:6px; }
.qty-btn { width:26px; height:26px; border-radius:6px; border:1px solid var(--border); background:var(--s2); color:var(--cream); font-size:14px; cursor:pointer; transition:all .15s; display:flex; align-items:center; justify-content:center; }
.qty-btn:hover { border-color:var(--rose); color:var(--rose); }
.qty-num  { min-width:30px; text-align:center; font-weight:600; }
.qty-unit { font-size:11px; color:var(--muted2); }

.badge { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:500; }
.badge-green  { background:rgba(125,168,122,.15); color:var(--sage2); }
.badge-yellow { background:rgba(201,160,80,.15);  color:var(--gold2); }
.badge-red    { background:rgba(184,85,64,.15);   color:#e09080; }
.badge-admin  { background:rgba(122,58,40,.15);  color:var(--rose2); }
.badge-user   { background:rgba(125,168,122,.1);  color:var(--sage2); }
.badge-off    { background:rgba(80,70,60,.3);      color:var(--muted); }

.act-btns { display:flex; gap:5px; }
.act-btn { width:28px; height:28px; border-radius:6px; border:1px solid var(--border); background:transparent; color:var(--muted2); cursor:pointer; font-size:12px; transition:all .15s; display:flex; align-items:center; justify-content:center; }
.act-btn.edit:hover  { border-color:var(--sage);  color:var(--sage); }
.act-btn.move:hover  { border-color:var(--gold);  color:var(--gold); }
.act-btn.del:hover   { border-color:var(--red);   color:var(--red); }
.act-btn.pass:hover  { border-color:var(--rose2); color:var(--rose2); }

/* ── CARDS GRID ── */
.cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
.item-card { background:var(--s1); border:1px solid var(--border); border-radius:14px; overflow:hidden; transition:all .2s; cursor:pointer; }
.item-card:hover { transform:translateY(-3px); border-color:var(--border2); box-shadow:0 8px 24px rgba(0,0,0,.4); }
.item-card-img { height:120px; background:var(--s2); display:flex; align-items:center; justify-content:center; font-size:44px; position:relative; overflow:hidden; }
.item-card-img img { width:100%; height:100%; object-fit:cover; }
.item-card-body { padding:12px 14px; }
.item-card-name { font-weight:500; font-size:13px; margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.item-card-cat-row { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:8px; }
.item-card-cat  { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.item-card-foot { display:flex; justify-content:space-between; align-items:center; }
.item-card-qty  { font-size:18px; font-weight:600; }
.item-card-price{ font-size:11px; color:var(--muted); }
.item-card-actions { display:flex; gap:8px; margin-top:8px; justify-content:center; }
.item-card-actions .act-btn { background:var(--s2); border:1px solid var(--border); width:36px; height:36px; border-radius:8px; }

/* ── REPORT ── */
.report-bar { display:flex; align-items:center; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.period-btns { display:flex; gap:6px; }
.period-btn { padding:6px 16px; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--muted); font-family:'Jost',sans-serif; font-size:12px; cursor:pointer; transition:all .2s; }
.period-btn:hover { border-color:var(--rose); color:var(--rose); }
.period-btn.active { background:var(--rose); border-color:var(--rose); color:#fff; }
.report-kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:20px; }
.report-kpi { background:var(--s1); border:1px solid var(--border); border-radius:14px; padding:18px 20px; }
.rk-val { font-size:26px; font-weight:600; }
.rk-lbl { font-size:11px; color:var(--muted); margin-top:5px; text-transform:uppercase; letter-spacing:.6px; }

#history-table-view { background:var(--s1); border:1px solid var(--border); border-radius:14px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.history-table { width:100%; border-collapse:collapse; }
.history-table thead th { padding:10px 14px; text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.7px; color:var(--muted2); border-bottom:1px solid var(--border); background:var(--s2); white-space:nowrap; }
.history-table td { padding:10px 14px; font-size:12px; border-bottom:1px solid var(--border); }
.history-table tr:last-child td { border-bottom:none; }
.history-table tbody tr:hover td { background:var(--s2); }
.mov-in  { color:var(--sage2); font-weight:600; }
.mov-out { color:var(--rose2); font-weight:600; }

/* ── МОБИЛЬНЫЕ КАРТОЧКИ ДЛЯ ОТЧЁТОВ ── */
.history-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}
.history-card {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  transition: all 0.2s;
  animation: fadeInUp 0.3s ease-out;
}
.history-card:hover {
  border-color: var(--rose);
}
.history-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.history-card-icon {
  width: 40px;
  height: 40px;
  background: var(--s1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--rose);
}
.history-card-title {
  flex: 1;
}
.history-card-name {
  font-weight: 600;
  font-size: 14px;
}
.history-card-type {
  font-size: 11px;
  color: var(--muted);
}
.history-card-date {
  font-size: 11px;
  color: var(--muted2);
}
.history-card-details {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.history-card-qty {
  font-size: 20px;
  font-weight: 600;
}
.history-card-qty.in {
  color: var(--sage2);
}
.history-card-qty.out {
  color: var(--rose2);
}
.history-card-before-after {
  font-size: 12px;
  color: var(--muted);
}
.history-card-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.history-card-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted2);
  background: var(--s1);
  padding: 6px 10px;
  border-radius: 8px;
}

/* ── КАРТОЧКИ ПОЛЬЗОВАТЕЛЕЙ ── */
.users-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color .15s;
  animation: fadeInUp 0.2s ease-out;
}
.user-card:hover { border-color: var(--border2); }
.user-card-inactive { opacity: .6; }

.uc-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar-card {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
}
.uc-body {
  flex: 1;
  min-width: 0;
}
.uc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.user-login-card {
  font-weight: 700;
  font-size: 14px;
  color: var(--cream2);
}
.uc-name {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-dates {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted2);
}
.uc-dates i { opacity: .6; margin-right: 3px; }

.uc-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.uc-actions .act-btn {
  background: var(--s2);
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
}

/* ── MODAL ── */
.overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:300; align-items:center; justify-content:center; padding:20px; }
.overlay.open { display:flex; animation:fadeIn .2s; }
@keyframes fadeIn { from{opacity:0} }
.modal { background:var(--s1); border:1px solid var(--border); border-radius:16px; width:100%; max-width:460px; animation:slideUp .25s ease-out; max-height:90vh; overflow-y:auto; }
.modal-lg { max-width:560px; }
@keyframes slideUp { from{transform:translateY(16px);opacity:0} }
.modal-head { padding:18px 22px 14px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:var(--s1); z-index:1; }
.modal-title { font-family:'Cormorant Garamond',serif; font-size:19px; font-weight:600; }
.modal-close { background:none; border:none; color:var(--muted); font-size:19px; cursor:pointer; }
.modal-close:hover { color:var(--cream); }
.modal-body { padding:18px 22px; }
.modal-foot { padding:14px 22px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; position:sticky; bottom:0; background:var(--s1); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.field label { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; }
.field input, .field select, .field textarea { background:var(--s2); border:1px solid var(--border); color:var(--cream); padding:9px 11px; border-radius:8px; font-family:'Jost',sans-serif; font-size:13px; outline:none; transition:border-color .2s; width:100%; }
.field input:focus,.field select:focus,.field textarea:focus { border-color:var(--rose); }
.field textarea { resize:vertical; min-height:65px; }

.photo-upload-area { border:2px dashed var(--border2); border-radius:12px; padding:20px; text-align:center; cursor:pointer; transition:all .2s; margin-bottom:14px; }
.photo-upload-area:hover { border-color:var(--rose); background:rgba(122,58,40,.05); }

.move-type-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.move-type-btn { padding:12px; border-radius:10px; border:1px solid var(--border); background:var(--s2); color:var(--muted); font-family:'Jost',sans-serif; font-size:14px; cursor:pointer; transition:all .2s; }
.move-type-btn:hover { border-color:var(--rose); }
.move-type-btn.active { background:var(--rose); border-color:var(--rose); color:#fff; }

/* ── EMPTY ── */
.empty-state { text-align:center; padding:50px 20px; color:var(--muted2); }
.empty-state div { font-size:44px; margin-bottom:12px; }

/* ── TOAST ── */
.toast-wrap { position:fixed; bottom:22px; right:22px; z-index:400; display:flex; flex-direction:column; gap:7px; }
.toast { background:var(--s2); border:1px solid var(--border); border-radius:10px; padding:11px 16px; font-size:13px; color:var(--cream); animation:toastIn .3s ease-out; display:flex; align-items:center; gap:9px; min-width:200px; }
.toast.success { border-left:3px solid var(--sage); }
.toast.error   { border-left:3px solid var(--red); }
.toast.info    { border-left:3px solid var(--gold); }
@keyframes toastIn { from{transform:translateX(14px);opacity:0} }

/* ── SALES / LOSSES PAGES ── */
.btn-danger { background:var(--red); color:#fff; }
.btn-danger:hover { background:#d46050; transform:translateY(-1px); }

.tx-page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.tx-page-header > div:nth-child(2) { flex: 1; }
.tx-page-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.tx-page-icon.sales-icon  { background: rgba(125,168,122,.15); color: var(--sage2); }
.tx-page-icon.losses-icon { background: rgba(184,85,64,.15);   color: var(--rose2); }
.tx-page-title { font-family:'Cormorant Garamond',serif; font-size:22px; font-weight:600; }
.tx-page-sub   { font-size:12px; color:var(--muted); }

.tx-stats {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.tx-stat-card {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 140px;
}
.tx-stat-card.sales  { border-top: 2px solid var(--sage); }
.tx-stat-card.losses { border-top: 2px solid var(--red); }
.tx-stat-ico { font-size: 20px; color: var(--muted); }
.tx-stat-val { font-size: 20px; font-weight: 600; line-height: 1; }
.tx-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* Список транзакций */
.tx-list { display: flex; flex-direction: column; gap: 10px; }
.tx-card {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; transition: border-color .2s;
}
.tx-card:hover { border-color: var(--border2); }
.tx-card-left  { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.tx-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.tx-dot.sale { background: var(--sage); }
.tx-dot.loss { background: var(--red); }
.tx-card-body { flex: 1; min-width: 0; }
.tx-card-name  { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.tx-card-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tx-price { color: var(--sage2); font-weight: 600; font-size: 13px; }
.tx-note  { font-size: 11px; color: var(--muted2); margin-bottom: 4px; }
.tx-meta-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tx-user { font-size: 11px; color: var(--muted2); }
.tx-time { font-size: 11px; color: var(--muted2); }
.tx-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.tx-thumb  { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); transition: transform .2s; }
.tx-thumb:hover { transform: scale(1.06); }

/* Бейджи оплаты / причин */
.pay-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500;
}
.pay-badge.cash     { background: rgba(125,168,122,.15); color: var(--sage2); }
.pay-badge.transfer { background: rgba(201,160,80,.15);  color: var(--gold2); }
.reason-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px; font-size: 11px;
  background: rgba(184,85,64,.12); color: var(--rose2);
}

/* Выбор товара (picker) */
.item-picker {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.item-picker-search {
  position: relative; padding: 8px;
  border-bottom: 1px solid var(--border);
}
.item-picker-search input {
  width: 100%; background: var(--s1); border: 1px solid var(--border);
  color: var(--cream); padding: 8px 10px 8px 34px;
  border-radius: 8px; font-family: 'Jost',sans-serif; font-size: 13px; outline: none;
}
.item-picker-search input:focus { border-color: var(--rose); }
.item-picker-search .si { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted2); }
.item-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; padding: 10px; max-height: 260px; overflow-y: auto;
}
.picker-item {
  background: var(--s1); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; text-align: center; cursor: pointer; transition: all .2s;
}
.picker-item:hover { border-color: var(--rose); transform: translateY(-2px); }
.picker-img { width: 60px; height: 60px; margin: 0 auto 6px; border-radius: 8px; overflow: hidden; background: var(--s2); display: flex; align-items: center; justify-content: center; }
.picker-name { font-size: 11px; font-weight: 600; line-height: 1.2; margin-bottom: 2px; }
.picker-cat  { font-size: 10px; color: var(--muted); }

.selected-item-bar {
  background: var(--s2); border: 1px solid var(--sage);
  border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.btn-clear-item {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 4px 8px; border-radius: 6px;
}
.btn-clear-item:hover { color: var(--red); }

/* Оплата */
.pay-type-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-btn {
  padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--s2); color: var(--muted); font-family: 'Jost',sans-serif;
  font-size: 13px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.pay-btn:hover { border-color: var(--sage); color: var(--sage); }
.pay-btn.active { background: var(--sage); border-color: var(--sage); color: #fff; }

/* Банки */
.bank-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.bank-btn {
  padding: 10px 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--s2); color: var(--muted); font-family: 'Jost',sans-serif;
  font-size: 12px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bank-btn:hover { border-color: var(--gold); color: var(--gold); }
.bank-btn.active { background: rgba(201,160,80,.15); border-color: var(--gold); color: var(--gold2); }
.bank-logo {
  width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.bank-logo.alif { background: #2563eb; color: #fff; }
.bank-logo.dc   { background: #7c3aed; color: #fff; }
.bank-logo.esh  { background: #059669; color: #fff; }

/* Причины убытка */
.reason-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.reason-btn {
  padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--s2); color: var(--muted); font-family: 'Jost',sans-serif;
  font-size: 12px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.reason-btn:hover { border-color: var(--rose); color: var(--rose); }
.reason-btn.active { background: rgba(184,85,64,.15); border-color: var(--rose); color: var(--rose2); }

/* ── MOBILE SALES ── */
@media (max-width: 768px) {
  .tx-stats { gap: 8px; }
  .tx-stat-card { min-width: 120px; padding: 10px 12px; }
  .tx-stat-val { font-size: 17px; }
  .bank-row { grid-template-columns: 1fr; }
  .reason-row { grid-template-columns: repeat(2,1fr); }
  .item-picker-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-height: 200px; }
  .picker-img { width: 50px; height: 50px; }
  .tx-page-header { gap: 10px; }
  .tx-page-icon { width: 42px; height: 42px; font-size: 18px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:3px; }

/* ── АНИМАЦИИ ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Overlay-затемнение за сайдбаром на мобильных */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  animation: fadeIn .2s;
}
.sidebar-overlay.show { display: block; }

/* ── МОБИЛЬНЫЕ МЕДИА-ЗАПРОСЫ ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    width: 80%;
    max-width: 260px;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .menu-btn {
    display: flex;
    align-items: center; justify-content: center;
    font-size: 18px;
    background: var(--s2);
    border: 1px solid var(--border);
    color: var(--cream);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .menu-btn:hover {
    background: var(--s2);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .dash-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #view-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  /* Таблица на мобильном: убираем второстепенные колонки */
  .col-cat, .col-min { display: none; }
  thead th { padding: 8px 6px; font-size: 9px; white-space: nowrap; }
  td { padding: 8px 6px; font-size: 12px; }
  .item-name { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .item-sku  { font-size: 10px; display: none; }
  .item-thumb { width: 30px; height: 30px; font-size: 14px; flex-shrink: 0; }
  .item-name-cell { gap: 6px; }
  .qty-num { font-size: 13px; }
  .qty-unit { font-size: 10px; }
  .act-btns { gap: 3px; flex-wrap: nowrap; }
  .act-btn  { width: 28px; height: 28px; font-size: 12px; }

  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-wrap {
    min-width: 100%;
    order: 1;
  }
  .search-wrap input {
    width: 100%;
  }
  .toolbar select,
  .toolbar .view-toggle,
  .toolbar .btn {
    flex: 1 0 auto;
  }

  .cats {
    gap: 6px;
  }
  .cat-btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  .item-card-img {
    height: 100px;
    font-size: 36px;
  }
  .item-card-body {
    padding: 8px 10px;
  }
  .item-card-name {
    font-size: 12px;
  }
  .item-card-qty {
    font-size: 16px;
  }
  .item-card-actions {
    margin-top: 8px;
    justify-content: center;
  }
  .item-card-actions .act-btn {
    width: 36px;
    height: 36px;
  }

  /* Отчёты */
  .report-kpis {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .report-kpi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
  }
  .report-kpi .rk-val {
    font-size: 28px;
  }
  .period-btns {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
    flex-wrap: nowrap;
  }
  .period-btn {
    display: inline-block;
    padding: 8px 16px;
  }

  /* Скрываем таблицы, показываем карточки */
  #history-table-view {
    display: none !important;
  }
  #history-cards-view {
    display: flex !important;
  }
  #users-table-view {
    display: none !important;
  }
  #users-cards-view {
    display: block !important;
  }

  .history-table,
  .users-table {
    display: none;
  }

  .modal {
    max-width: 95vw;
    width: 95vw;
    max-height: 90vh;
    margin: 0 auto;
  }
  .modal-lg {
    max-width: 95vw;
  }
  .modal-head {
    padding: 12px 16px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-foot {
    padding: 12px 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .act-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .btn, .nav-item, .sa-btn {
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 колонки даже на маленьких экранах */
    gap: 8px;
  }
  #view-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar .btn {
    flex: 1;
    text-align: center;
  }
  .sidebar {
    width: 90%;
    max-width: 260px;
  }
  .modal {
    padding: 0;
  }
  .modal-body {
    padding: 12px;
  }
}
/* ══ SALES & LOSSES PAGES ══════════════════════════════════════════════════ */

/* Header row with KPIs + actions */
.sl-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.sl-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* KPI strip */
.sl-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-kpi {
  flex: 1;
  min-width: 100px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.sl-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.sl-kpi.green::before  { background: linear-gradient(90deg, var(--sage), var(--sage2)); }
.sl-kpi.blue::before   { background: linear-gradient(90deg, #5a90c8, #7ab0e8); }
.sl-kpi.gold::before   { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.sl-kpi.rose::before   { background: linear-gradient(90deg, var(--rose), var(--rose2)); }
.sl-kpi.sage::before   { background: linear-gradient(90deg, var(--sage), var(--sage2)); }
.sl-kpi.red::before    { background: linear-gradient(90deg, var(--red), #d47060); }
.sl-kpi-val { font-size: 22px; font-weight: 700; color: var(--cream); }
.sl-kpi-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .6px; }

/* Cards list */
.sl-list { display: flex; flex-direction: column; gap: 10px; }
.sl-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted2);
}
.sl-empty div { font-size: 15px; margin-top: 14px; color: var(--muted); }

/* Sale / Loss card */
.sl-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color .2s;
  animation: fadeInUp .25s ease-out;
}
.sl-card:hover { border-color: var(--border2); }
.loss-card { border-left: 3px solid var(--red); }

.sl-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sl-card-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--sage2);
  min-width: 120px;
}
.loss-amount { color: #e09080; }

.sl-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}
.sl-pay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.sl-pay.cash     { background: rgba(125,168,122,.15); color: var(--sage2); }
.sl-pay.transfer { background: rgba(90,144,200,.15);  color: #7ab0e8; }
.sl-date, .sl-user { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

.sl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-item-chip {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--cream2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.loss-chip   { border-color: rgba(184,85,64,.35); color: #e09080; }
.reason-chip { border-color: rgba(201,160,80,.25); color: var(--gold2); }
.sl-note { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ── DANGER BUTTON ─────────────────────────────────────────────────── */
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d06050; transform: translateY(-1px); }

/* ── PICKER GRID (товары в модалке) ────────────────────────────────── */
.sale-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 8px;
}
.picker-card {
  background: var(--s2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  position: relative;
}
.picker-card:hover  { border-color: var(--rose); }
.picker-card.in-basket { border-color: var(--sage); background: rgba(125,168,122,.1); }
.picker-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--s1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  overflow: hidden;
}
.picker-name { font-size: 11px; font-weight: 500; line-height: 1.2; }
.picker-cat  { font-size: 10px; color: var(--muted); margin-top: 2px; }
.picker-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--sage);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
}

/* ── SALE SECTIONS ──────────────────────────────────────────────────── */
.sale-section { background: var(--s2); border-radius: 12px; padding: 14px; }
.sale-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── BASKET ─────────────────────────────────────────────────────────── */
.basket-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.basket-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.basket-row:last-child { border-bottom: none; }
.basket-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.basket-controls { display: flex; align-items: center; gap: 5px; }
.basket-photo-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px dashed var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color .2s;
}
.basket-photo-btn:hover { border-color: var(--rose); }

/* ── LOSS SELECTED CARD ─────────────────────────────────────────────── */
.loss-selected-card {
  background: rgba(125,168,122,.08);
  border: 1px solid rgba(125,168,122,.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}
.loss-sel-inner { display: flex; align-items: center; gap: 10px; }

/* ══ RESPONSIVE ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sl-kpis { gap: 8px; }
  .sl-kpi  { min-width: calc(50% - 8px); flex: none; padding: 12px; }
  .sl-kpi-val { font-size: 18px; }
  .sl-card { padding: 12px 14px; }
  .sl-card-amount { font-size: 18px; min-width: auto; }
  .sl-card-top { gap: 8px; }
  .sl-actions { gap: 8px; }
  .sl-actions .btn { flex: 1; justify-content: center; }
  .sale-picker-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-height: 180px; }
  .picker-img { width: 46px; height: 46px; }
  .picker-name { font-size: 10px; }
  .basket-item-name { font-size: 12px; }
  #page-sales .period-btns,
  #page-losses .period-btns { flex-wrap: nowrap; overflow-x: auto; }
}

@media (max-width: 480px) {
  .sl-kpi { min-width: calc(50% - 6px); }
  .sale-picker-grid { grid-template-columns: repeat(3, 1fr); }
  .basket-row { gap: 6px; }
}

/* ══ SALE MODAL — TWO PANEL LAYOUT ════════════════════════════════════ */

.modal-xl { max-width: 860px !important; width: 95vw; max-height: 92vh; display: flex; flex-direction: column; }
.modal-xl .modal-head { flex-shrink: 0; }

.sale-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sale-left {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  overflow: hidden;
  min-height: 0;
}

.sale-right {
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  overflow-y: auto;
  min-height: 0;
}

.sale-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.sale-search-wrap {
  position: relative;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.sale-search-wrap input {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--cream);
  padding: 8px 12px 8px 34px;
  border-radius: 9px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.sale-search-wrap input:focus { border-color: var(--rose); }
.sale-search-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted2); pointer-events: none; font-size: 13px; }

/* Picker grid — left panel */
#sale-items-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding: 2px;
  align-content: start;
}
.picker-card {
  background: var(--s2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px 7px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  position: relative;
  user-select: none;
}
.picker-card:hover  { border-color: var(--rose); transform: translateY(-2px); }
.picker-card.in-basket { border-color: var(--sage); background: rgba(125,168,122,.1); }
.picker-img {
  width: 52px; height: 52px;
  border-radius: 8px;
  background: var(--s1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.picker-name  { font-size: 11px; font-weight: 500; line-height: 1.3; margin-bottom: 3px; }
.picker-stock { font-size: 10px; color: var(--muted); }
.picker-stock.low { color: var(--gold2); }
.picker-check {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--sage);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff;
}

/* Basket — right panel */
.basket-count-badge {
  background: var(--rose);
  color: #fff;
  border-radius: 20px;
  font-size: 11px;
  padding: 1px 7px;
  font-weight: 600;
  margin-left: 4px;
}

.sale-basket-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted2);
  font-size: 13px;
  padding: 30px 0;
}
.sale-basket-empty i { font-size: 28px; }

.sale-basket-list { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }

.basket-item-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  animation: fadeInUp .2s ease-out;
}
.basket-item-thumb {
  width: 38px; height: 38px;
  border-radius: 7px;
  background: var(--s1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.basket-item-info { flex: 1; min-width: 0; }
.basket-item-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.basket-item-cat  { font-size: 10px; color: var(--muted); }
.basket-item-max  { font-size: 10px; color: var(--muted2); flex-shrink: 0; }

.basket-qty-ctrl { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bqty-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--cream);
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.bqty-btn.minus:hover { border-color: var(--red);  color: var(--red); }
.bqty-btn.plus:hover  { border-color: var(--sage); color: var(--sage); }
.bqty-input {
  width: 40px; height: 24px;
  text-align: center;
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--cream);
  border-radius: 6px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
}
.bqty-input::-webkit-outer-spin-button,
.bqty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bqty-input:focus { border-color: var(--rose); }
.basket-remove {
  width: 22px; height: 22px;
  border-radius: 5px; border: none;
  background: transparent; color: var(--muted2);
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.basket-remove:hover { background: rgba(184,85,64,.15); color: var(--red); }

/* Summary block */
.sale-divider { height: 1px; background: var(--border); margin: 10px 0; }
.sale-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.sale-summary-lbl { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sale-summary-val { font-weight: 600; color: var(--cream); }

/* Amount input */
.sale-amount-row { display: flex; gap: 10px; align-items: stretch; }
.sale-amount-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color .2s;
}
.sale-amount-wrap:focus-within { border-color: var(--sage); }
.sale-currency { font-size: 18px; font-weight: 700; color: var(--sage2); margin-right: 8px; }
.sale-amount-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 22px;
  font-weight: 700;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
}
.sale-amount-input::placeholder { color: var(--muted2); font-weight: 400; font-size: 16px; }
.sale-amount-input::-webkit-outer-spin-button,
.sale-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Pay toggle */
.pay-toggle { display: flex; gap: 5px; flex-shrink: 0; }
.pay-toggle-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--s2);
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  min-width: 56px;
}
.pay-toggle-btn i { font-size: 16px; }
.pay-toggle-btn:hover { border-color: var(--rose); }
.pay-toggle-btn.active { border-color: var(--sage); background: rgba(125,168,122,.12); color: var(--sage2); }

/* Bank picker */
.bank-picker { display: flex; gap: 6px; }
.bank-btn {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--s2);
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  justify-content: center;
}
.bank-btn:hover  { border-color: var(--gold); }
.bank-btn.active { border-color: var(--gold); background: rgba(201,160,80,.12); color: var(--gold2); }
.bank-logo-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bank-logo-dot.alif { background: #1a7a4a; color: #fff; }
.bank-logo-dot.dc   { background: #2255bb; color: #fff; }
.bank-logo-dot.esh  { background: #c04020; color: #fff; }

/* Receipt compact */
.photo-upload-area.compact {
  padding: 10px 14px;
  border-radius: 9px;
  display: flex;
  align-items: center;
}
.photo-upload-area.compact #receipt-preview {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
}

/* Submit btn */
.sale-submit-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
  border-radius: 12px;
  letter-spacing: .3px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--rose);
  box-shadow: 0 -8px 20px rgba(208,184,173,.8);
}

/* ── RESPONSIVE SALE MODAL ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .modal-xl { max-width: 99vw !important; width: 99vw; max-height: 96vh; }
  .sale-modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .sale-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 260px;
    overflow: hidden;
    padding: 12px;
    min-height: 0;
  }
  .sale-right { padding: 12px; overflow-y: visible; }
  #sale-items-picker { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
  .picker-img { width: 44px; height: 44px; }
  .sale-amount-row { flex-direction: column; }
  .pay-toggle { justify-content: stretch; }
  .pay-toggle-btn { flex: 1; }
  .bank-btn span { display: none; }
  .sale-submit-btn { position: static; }
}

/* ══ WEEKLY REPORT ════════════════════════════════════════════════════ */

.week-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.week-nav-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--cream);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.week-nav-btn:hover:not(:disabled) { border-color: var(--rose); color: var(--rose); }
.week-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.week-label-wrap { flex: 1; text-align: center; }
.week-label { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 600; }
.week-dates { font-size: 12px; color: var(--muted); margin-top: 2px; }
.week-today-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--rose);
  background: transparent;
  color: var(--rose);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.week-today-btn:hover { background: var(--rose); color: #fff; }

.week-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.week-kpi {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.week-kpi:hover { transform: translateY(-2px); }
.week-kpi::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.week-kpi.green::before { background: linear-gradient(90deg, var(--sage), var(--sage2)); }
.week-kpi.rose::before  { background: linear-gradient(90deg, var(--rose), var(--rose2)); }
.week-kpi.red::before   { background: linear-gradient(90deg, var(--red), #d47060); }
.week-kpi.gold::before  { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.wk-icon { font-size: 20px; margin-bottom: 8px; color: var(--muted2); }
.wk-val  { font-size: 28px; font-weight: 700; color: var(--cream); line-height: 1; }
.wk-lbl  { font-size: 11px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .6px; }
.wk-sub  { font-size: 11px; color: var(--muted2); margin-top: 4px; }

.wk-count-badge {
  background: rgba(125,168,122,.15);
  color: var(--sage2);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.wk-count-badge.red {
  background: rgba(184,85,64,.15);
  color: #e09080;
}

/* Details/Summary for history */
.report-details {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.report-details-summary {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;          /* не переполняется на мобильном */
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--cream2);
  list-style: none;
  user-select: none;
  transition: background .15s;
}
.report-details-summary::-webkit-details-marker { display: none; }
.report-details-summary:hover { background: var(--s2); }
.report-details[open] .report-details-summary { border-bottom: 1px solid var(--border); }
.report-details-body { padding: 18px 20px; }

/* Responsive weekly report */
@media (max-width: 768px) {
  .week-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .wk-val { font-size: 22px; }
  .week-selector { padding: 10px 14px; gap: 8px; }
  .week-label { font-size: 15px; }
}
@media (max-width: 480px) {
  .week-kpi-grid { grid-template-columns: 1fr 1fr; }
  .wk-val { font-size: 20px; }
}

/* ══ DASHBOARD WEEKLY STRIP ══════════════════════════════════════════ */
.dash-week-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}
.dash-week-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--rose), var(--gold));
}
.dws-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dws-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 16px;
  flex-shrink: 0;
}
.dws-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dws-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.dws-item.green .dws-icon { background: rgba(125,168,122,.15); color: var(--sage2); }
.dws-item.blue  .dws-icon { background: rgba(90,144,200,.12);  color: #7ab0e8; }
.dws-item.red   .dws-icon { background: rgba(184,85,64,.12);   color: #e09080; }
.dws-item.gold  .dws-icon { background: rgba(201,160,80,.12);  color: var(--gold2); }
.dws-val  { font-size: 16px; font-weight: 700; color: var(--cream); line-height: 1.1; }
.dws-lbl  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dws-link {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  text-decoration: none;
}
.dws-link:hover { border-color: var(--rose); color: var(--rose); }

@media (max-width: 768px) {
  .dash-week-strip {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .dws-label { width: 100%; margin-right: 0; margin-bottom: 2px; }
  .dws-divider { display: none; }
  .dws-item { flex: 1; min-width: calc(50% - 10px); }
  .dws-link { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .dws-item { min-width: calc(50% - 8px); }
  .dws-val  { font-size: 15px; }
}
/* ══ KPI CLICKABLE PANELS ════════════════════════════════════════════ */
.kpi-clickable {
  cursor: pointer;
  user-select: none;
}
.kpi-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.kpi-clickable:active { transform: translateY(-1px); }
.kpi-click-hint {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 6px;
  letter-spacing: .5px;
  opacity: 0;
  transition: opacity .2s;
}
.kpi-clickable:hover .kpi-click-hint { opacity: 1; }

/* ══ WEEK DETAIL MODAL ═══════════════════════════════════════════════ */
.wkd-modal { max-width: 620px; }

.wkd-head { gap: 0; }
.wkd-head.sales { border-bottom: 2px solid var(--rose) !important; }
.wkd-head.losses { border-bottom: 2px solid var(--red) !important; }
.wkd-head .modal-title i { margin-right: 8px; }
.wkd-head.sales .modal-title i { color: var(--rose); }
.wkd-head.losses .modal-title i { color: var(--red); }
.wkd-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.wkd-body { padding: 0; }

/* Stats row */
.wkd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.wkd-stat {
  padding: 18px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
}
.wkd-stat:last-child { border-right: none; }
.wkd-stat-icon {
  font-size: 18px;
  margin-bottom: 6px;
}
.wkd-stat-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
}
.wkd-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-top: 4px;
}
.wkd-rose .wkd-stat-icon { color: var(--rose); }
.wkd-green .wkd-stat-icon { color: var(--sage); }
.wkd-gold .wkd-stat-icon  { color: var(--gold); }
.wkd-red .wkd-stat-icon   { color: #e09080; }
.wkd-rose .wkd-stat-val { color: var(--rose2); }
.wkd-green .wkd-stat-val { color: var(--sage2); }
.wkd-gold .wkd-stat-val  { color: var(--gold2); }
.wkd-red .wkd-stat-val   { color: #e09080; }

/* Payment pills */
.wkd-pay-row {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wkd-pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.wkd-pay-pill.cash     { background: rgba(125,168,122,.12); color: var(--sage2); border: 1px solid rgba(125,168,122,.25); }
.wkd-pay-pill.transfer { background: rgba(90,144,200,.12); color: #7ab0e8; border: 1px solid rgba(90,144,200,.25); }

/* Sections */
.wkd-section { padding: 0 18px 18px; }
.wkd-section:first-of-type { padding-top: 16px; }
.wkd-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--sage);
  margin-bottom: 12px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.wkd-section-title.loss-title { color: #e09080; }

/* Flower breakdown */
.wkd-flower-list { display: flex; flex-direction: column; gap: 8px; }
.wkd-flower-row {
  display: grid;
  grid-template-columns: 160px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.wkd-flower-name {
  font-size: 13px;
  color: var(--cream2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkd-flower-bar-wrap {
  height: 6px;
  background: var(--s3);
  border-radius: 4px;
  overflow: hidden;
}
.wkd-flower-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--sage), var(--sage2));
  transition: width .4s ease;
}
.wkd-flower-bar.loss {
  background: linear-gradient(90deg, var(--red), #e07060);
}
.wkd-flower-qty {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage2);
  text-align: right;
  white-space: nowrap;
}
.wkd-flower-qty.loss { color: #e09080; }

/* Transactions list */
.wkd-tx-list { display: flex; flex-direction: column; gap: 8px; }
.wkd-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}

@media (max-width: 600px) {
  .wkd-modal { max-width: 100%; }
  .wkd-stats { grid-template-columns: repeat(3, 1fr); }
  .wkd-stat-val { font-size: 17px; }
  .wkd-flower-row { grid-template-columns: 110px 1fr 44px; }
  .wkd-section { padding: 0 12px 14px; }
}

/* ══ WKD: REVENUE ANALYTICS ════════════════════════════════════════ */
.wkd-head.revenue { border-bottom: 2px solid var(--sage) !important; }
.wkd-head.revenue .modal-title i { color: var(--sage); }
.wkd-head.stock   { border-bottom: 2px solid var(--gold) !important; }
.wkd-head.stock   .modal-title i { color: var(--gold); }

.wkd-price-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.wkd-price-header {
  display: grid;
  grid-template-columns: 1fr 60px 72px 120px 80px 90px;
  gap: 8px;
  padding: 8px 14px;
  background: var(--s2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 600;
}
.wkd-price-row {
  display: grid;
  grid-template-columns: 1fr 60px 72px 120px 80px 90px;
  gap: 8px;
  padding: 10px 14px;
  align-items: center;
  border-top: 1px solid var(--border);
  transition: background .15s;
}
.wkd-price-row:hover { background: var(--s2); }
.wkd-pr-name {
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkd-pr-num {
  font-size: 12px;
  color: var(--cream2);
  text-align: right;
}
.wkd-pr-num.muted { color: var(--muted); }
.wkd-pr-num.bold  { font-weight: 600; color: var(--cream); }
.wkd-pr-price-wrap { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.wkd-pr-bar-wrap {
  width: 100%;
  height: 3px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
}
.wkd-pr-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .4s;
}
.wkd-pr-bar.bar-ok  { background: var(--sage); }
.wkd-pr-bar.bar-low { background: var(--red); }
.wkd-pr-delta {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}
.wkd-pr-delta.rev-pos { color: var(--sage2); }
.wkd-pr-delta.rev-neg { color: #e09080; }
.delta-pct { font-size: 10px; opacity: .75; margin-left: 3px; }

/* ══ WKD: STOCK OUT ════════════════════════════════════════════════ */
.wkd-section-title.stock-title { color: var(--gold2); }

.wkd-stock-list { display: flex; flex-direction: column; gap: 12px; }
.wkd-stock-row { display: flex; flex-direction: column; gap: 5px; }
.wkd-stock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wkd-stock-name {
  font-size: 13px;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wkd-emoji { font-size: 15px; }
.wkd-stock-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold2);
}
.wkd-stock-bar-wrap {
  height: 5px;
  background: var(--s3);
  border-radius: 3px;
  overflow: hidden;
}
.wkd-stock-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  transition: width .4s;
}
.wkd-stock-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.stock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.stock-tag.sale-tag  { background: rgba(125,168,122,.15); color: var(--sage2); }
.stock-tag.loss-tag  { background: rgba(184,85,64,.15);   color: #e09080; }
.stock-tag.tl-sale   { background: rgba(125,168,122,.15); color: var(--sage2); }
.stock-tag.tl-loss   { background: rgba(184,85,64,.15);   color: #e09080; }
.stock-tag.other-tag { background: rgba(201,160,80,.15);  color: var(--gold2); }
.stock-tag.tl-other  { background: rgba(201,160,80,.15);  color: var(--gold2); }

/* Timeline */
.wkd-timeline { display: flex; flex-direction: column; gap: 0; }
.wkd-tl-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.wkd-tl-row:last-child { border-bottom: none; }
.wkd-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.wkd-tl-dot.tl-sale  { background: var(--sage); }
.wkd-tl-dot.tl-loss  { background: var(--red); }
.wkd-tl-dot.tl-other { background: var(--gold); }
.wkd-tl-body { flex: 1; min-width: 0; }
.wkd-tl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.wkd-tl-name {
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkd-tl-qty {
  font-size: 13px;
  font-weight: 700;
  color: #e09080;
  flex-shrink: 0;
  margin-left: 8px;
}
.wkd-tl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wkd-tl-user, .wkd-tl-time {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 600px) {
  .wkd-price-header { display: none; }
  .wkd-price-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }
  .wkd-pr-name { grid-column: 1; }
  .wkd-pr-num.bold { grid-column: 2; }
  .wkd-pr-num, .wkd-pr-price-wrap { display: none; }
  .wkd-pr-delta { grid-column: 1 / -1; text-align: left; }
}

/* ══ ИТОГ НЕДЕЛИ ════════════════════════════════════════════════════ */
.week-summary {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}
.week-summary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--rose));
}

/* Header */
.wks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.wks-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wks-title i { color: var(--gold); font-size: 16px; }
.wks-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: .4px;
}
.wks-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}
.wks-badge.pos {
  background: rgba(125,168,122,.12);
  color: var(--sage2);
  border: 1px solid rgba(125,168,122,.25);
}
.wks-badge.neg {
  background: rgba(184,85,64,.12);
  color: #e09080;
  border: 1px solid rgba(184,85,64,.25);
}

/* Body: two columns */
.wks-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Finance column */
.wks-finance {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wks-finance-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wks-fin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
}
.wks-fin-row.revenue { border-bottom: 1px dashed var(--border); }
.wks-fin-row.losses  { border-bottom: 1px dashed var(--border); }
.wks-fin-label {
  font-size: 13px;
  color: var(--cream2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.wks-fin-row.revenue .wks-fin-label i { color: var(--sage); }
.wks-fin-row.losses  .wks-fin-label i { color: #e09080; }
.wks-fin-val {
  font-size: 16px;
  font-weight: 700;
}
.wks-fin-val.green { color: var(--sage2); }
.wks-fin-val.red   { color: #e09080; }

/* Net result row */
.wks-divider {
  height: 1px;
  background: var(--border2);
  margin: 4px 0 8px;
}
.wks-fin-row.net {
  background: var(--s2);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 -4px;
}
.wks-fin-label.net-lbl {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}
.wks-fin-val.net-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
}

/* Mini stats */
.wks-mini-stats {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.wks-mini {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.wks-mini i { font-size: 10px; }

/* Stock column */
.wks-stock {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wks-stock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.wks-stock-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.wks-stot {
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
}
.wks-stot-val {
  font-size: 11px;
  color: var(--gold2);
}
.wks-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wks-item-row {
  display: grid;
  grid-template-columns: 22px 1fr 48px 60px 72px;
  align-items: center;
  gap: 6px;
}
.wks-item-emoji { font-size: 14px; text-align: center; }
.wks-item-name {
  font-size: 12px;
  color: var(--cream2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wks-item-qty {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.wks-item-bar-wrap {
  height: 4px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
}
.wks-item-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  transition: width .5s ease;
}
.wks-item-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold2);
  text-align: right;
  white-space: nowrap;
}
.wks-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}
.wks-more {
  font-size: 11px;
  color: var(--muted2);
  text-align: center;
  margin-top: 8px;
  letter-spacing: .3px;
}

/* Responsive */
@media (max-width: 700px) {
  .wks-body { grid-template-columns: 1fr; }
  .wks-finance { border-right: none; border-bottom: 1px solid var(--border); }
  .wks-header { padding: 14px 16px 12px; }
  .wks-finance, .wks-stock { padding: 16px; }
  .wks-item-row { grid-template-columns: 22px 1fr 44px 50px; }
  .wks-item-bar-wrap { display: none; }
}

/* ══ ИТОГ НЕДЕЛИ — обновлённые стили ═══════════════════════════════ */
.wks-fin-row.catalog .wks-fin-label i { color: var(--gold); }
.wks-fin-val.muted { color: var(--muted); font-size: 15px; }

.wks-badge.neutral {
  background: rgba(122,109,98,.12);
  color: var(--muted);
  border: 1px solid rgba(122,109,98,.25);
}

/* Per-flower price table */
.wks-price-header {
  display: grid;
  grid-template-columns: 1fr 36px 68px 16px 68px 52px;
  gap: 4px;
  padding: 6px 0 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted2);
  font-weight: 600;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.wks-price-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}
.wks-price-row {
  display: grid;
  grid-template-columns: 1fr 36px 68px 16px 68px 52px;
  gap: 4px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.wks-price-row:last-child { border-bottom: none; }
.wks-pr-name {
  font-size: 12px;
  color: var(--cream2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wks-pr-qty  { font-size: 11px; text-align: right; white-space: nowrap; }
.wks-pr-cat  { font-size: 11px; text-align: right; white-space: nowrap; }
.wks-pr-sold { font-size: 12px; font-weight: 600; color: var(--cream); text-align: right; white-space: nowrap; }
.wks-pr-arrow { font-size: 9px; color: var(--muted2); text-align: center; }
.wks-pr-diff {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.wks-pr-diff.green { color: var(--sage2); }
.wks-pr-diff.red   { color: #e09080; }
.wks-pr-diff.muted { color: var(--muted); }

@media (max-width: 700px) {
  .wks-price-header { display: none; }
  .wks-price-row {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "name sold diff";
  }
  .wks-pr-qty, .wks-pr-cat, .wks-pr-arrow { display: none; }
  .wks-pr-name { grid-area: name; }
  .wks-pr-sold { grid-area: sold; }
  .wks-pr-diff { grid-area: diff; }
}

/* ══ МОБИЛЬНЫЕ УЛУЧШЕНИЯ UX ══════════════════════════════════════════════ */

/* --- Предотвращение авто-зума на iOS при фокусе (font-size >= 16px) --- */
@media (max-width: 768px) {
  .field input,
  .field select,
  .field textarea,
  .search-wrap input,
  .item-picker-search input,
  .sale-search-wrap input {
    font-size: 16px; /* iOS не зумит если >= 16px */
  }

  /* --- Минимальный размер tap-таргетов 44px (Apple HIG / Google Material) --- */
  .field input,
  .field select {
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  .btn {
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  .nav-item {
    min-height: 48px;
    padding: 13px 14px;
  }
  .cat-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 38px;
  }
  .period-btn {
    min-height: 36px;
    padding: 7px 16px;
  }
  .week-nav-btn {
    width: 44px;
    height: 44px;
  }

  /* --- Страница: уменьшаем горизонтальные отступы --- */
  .page {
    padding: 16px;
  }

  /* --- Топбар: увеличиваем высоту для удобства --- */
  .topbar {
    height: 60px;
    padding: 0 16px;
  }
  .menu-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  /* --- Таблицы: горизонтальный скролл вместо переполнения --- */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* --- Увеличиваем шрифты там где 10–11px --- */
  .kpi-lbl,
  .rk-lbl,
  .wk-lbl,
  .sl-kpi-lbl {
    font-size: 12px;
  }
  .feed-item  { font-size: 13px; }
  .feed-time  { font-size: 11px; }
  .top-name   { font-size: 14px; }

  /* --- Тосты: растягиваем на всю ширину --- */
  .toast-wrap {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: unset;
    width: 100%;
    font-size: 14px;
  }

  /* --- Кнопки действий в таблицах и карточках --- */
  .act-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .qty-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  /* --- Модалки: увеличиваем поля ввода --- */
  .modal-body .field textarea {
    min-height: 80px;
    font-size: 15px;
  }

  /* --- Отчёты: history summary на мобильном --- */
  .report-details-summary {
    padding: 14px 16px;
    font-size: 15px;
  }
  .report-details-summary .period-btns {
    margin-left: 0;          /* убираем auto-margin, кнопки переходят на новую строку */
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .report-details-body {
    padding: 14px 16px;
  }
  /* Бар-чарт выше на мобильном */
  .bar-chart {
    height: 100px;
  }
  /* Недельный селектор */
  .week-today-btn {
    font-size: 13px;
    padding: 7px 12px;
  }
  /* KPI карточки отчёта */
  .wk-sub {
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px;
  }
  .topbar {
    height: 56px;
    padding: 0 12px;
  }
  .topbar-title {
    font-size: 16px;
  }
  /* Карточки товаров: 2 в ряд */
  #view-grid {
    gap: 8px;
  }
  .item-card-img {
    height: 100px;
    font-size: 34px;
  }
  .item-card-body {
    padding: 8px 10px;
  }
  .item-card-qty {
    font-size: 15px;
  }
  .item-card-actions {
    gap: 6px;
    margin-top: 6px;
  }
  .item-card-actions .act-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  /* Sale modal на маленьких экранах */
  .sale-left {
    max-height: 240px;
  }
  /* Кнопки picker меньше */
  #sale-items-picker {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
  }
  .picker-img {
    width: 40px;
    height: 40px;
  }
  .picker-name {
    font-size: 10px;
  }
}

/* ══ Очень маленькие экраны (≤360px) ══════════════════════════════════════ */
@media (max-width: 360px) {
  #view-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .item-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }
  .item-card-img {
    width: 80px;
    min-width: 80px;
    height: auto;
    border-radius: 0;
    font-size: 28px;
  }
  .item-card-body {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
  }
  .item-card-actions {
    justify-content: flex-start;
  }
}

/* ══ ПОЛЬЗОВАТЕЛИ: адаптация под маленькие устройства ══════════════════════ */

@media (max-width: 768px) {
  /* Кнопка «Добавить» — на всю ширину */
  #page-users .toolbar {
    padding-bottom: 4px;
  }
  #page-users .toolbar .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    font-size: 15px;
  }

  /* Карточки пользователей — компактнее на маленьком экране */
  .user-card { padding: 10px 12px; }
  .user-avatar-card { width: 36px; height: 36px; font-size: 13px; }
  .user-login-card { font-size: 13px; }
  .uc-dates { font-size: 10px; gap: 6px; }
  .uc-actions .act-btn { width: 30px; height: 30px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   СОТРУДНИКИ — УЧЁТ ВРЕМЕНИ
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Шапка страницы: код смены + KPI ── */
.emp-top-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.shift-code-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  gap: 6px;
}
.shift-code-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
}
.shift-code-value {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 10px;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 4px 0;
}
.shift-code-meta {
  font-size: 11px;
  color: var(--muted2);
}
.shift-code-regen {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  font-size: 12px;
}

.emp-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-content: center;
}
.emp-kpi {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.emp-kpi:hover { transform: translateY(-2px); }
.emp-kpi::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.emp-kpi.sage::before { background: linear-gradient(90deg, var(--sage), var(--sage2)); }
.emp-kpi.gold::before { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.emp-kpi.rose::before { background: linear-gradient(90deg, var(--rose), var(--rose2)); }
.emp-kpi-ico  { font-size: 22px; margin-bottom: 8px; color: var(--muted2); }
.emp-kpi-val  { font-size: 28px; font-weight: 700; color: var(--cream); line-height: 1; }
.emp-kpi-lbl  { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .6px; }

/* ── Вкладки ── */
.emp-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.emp-tab {
  padding: 9px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-tab:hover { color: var(--cream); }
.emp-tab.active { color: var(--rose); border-bottom-color: var(--rose); }

.emp-panel { animation: fadeUp .25s ease-out; }

/* ── Пустое состояние ── */
.empty-row { text-align: center; color: var(--muted2); padding: 32px 14px; font-size: 13px; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted2);
  gap: 12px;
  font-size: 13px;
}
.empty-state i { font-size: 36px; opacity: .4; }

/* ── Сетка "Сегодня" ── */
.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.today-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  transition: all .2s;
}
.today-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.today-card.present { border-left: 3px solid var(--sage); }
.today-card.absent  { border-left: 3px solid var(--border); opacity: .7; }
.today-card.done    { border-left: 3px solid var(--rose2); }

.today-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.today-emp-name { font-weight: 600; font-size: 14px; color: var(--cream); }
.today-shift-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.today-shift-badge.s1 { background: rgba(42,110,74,.15); color: var(--sage2); }
.today-shift-badge.s2 { background: rgba(122,58,40,.15); color: var(--rose2); }

.today-times {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}
.today-time-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.today-time-row i { width: 14px; text-align: center; }
.today-time-val { color: var(--cream2); font-weight: 500; }
.today-time-val.sage { color: var(--sage2); }
.today-time-val.rose { color: var(--rose2); }

.today-extra {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--gold2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.today-admin-btns {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}
.today-admin-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
}
.today-admin-btn.in:hover  { border-color: var(--sage);  color: var(--sage);  background: rgba(42,110,74,.08); }
.today-admin-btn.out:hover { border-color: var(--rose2); color: var(--rose2); background: rgba(122,58,40,.08); }
.today-admin-btn:disabled  { opacity: .35; cursor: not-allowed; }

/* ── Зарплатная ведомость ── */
.week-header {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.week-header i { color: var(--rose); }

/* ══════════════════════════════════════════════════════════════════
   EMPLOYEE SHIFT STATS (ess-*)
══════════════════════════════════════════════════════════════════ */

.ess-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600;
  color: var(--muted2); text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 12px;
}
.ess-section-title i { color: var(--rose); }
.ess-period-btns { display: flex; gap: 5px; margin-left: auto; }
.ess-period-btns .btn { padding: 3px 9px; font-size: 11px; }
.ess-period-active { background: var(--rose) !important; border-color: var(--rose) !important; color: #fff !important; }

/* Блок смены */
.ess-shift-block {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}
.ess-shift-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px;
  background: var(--s2);
  border-bottom: 1px solid var(--border);
}
.ess-shift-title { font-weight: 700; font-size: 14px; color: var(--cream); }
.ess-status {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; letter-spacing: .3px;
}
.ess-status.pending { background: rgba(180,180,180,.15); color: var(--muted2); }
.ess-status.active  { background: rgba(42,110,74,.15);   color: var(--sage2); }
.ess-status.done    { background: rgba(122,58,40,.12);   color: var(--rose2); }

/* Список сотрудников */
.ess-emp-list { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ess-empty { padding: 12px 8px; color: var(--muted); font-size: 13px; text-align: center; }

/* Карточка сотрудника */
.ess-emp-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.ess-emp-card:hover { border-color: var(--border); }
.ess-emp-card.ess-absent  { opacity: .55; }
.ess-emp-card.ess-present { border-color: rgba(42,110,74,.25); }
.ess-emp-card.ess-done    { border-color: var(--border); }

.ess-emp-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  background: var(--s3); color: var(--cream2);
}
.ess-emp-card.ess-present .ess-emp-avatar { background: rgba(42,110,74,.15); color: var(--sage2); }
.ess-emp-card.ess-done    .ess-emp-avatar { background: rgba(122,58,40,.1);  color: var(--rose2); }

.ess-emp-info { flex: 1; min-width: 0; }
.ess-emp-name-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.ess-emp-name { font-weight: 600; font-size: 14px; color: var(--cream); }
.ess-emp-time-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ess-time-in  { color: var(--sage2); font-weight: 500; }
.ess-time-sep { color: var(--muted2); }
.ess-time-out { color: var(--muted2); }
.ess-on-shift { color: var(--sage2); font-size: 11px; }

/* Бейджи опоздание/вовремя */
.ess-late-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  background: rgba(192,32,16,.12); color: var(--red);
  display: inline-flex; align-items: center; gap: 4px;
}
.ess-early-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  background: rgba(42,110,74,.12); color: var(--sage2);
  display: inline-flex; align-items: center; gap: 4px;
}
.ess-ontime-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  background: rgba(42,110,74,.12); color: var(--sage2);
  display: inline-flex; align-items: center; gap: 4px;
}

.ess-bonus-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  background: rgba(138,92,26,.13); color: var(--gold2);
  display: inline-flex; align-items: center; gap: 4px;
}
.ess-emp-bonus-row { margin-top: 4px; }

.ess-emp-pay-col { text-align: right; flex-shrink: 0; }
.ess-pay-val { font-size: 14px; font-weight: 700; color: var(--sage2); }
.ess-pay-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ess-pay-absent { font-size: 14px; color: var(--muted); }

/* Footer смены */
.ess-shift-footer {
  display: flex; justify-content: space-between;
  padding: 8px 18px;
  font-size: 12px; color: var(--muted2);
  background: var(--s2);
  border-top: 1px solid var(--border);
}
.ess-shift-footer .green { color: var(--sage2); }

/* Итого за день */
.ess-day-total {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  background: rgba(42,110,74,.08);
  border: 1px solid rgba(42,110,74,.2);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px; color: var(--muted2);
  margin-bottom: 4px;
}
.ess-day-total i { color: var(--sage2); margin-right: 5px; }

/* История */
.ess-summary-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  margin-bottom: 12px; padding: 0 2px;
}
.ess-hist-list { display: flex; flex-direction: column; gap: 8px; }
.ess-hist-card {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
  transition: border-color .2s;
}
.ess-hist-card:hover { border-color: var(--border2); }
.ess-inactive { opacity: .5; }

.ess-hist-left {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ess-hist-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--s2); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--cream);
}
.ess-hist-name-col { display: flex; flex-direction: column; gap: 3px; }
.ess-hist-name { font-weight: 600; font-size: 14px; color: var(--cream); }

.ess-hist-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin-bottom: 10px;
}
.ess-metric {
  text-align: center;
  background: var(--s2);
  border-radius: 8px;
  padding: 6px 4px;
}
.ess-metric-val { font-size: 16px; font-weight: 700; color: var(--cream); line-height: 1.2; }
.ess-metric.sage .ess-metric-val { color: var(--sage2); }
.ess-metric.warn .ess-metric-val { color: var(--gold2); }
.ess-metric-lbl { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .3px; }

.ess-hist-bar-col { display: flex; align-items: center; gap: 8px; }
.ess-bar-bg   { flex: 1; height: 6px; background: var(--s2); border-radius: 4px; overflow: hidden; }
.ess-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.ess-bar-pct  { font-size: 11px; color: var(--muted2); min-width: 32px; text-align: right; }

@media (max-width: 520px) {
  .ess-hist-metrics { grid-template-columns: repeat(2, 1fr); }
  .ess-emp-time-row { font-size: 11px; }
}

.week-emp-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.week-emp-card:hover { border-color: var(--border2); }

.week-emp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.week-emp-left { display: flex; align-items: center; gap: 12px; }
.week-emp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}
.week-emp-name  { font-weight: 600; font-size: 14px; }
.week-emp-shift { font-size: 11px; color: var(--muted); margin-top: 1px; }

.week-emp-salary {
  text-align: right;
}
.week-emp-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
}
.week-emp-breakdown {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.week-emp-body {
  display: none;
  border-top: 1px solid var(--border);
  padding: 14px 18px;
}
.week-emp-body.open { display: block; }

.week-emp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.wes-item { text-align: center; }
.wes-val  { font-size: 18px; font-weight: 600; color: var(--cream); }
.wes-lbl  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

.week-days-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.week-days-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted2);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.week-days-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.week-days-table tr:last-child td { border-bottom: none; }
.wdt-extra { color: var(--gold2); font-weight: 500; }
.wdt-absent { color: var(--muted2); font-style: italic; }

/* ── Подсказка ставки ── */
.emp-rate-hint {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.emp-rate-hint i { color: var(--rose2); }

/* ── Карточки списка сотрудников ── */
.emp-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emp-row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.emp-row-card:hover { border-color: var(--border2); }
.emp-row-inactive { opacity: .55; }

.emp-row-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}

.emp-row-info {
  flex: 1;
  min-width: 0;
}
.emp-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.emp-row-tg {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-row-tg i { color: #2AABEE; margin-right: 3px; }

.emp-row-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.emp-act-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background .15s, border-color .15s, color .15s;
}
.emp-act-btn:hover       { background: var(--s3); color: var(--cream); border-color: var(--border2); }
.emp-act-btn.warn        { color: var(--gold2); border-color: var(--gold2); }
.emp-act-btn.warn:hover  { background: rgba(180,140,60,.1); }
.emp-act-btn.ok          { color: var(--sage); border-color: var(--sage); }
.emp-act-btn.ok:hover    { background: rgba(42,110,74,.1); }
.emp-act-btn.danger      { color: var(--rose2); border-color: var(--rose2); }
.emp-act-btn.danger:hover { background: rgba(122,58,40,.1); }

/* ── Мобильный стрип дней недели ── */
.week-day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.wds-day {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  font-size: 10px;
  min-width: 0;
}
.wds-day.wds-present { border-color: var(--sage); background: rgba(42,110,74,.08); }
.wds-day.wds-absent  { opacity: .45; }
.wds-name  { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.wds-date  { font-size: 9px; color: var(--muted2); margin-bottom: 3px; }
.wds-dot   { font-size: 14px; line-height: 1; }
.wds-time  { font-size: 9px; color: var(--sage2); margin-top: 2px; line-height: 1.3; }
.wds-extra { font-size: 8px; color: var(--gold2); margin-top: 1px; }

/* ── Мобильная адаптация Сотрудники ── */
@media (max-width: 768px) {
  .emp-top-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Код смены — горизонтальная компактная карточка */
  .shift-code-card {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
  }
  .shift-code-label {
    font-size: 10px;
    white-space: nowrap;
  }
  .shift-code-value {
    font-size: 32px;
    letter-spacing: 6px;
    flex: 1;
    text-align: center;
  }
  .shift-code-meta { display: none; }
  .shift-code-regen {
    position: static;
    padding: 6px 10px;
  }

  /* KPI — 3 колонки с меньшим паддингом */
  .emp-kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .emp-kpi { padding: 10px 8px; }
  .emp-kpi-ico { font-size: 16px; margin-bottom: 4px; }
  .emp-kpi-val { font-size: 18px; }
  .emp-kpi-lbl { font-size: 9px; letter-spacing: 0; }

  /* Вкладки */
  .emp-tabs { gap: 0; border-bottom-width: 1px; }
  .emp-tab {
    flex: 1;
    padding: 8px 6px;
    font-size: 11px;
    justify-content: center;
    gap: 4px;
  }
  .emp-tab i { font-size: 13px; }

  /* Таблица сотрудников — скрываем лишние колонки */
  .today-grid { grid-template-columns: 1fr; }
  .today-card { padding: 12px 14px; }

  /* Зарплата */
  .week-emp-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .week-emp-head { padding: 12px 14px; }
  .week-emp-body { padding: 12px 14px; }
  .week-days-table { font-size: 11px; }
  .week-days-table th, .week-days-table td { padding: 6px 7px; }
  /* Скрываем колонку "оплата" — видно в заголовке */
  .week-days-table th:last-child,
  .week-days-table td:last-child { display: none; }
}

@media (max-width: 480px) {
  .emp-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Код смены ещё компактнее */
  .shift-code-value { font-size: 28px; letter-spacing: 5px; }

  /* Карточки сотрудников на совсем маленьком экране */
  .emp-row-card { padding: 10px 12px; gap: 8px; }
  .emp-row-avatar { width: 34px; height: 34px; font-size: 14px; }
  .emp-row-name { font-size: 13px; }
  .emp-act-btn { width: 30px; height: 30px; font-size: 12px; }

  .week-emp-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .week-emp-salary { text-align: left; padding-left: 0; }
  .week-emp-total { font-size: 17px; }

  .today-admin-btns { flex-direction: column; gap: 5px; }
  .today-admin-btn { text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   МОЯ СМЕНА
   ═══════════════════════════════════════════════════════════════════════════ */

.myshift-wrap {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Статус-строка вверху */
.myshift-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.myshift-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
  transition: background .3s;
}
.myshift-status-dot.present { background: var(--sage2); box-shadow: 0 0 0 3px rgba(58,144,96,.2); animation: pulse-dot 2s infinite; }
.myshift-status-dot.done    { background: var(--rose2); }
.myshift-status-dot.absent  { background: var(--muted2); }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 3px rgba(58,144,96,.2)} 50%{box-shadow:0 0 0 6px rgba(58,144,96,.06)} }
.myshift-status-text { font-size: 13px; color: var(--cream2); font-weight: 500; }

/* Главная карточка — код */
.myshift-code-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.myshift-code-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--rose), var(--gold2), var(--sage2));
}
.myshift-code-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.myshift-code-digits {
  display: flex;
  gap: 10px;
}
.myshift-code-digits span {
  width: 60px; height: 72px;
  background: var(--s2);
  border: 2px solid var(--border2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  letter-spacing: 0;
  transition: all .3s;
}
.myshift-code-digits span.loaded {
  border-color: var(--rose);
  background: rgba(122,58,40,.06);
  box-shadow: 0 4px 16px rgba(122,58,40,.12);
}
.myshift-copy-btn {
  padding: 10px 24px;
  background: var(--rose);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.myshift-copy-btn:hover  { background: var(--rose2); transform: translateY(-1px); }
.myshift-copy-btn.copied { background: var(--sage); }
.myshift-code-validity {
  font-size: 11px;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: center;
}

/* Инструкция */
.myshift-how {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.myshift-how-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.myshift-how-title i { color: var(--rose2); }
.myshift-steps { display: flex; flex-direction: column; gap: 10px; }
.myshift-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.myshift-step-n {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.myshift-step-text { font-size: 13px; color: var(--cream2); line-height: 1.5; }

/* Карточка сегодняшнего статуса */
.myshift-today-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}

/* ── Статистика смен (sst-*) ──────────────────────────────────────────────── */
.ms-shift-stats { display: flex; flex-direction: column; gap: 14px; }

/* Hero — итог дня */
.sst-hero {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose2) 100%);
  border-radius: 20px;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.sst-hero::before {
  content: '🌸';
  position: absolute;
  font-size: 90px;
  opacity: .08;
  right: -10px;
  top: -10px;
  transform: rotate(-20deg);
  pointer-events: none;
}
.sst-hero-date {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
}
.sst-hero-revenue {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.sst-hero-currency { font-size: 28px; opacity: .8; }
.sst-hero-sub {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
  margin-bottom: 14px;
}
.sst-hero-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sst-chip {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sst-chip.loss { background: rgba(200,60,40,.35); border-color: rgba(255,100,80,.3); }

/* Оплата (cash vs transfer) */
.sst-pay-block {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}
.sst-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.sst-pay-lbl { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sst-pay-lbl i { font-size: 12px; }
.sst-pay-val { font-weight: 600; }
.sst-pay-val.cash     { color: var(--sage2); }
.sst-pay-val.transfer { color: var(--gold2); }
.sst-pay-bar-wrap {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
  background: var(--border);
}
.sst-pay-bar-cash     { background: var(--sage2); transition: width .5s ease; }
.sst-pay-bar-transfer { background: var(--gold2); transition: width .5s ease; }

/* Карточка смены */
.sst-shift-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.sst-shift-card.active {
  border-color: var(--sage2);
  box-shadow: 0 0 0 1px rgba(58,144,96,.2), 0 4px 16px rgba(42,110,74,.1);
}
.sst-shift-card.done { opacity: .85; }
.sst-shift-card.pending { opacity: .65; }

.sst-shift-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sst-shift-name { font-size: 15px; font-weight: 700; color: var(--cream); }
.sst-shift-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

.sst-status-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.sst-status-badge.active  { background: rgba(42,110,74,.12); color: var(--sage2); border: 1px solid rgba(42,110,74,.2); }
.sst-status-badge.done    { background: rgba(90,64,56,.08); color: var(--muted2); border: 1px solid var(--border); }
.sst-status-badge.pending { background: rgba(138,92,26,.1); color: var(--gold2); border: 1px solid rgba(138,92,26,.2); }

/* Живая точка */
.sst-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage2);
  display: inline-block;
  animation: sst-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes sst-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* KPI панель */
.sst-kpi-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.sst-kpi-box {
  flex: 1;
  min-width: 60px;
  text-align: center;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 6px;
}
.sst-kpi-box.primary .sst-kpi-val { color: var(--sage2); }
.sst-kpi-val { font-size: 17px; font-weight: 700; color: var(--cream); line-height: 1; }
.sst-kpi-lbl { font-size: 10px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .3px; }

/* Товары */
.sst-items-section { padding: 10px 16px 4px; }
.sst-items-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sst-item-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: 13px;
}
.sst-item-row:last-child { border-bottom: none; padding-bottom: 10px; }
.sst-item-medal { font-size: 14px; width: 20px; flex-shrink: 0; }
.sst-item-name  { flex: 1; color: var(--cream2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sst-item-bar-wrap {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
}
.sst-item-bar { height: 100%; background: var(--rose2); border-radius: 2px; transition: width .4s ease; }
.sst-item-qty { color: var(--muted2); font-size: 11px; min-width: 38px; text-align: right; flex-shrink: 0; }
.sst-item-rev { color: var(--sage2); font-size: 11px; font-weight: 600; min-width: 58px; text-align: right; flex-shrink: 0; }

/* Убытки */
.sst-loss-block {
  margin: 0 16px 14px;
  border-radius: 10px;
  background: rgba(192,32,16,.07);
  border: 1px solid rgba(192,32,16,.15);
  padding: 10px 12px;
}
.sst-loss-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sst-loss-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 2px 0;
}
.sst-loss-name { color: var(--cream2); }
.sst-loss-qty  { color: var(--red); font-weight: 600; }

/* Пустое состояние */
.sst-no-data {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 14px 16px;
}
.myshift-today-empty {
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  padding: 10px 0;
}
.myshift-today-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.myshift-time-box {
  background: var(--s2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.myshift-time-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted2); }
.myshift-time-val { font-size: 22px; font-weight: 700; color: var(--cream); }
.myshift-time-val.sage { color: var(--sage2); }
.myshift-time-val.rose { color: var(--rose2); }
.myshift-time-sub { font-size: 10px; color: var(--muted2); }


/* ═══════════════════════════════════════════════════════════════════════════
   МОЯ СТАТИСТИКА
   ═══════════════════════════════════════════════════════════════════════════ */

.mystats-wrap {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mystats-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.mystats-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--rose2));
}
.mystats-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose2));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.mystats-name  { font-size: 18px; font-weight: 600; color: var(--cream); font-family: 'Cormorant Garamond', serif; }
.mystats-shift-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(122,58,40,.12);
  color: var(--rose2);
  font-weight: 500;
}

/* KPI сегодня — 3 карточки */
.mystats-today-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mst-kpi {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mst-kpi::before {
  content: ''; position: absolute; top:0; left:0; right:0; height: 3px;
}
.mst-kpi.sage::before { background: linear-gradient(90deg, var(--sage), var(--sage2)); }
.mst-kpi.gold::before { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.mst-kpi.rose::before { background: linear-gradient(90deg, var(--rose), var(--rose2)); }
.mst-kpi-ico { font-size: 18px; color: var(--muted2); margin-bottom: 6px; }
.mst-kpi-val { font-size: 20px; font-weight: 700; color: var(--cream); line-height: 1; }
.mst-kpi-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* Статус сегодня — таймлайн */
.mystats-today-status {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}
.mst-today-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted2);
  margin-bottom: 14px;
}
.mst-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}
.mst-tl-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid var(--border);
  background: var(--s2);
  color: var(--muted2);
  transition: all .3s;
}
.mst-tl-dot.active { background: var(--sage2); border-color: var(--sage2); color: #fff; }
.mst-tl-dot.done   { background: var(--rose2); border-color: var(--rose2); color: #fff; }
.mst-tl-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  position: relative;
}
.mst-tl-line .fill { height: 100%; background: var(--sage2); transition: width .6s; }
.mst-tl-info {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.mst-tl-label { font-size: 11px; color: var(--muted); text-align: center; width: 36px; }
.mst-tl-label b { display: block; font-size: 12px; color: var(--cream2); font-weight: 600; }

/* Заголовок секции */
.mystats-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
}
.mystats-section-title i { color: var(--rose2); }
.mystats-week-range {
  font-size: 11px;
  color: var(--muted2);
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
  font-weight: 400;
}

/* Недельный календарь */
.mystats-week-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.mst-day {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all .2s;
}
.mst-day.worked { border-color: var(--sage2); background: rgba(58,144,96,.06); }
.mst-day.today  { border-color: var(--rose); box-shadow: 0 0 0 2px rgba(122,58,40,.15); }
.mst-day.absent { opacity: .45; }
.mst-day-name { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted2); }
.mst-day-num  { font-size: 13px; font-weight: 600; color: var(--cream2); }
.mst-day-icon { font-size: 14px; margin-top: 2px; }
.mst-day-time { font-size: 9px; color: var(--muted2); margin-top: 1px; }
.mst-day-extra{ font-size: 9px; color: var(--gold2); }

/* Итоговая карточка зарплаты */
.mystats-salary-card {
  background: linear-gradient(135deg, var(--s1), var(--s2));
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.mystats-salary-card::after {
  content: '💰';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: .08;
}
.msc-label  { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 6px; }
.msc-total  { font-size: 40px; font-weight: 700; color: var(--cream); font-family: 'Cormorant Garamond', serif; line-height: 1; }
.msc-unit   { font-size: 18px; color: var(--muted); margin-left: 4px; }
.msc-rows   { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.msc-row    { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.msc-row-lbl{ color: var(--muted); }
.msc-row-val{ font-weight: 600; color: var(--cream2); }
.msc-row-val.gold { color: var(--gold2); }
.msc-divider{ height: 1px; background: var(--border); margin: 6px 0; }

/* Не привязан */
.mystats-not-linked {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mystats-not-linked i { font-size: 40px; opacity: .4; margin-bottom: 4px; }
.mystats-not-linked p { font-size: 13px; line-height: 1.6; }

/* Мобильная адаптация */
@media (max-width: 480px) {
  .myshift-code-digits span { width: 50px; height: 62px; font-size: 30px; border-radius: 11px; }
  .myshift-code-digits { gap: 7px; }
  .myshift-wrap, .mystats-wrap { gap: 12px; }
  .mystats-today-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .mst-kpi { padding: 10px 8px; }
  .mst-kpi-val { font-size: 17px; }
  .mystats-week-calendar { gap: 4px; }
  .mst-day { padding: 8px 3px; border-radius: 9px; }
  .msc-total { font-size: 32px; }
  .mystats-salary-card { padding: 16px 18px; }
}

/* ══════════════════════════════════════════════════════════════════
   SALES ANALYTICS  (sa-*)
══════════════════════════════════════════════════════════════════ */

/* Toolbar */
.sa-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* KPI row */
.sa-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.sa-kpi {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .2s;
}
.sa-kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.sa-kpi-main {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose2) 100%);
  border-color: transparent;
  color: #fff;
}
.sa-kpi-main .sa-kpi-val { color: #fff; }
.sa-kpi-main .sa-kpi-lbl { color: rgba(255,255,255,.75); }
.sa-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: rgba(122,58,40,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--rose);
  flex-shrink: 0;
}
.sa-kpi-main .sa-kpi-icon { background: rgba(255,255,255,.2); color: #fff; }
.sa-kpi-icon.sage  { background: rgba(42,110,74,.12); color: var(--sage); }
.sa-kpi-icon.gold  { background: rgba(138,92,26,.12); color: var(--gold); }
.sa-kpi-icon.blue  { background: rgba(30,80,140,.12); color: #3a6eb0; }
.sa-kpi-val {
  font-size: 26px;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.1;
  color: var(--cream);
}
.sa-kpi-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-top: 2px;
}

/* Mid row (payment + seller) */
.sa-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.sa-pay-card,
.sa-seller-card,
.sa-top-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.sa-card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Payment bars */
.sa-pay-bars { display: flex; flex-direction: column; gap: 12px; }
.sa-pay-row  { display: flex; align-items: center; gap: 10px; }
.sa-pay-label {
  width: 110px;
  font-size: 13px;
  color: var(--cream2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sa-pay-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--s2);
  border-radius: 6px;
  overflow: hidden;
}
.sa-pay-bar {
  height: 100%;
  border-radius: 6px;
  transition: width .6s ease;
}
.sa-pay-bar.cash     { background: var(--sage); }
.sa-pay-bar.transfer { background: #3a6eb0; }
.sa-pay-val {
  width: 90px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream2);
}
.sa-pay-pct {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted2);
  text-align: right;
}

/* Top seller */
.sa-seller-body { min-height: 44px; }
.sa-seller-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sa-seller-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.sa-seller-rev { color: var(--rose); font-weight: 600; }

/* Day bars (mini chart) */
.sa-day-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  padding-top: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sa-day-bars::-webkit-scrollbar { display: none; }
.sa-day-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 24px;
  position: relative;
}
.sa-day-bar-wrap {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: flex-end;
}
.sa-day-bar {
  width: 100%;
  background: var(--rose2);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .4s ease;
}
.sa-day-bar-lbl {
  font-size: 9px;
  color: var(--muted2);
  margin-top: 3px;
  white-space: nowrap;
}
.sa-day-bar-tip {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

/* Top items */
.sa-top-card { margin-bottom: 4px; }
.sa-top-list { display: flex; flex-direction: column; gap: 10px; }
.sa-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--s2);
  border-radius: 10px;
}
.sa-top-medal {
  font-size: 22px;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
}
.sa-top-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.sa-top-info {
  flex: 1;
  min-width: 0;
}
.sa-top-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}
.sa-top-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.sa-top-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rose) 0%, var(--rose2) 100%);
  border-radius: 4px;
  transition: width .5s ease;
}
.sa-top-nums {
  text-align: right;
  flex-shrink: 0;
}
.sa-top-qty {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
}
.sa-top-rev {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .sa-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sa-mid-row { grid-template-columns: 1fr; }
  .sa-pay-label { width: 90px; }
}
@media (max-width: 480px) {
  .sa-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sa-kpi { padding: 12px 14px; gap: 10px; }
  .sa-kpi-val { font-size: 20px; }
  .sa-kpi-icon { width: 36px; height: 36px; font-size: 15px; }
}

/* ══ СТРАНИЦА НАСТРОЕК ══════════════════════════════════════════════════════ */

#page-settings { max-width: 860px; width: 100%; box-sizing: border-box; }

.settings-section {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.settings-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--s2);
}

.settings-section-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.settings-section-icon.rose { background: var(--rose); color: #fff; }
.settings-section-icon.sage { background: var(--sage); color: #fff; }
.settings-section-icon.gold { background: var(--gold); color: #fff; }
.settings-section-icon.red  { background: var(--red);  color: #fff; }

.settings-section-title { font-size: 16px; font-weight: 600; color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-section-sub   { font-size: 13px; color: var(--muted2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-section-head .btn-ghost { margin-left: auto; flex-shrink: 0; }
.settings-section-head > div { min-width: 0; flex: 1; }

/* KPI строка хранилища */
.storage-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.storage-kpi {
  background: var(--s1);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.storage-kpi-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.storage-kpi-ico.sage { background: rgba(42,110,74,.15); color: var(--sage); }
.storage-kpi-ico.gold { background: rgba(138,92,26,.15); color: var(--gold); }
.storage-kpi-ico.red  { background: rgba(192,32,16,.15); color: var(--red); }
.storage-kpi-ico.rose { background: rgba(122,58,40,.15); color: var(--rose); }
.storage-kpi-val { font-size: 22px; font-weight: 700; color: var(--cream); line-height: 1; }
.storage-kpi-lbl { font-size: 12px; color: var(--muted2); }

/* Прогресс-бар */
.storage-bar-wrap { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.storage-bar-label {
  display: flex; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--cream2);
  margin-bottom: 8px;
}
.storage-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
  background: var(--sage);
}
.storage-bar-fill.gold { background: var(--gold2); }
.storage-bar-hint { font-size: 12px; color: var(--muted2); margin-top: 6px; }

/* Кнопки действий */
.storage-actions {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(192,32,16,.05);
}

/* Пустое состояние */
.storage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--sage);
  font-weight: 600;
  font-size: 15px;
}
.storage-empty i { font-size: 22px; }

/* Заголовок списка сирот */
.storage-orphan-title {
  padding: 14px 20px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Сетка карточек файлов */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.storage-card {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .2s, opacity .3s;
}
.storage-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }

.storage-card-img-wrap {
  width: 100%; height: 90px;
  background: var(--bg);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.storage-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.storage-card-info {
  padding: 8px 10px 4px;
}
.storage-card-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.storage-card-size { font-size: 11px; color: var(--muted2); margin-top: 2px; }

.storage-card-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(192,32,16,.85);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.storage-card:hover .storage-card-del { opacity: 1; }
.storage-card-del:hover { background: var(--red); }

/* Инфо-сетка (О системе) */
.settings-info-grid { padding: 4px 0 8px; }
.settings-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.settings-info-row:last-child { border-bottom: none; }
.settings-info-row span { color: var(--muted); }
.settings-info-row strong { color: var(--cream); font-weight: 600; }

/* Адаптив настроек */
@media (max-width: 768px) {
  .storage-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .storage-kpi { padding: 14px 12px; }
  .storage-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .settings-section-head { padding: 14px 16px; gap: 10px; }
  .settings-info-row { padding: 10px 16px; font-size: 13px; }
}

@media (max-width: 480px) {
  /* Страница — без горизонтального переполнения */
  #page-settings { padding: 10px; overflow-x: hidden; }
  .settings-section { overflow: hidden; }

  /* Секция-шапка: компактная, текст не переносится */
  .settings-section-head {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .settings-section-icon { width: 34px; height: 34px; min-width: 34px; font-size: 14px; border-radius: 9px; }
  .settings-section-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .settings-section-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .settings-section-head .btn-ghost { padding: 6px 8px; font-size: 13px; margin-left: auto; flex-shrink: 0; }

  /* KPI: 2×2, плотные */
  .storage-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .storage-kpi { padding: 10px 8px; gap: 5px; }
  .storage-kpi-ico { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .storage-kpi-val { font-size: 17px; }
  .storage-kpi-lbl { font-size: 10px; }

  /* Прогресс-бар */
  .storage-bar-wrap { padding: 10px 12px; }
  .storage-bar-label { font-size: 12px; }
  .storage-bar-hint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Кнопка удалить всё */
  .storage-actions { padding: 10px 12px; }
  .storage-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 9px 12px;
  }

  /* Заголовок сирот */
  .storage-orphan-title { padding: 10px 12px 8px; font-size: 12px; }

  /* Сетка файлов */
  .storage-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 10px 12px; }
  .storage-card-img-wrap { height: 65px; }
  .storage-card-info { padding: 6px 8px 4px; }
  .storage-card-name { font-size: 10px; }
  .storage-card-size { font-size: 10px; }

  /* Кнопка удаления — всегда видима (нет hover на мобиле) */
  .storage-card-del { opacity: 1; width: 24px; height: 24px; font-size: 11px; }

  /* О системе */
  .settings-info-row {
    padding: 9px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
  }
  .settings-info-row span { color: var(--muted2); font-size: 11px; flex-shrink: 0; }
  .settings-info-row strong { font-size: 12px; text-align: right; word-break: break-word; }
}

@media (max-width: 360px) {
  #page-settings { padding: 8px; }
  .storage-kpi { padding: 8px 6px; }
  .storage-kpi-val { font-size: 15px; }

  .storage-grid { grid-template-columns: 1fr; gap: 6px; padding: 0 8px 10px; }
  .storage-card { display: flex; flex-direction: row; align-items: center; }
  .storage-card-img-wrap { width: 64px; min-width: 64px; height: 54px; flex-shrink: 0; }
  .storage-card-info { flex: 1; min-width: 0; padding: 8px 36px 8px 10px; }
  .storage-card-del { top: 50%; right: 8px; transform: translateY(-50%); }
}

/* ── SALES: суммы цветов ─────────────────────────────────────────────────────── */
.sl-amounts-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}
.sl-flower-cost {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sl-flower-cost i { color: var(--rose); opacity: .7; }
.sl-chip-price {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

/* ── СОТРУДНИКИ: детализация по дням ─────────────────────────────────────────── */
.ess-hist-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 2px 0 2px;
  user-select: none;
}
.ess-hist-head:hover .ess-hist-name { color: var(--sage2); }

.ess-chevron {
  font-size: 11px;
  color: var(--muted2);
  transition: transform .2s;
  margin-left: 4px;
}
.ess-chevron.open { transform: rotate(180deg); }

.ess-day-detail {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.ess-day-detail.open { display: flex; }

.edl-empty {
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
  padding: 8px 0;
}

.edl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--s2);
  flex-wrap: wrap;
}
.edl-row.edl-absent { background: rgba(180,70,50,.07); }
.edl-row.edl-late   { background: rgba(200,160,30,.07); }
.edl-row.edl-ok     { background: rgba(80,140,80,.06);  }

.edl-date {
  font-size: 12px;
  color: var(--muted);
  min-width: 70px;
  flex-shrink: 0;
}
.edl-date b { color: var(--cream2); }

.edl-times {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted2);
  flex: 1;
  min-width: 120px;
}
.edl-in  { color: var(--sage);  }
.edl-out { color: var(--rose2); }
.edl-arrow { opacity: .4; font-size: 11px; }

.edl-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.edl-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.edl-badge.ontime  { background: rgba(80,140,80,.18);   color: var(--sage2); }
.edl-badge.late    { background: rgba(200,140,30,.18);   color: var(--gold);  }
.edl-badge.early   { background: rgba(90,144,200,.18);   color: #7ab0e8;      }
.edl-badge.absent  { background: rgba(180,70,50,.18);    color: #e09080;      }
.edl-badge.extra   { background: rgba(125,168,122,.18);  color: var(--sage2); }

@media (max-width: 600px) {
  .edl-row { padding: 5px 8px; gap: 6px; }
  .edl-date { min-width: 56px; font-size: 11px; }
  .edl-times { font-size: 11px; min-width: 100px; }
  .sl-amounts-col { min-width: 80px; }
  .sl-card-amount { font-size: 16px; }
}

/* ── EMP STATS: week navigation ────────────────────────────────────────────── */
.ess-week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.ess-week-label-col {
  flex: 1;
  text-align: center;
}
.ess-week-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream2);
}
.ess-week-dates {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.ess-nav-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--s3);
  color: var(--cream2);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.ess-nav-btn:hover:not(:disabled) { border-color: var(--sage); color: var(--sage); }
.ess-nav-btn:disabled { opacity: .3; cursor: default; }
.ess-nav-btn.today-btn { color: var(--rose); border-color: var(--rose); }

/* ── Team KPI banner ─────────────────────────────────────────────────────────  */
.ess-week-kpi {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.ess-wkpi {
  flex: 1;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ess-wkpi i { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.ess-wkpi.warn i  { color: var(--gold); }
.ess-wkpi.sage i  { color: var(--sage); }
.ess-wkpi-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--cream2);
  line-height: 1;
}
.ess-wkpi.warn .ess-wkpi-val { color: var(--gold); }
.ess-wkpi.sage .ess-wkpi-val { color: var(--sage2); }
.ess-wkpi-lbl { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; }

/* ── Per-employee weekly card ────────────────────────────────────────────────  */
.esw-emp-list { display: flex; flex-direction: column; gap: 10px; }

.esw-emp-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s;
}
.esw-emp-card:hover { border-color: var(--border2); }
.esw-emp-card.ess-inactive { opacity: .6; }

.esw-emp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  cursor: pointer;
  user-select: none;
}
.esw-emp-head:hover .esw-emp-name { color: var(--sage2); }

.esw-emp-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.esw-emp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--s3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: var(--cream2);
  flex-shrink: 0;
}
.esw-emp-name {
  font-size: 14px; font-weight: 600; color: var(--cream2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 110px;
}

.esw-emp-metrics {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.esw-metric {
  text-align: center;
  min-width: 36px;
}
.esw-metric-val {
  font-size: 15px; font-weight: 700; color: var(--cream2);
  line-height: 1.1;
}
.esw-metric.warn .esw-metric-val { color: var(--gold); }
.esw-metric.sage .esw-metric-val { color: var(--sage2); }
.esw-metric-lbl { font-size: 9px; color: var(--muted2); text-transform: uppercase; letter-spacing: .4px; }

/* Day strip */
.esw-day-strip {
  display: flex;
  padding: 0 14px 12px;
  gap: 4px;
}
.esds-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
}
.esds-dayname {
  font-size: 9px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.esds-daynum {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}
.esds-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.esds-dot.absent  { background: var(--s3); color: var(--muted2); }
.esds-dot.present { background: rgba(125,168,122,.25); color: var(--sage2); }
.esds-dot.done    { background: rgba(125,168,122,.35); color: var(--sage2); border: 1.5px solid var(--sage); }
.esds-dot.late    { background: rgba(200,160,30,.25);  color: var(--gold); border: 1.5px solid var(--gold); }
.esds-in {
  font-size: 9px;
  color: var(--sage);
  white-space: nowrap;
}
.esds-absent-lbl { color: var(--muted2); }

/* Detail expand */
.esw-emp-card .ess-day-detail {
  border-top: 1px solid var(--border);
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .2s;
}
.esw-emp-card .ess-day-detail.open {
  max-height: 600px;
  padding: 10px 14px 14px;
}

@media (max-width: 600px) {
  .ess-week-nav { padding: 8px 10px; }
  .esw-emp-name { max-width: 80px; }
  .esw-emp-metrics { gap: 4px; }
  .esw-metric-val { font-size: 13px; }
  .esds-dot { width: 18px; height: 18px; font-size: 8px; }
  .esds-in { display: none; }
  .ess-wkpi-val { font-size: 17px; }
}
