:root {
  --color-primary: #f0c070;
  --color-success: #50c878;
  --color-warning: #f0a050;
  --color-danger: #e05555;
  --color-bg: #0f0f13;
  --color-bg-card: #1a1a22;
  --color-border: #2e2e3a;
  --color-text: #e8e0d5;
  --color-link: #f0c070;
  --color-hover: #ffd700;
  --color-selection: #2a2318;
  --radius: 12px;
  --font-size-base: 13px;
  --font-weight: 400;
  --header-weight: 700;
  --line-height: 1.5;
  /* ФАЗА 4.2: сетка кассы — управляется через JS/appSettings */
  --pos-columns: 5;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--color-bg); color: var(--color-text); min-height: 100vh; font-size: var(--font-size-base); font-weight: var(--font-weight); line-height: var(--line-height); }
a, .link { color: var(--color-link); }
::selection { background: var(--color-selection); }
.top-nav { background: var(--color-bg-card); border-bottom: 1px solid var(--color-border); padding: 0 24px; display: flex; align-items: center; gap: 8px; height: 56px; position: sticky; top: 0; z-index: 100; }
.logo { font-size: 18px; font-weight: 700; color: var(--color-primary); letter-spacing: -0.5px; margin-right: 16px; }
.logo span { color: var(--color-text); opacity: 0.5; font-weight: 400; font-size: 13px; margin-left: 6px; }
.nav-tab { padding: 6px 16px; border-radius: calc(var(--radius) - 4px); font-size: var(--font-size-base); font-weight: 500; cursor: pointer; transition: all 0.15s; border: none; background: transparent; color: #888; white-space: nowrap; }
.nav-tab:hover { background: var(--color-hover); color: var(--color-bg); }
.nav-tab.active { background: var(--color-primary); color: var(--color-bg); }
.nav-spacer { flex: 1; }
.btn { padding: 8px 16px; border-radius: calc(var(--radius) - 4px); font-size: var(--font-size-base); font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: var(--color-primary); color: var(--color-bg); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { opacity: 0.85; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.layout { display: flex; min-height: calc(100vh - 56px); overflow: hidden; }
.sidebar { width: 220px; background: #16161e; border-right: 1px solid var(--color-border); padding: 16px 12px; flex-shrink: 0; overflow-y: auto; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: #555; text-transform: uppercase; padding: 0 8px; margin-bottom: 6px; }
.sidebar-item i { width: 16px; text-align: center; font-size: 13px; opacity: .8; flex-shrink: 0; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(var(--radius) - 4px); font-size: var(--font-size-base); cursor: pointer; transition: all 0.15s; color: #888; margin-bottom: 2px; }
.sidebar-item:hover { background: var(--color-hover); color: var(--color-bg); }
.sidebar-item.active { background: #2a2318; color: var(--color-primary); }

/* ── Сворачиваемый сайдбар ────────────────────────── */
.sidebar {
  transition: width 0.28s cubic-bezier(.4,0,.2,1),
              padding 0.28s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}
.sidebar-toggle-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 220px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  color: var(--color-bg);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  transition: left 0.28s cubic-bezier(.4,0,.2,1),
              background 0.15s;
  line-height: 1;
  user-select: none;
}
.sidebar-toggle-btn:hover {
  background: #d4b87e;
  transform: translateY(-50%) scale(1.12);
}
.sidebar-toggle-btn.collapsed {
  left: 4px;
}
.sidebar-label,
.sidebar-section-title,
.sidebar-item span.sidebar-text {
  transition: opacity 0.15s;
}
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
}
/* ФАЗА 2.1: min-width:0 — классический flex-fix, без него контент выдавливает сайдбар */
.main { flex: 1; overflow: auto; min-width: 0; }
.page { display: none; padding: 24px; max-width: 100%; overflow-x: hidden; }
.page.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 8px; }
.page-title { font-size: 22px; font-weight: var(--header-weight); color: var(--color-primary); }
.page-subtitle { font-size: var(--font-size-base); color: #666; margin-top: 2px; }
.shift-banner { background: #1a2a1a; border: 1px solid #2a4a2a; border-radius: 0; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.shift-info { font-size: 13px; }
.shift-info strong { color: var(--color-success); }
/* Высота POS: 56px navbar + 42px pos-header-row + ~46px shift-banner = ~144px */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; height: calc(100vh - 144px); }
.pos-menu { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pos-categories { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; overflow-x: auto; }
.pos-cat { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--color-border); color: #888; border: none; white-space: nowrap; }
.pos-cat.active { background: var(--color-primary); color: var(--color-bg); }
.pos-cat:hover:not(.active) { background: #3a3a48; color: var(--color-text); }
/* ФАЗА 4.2: CSS-переменная --pos-columns управляется из JS через appSettings.pos_columns */
.pos-items { display: grid; grid-template-columns: repeat(var(--pos-columns), 1fr); gap: 10px; padding: 14px; overflow-y: auto; flex: 1; }
/* Модификаторы размера карточки */
.pos-card-small .pos-item { padding: 8px 6px; }
.pos-card-small .pos-item .item-emoji { font-size: 22px; margin-bottom: 3px; }
.pos-card-small .pos-item .item-name { font-size: 11px; }
.pos-card-small .pos-item .item-stock { display: none; }
.pos-card-large .pos-item { padding: 18px 12px; }
.pos-card-large .pos-item .item-emoji { font-size: 36px; margin-bottom: 8px; }
.pos-card-large .pos-item .item-name { font-size: 13px; }
/* Мини-попап настройки вида кассы */
.pos-view-popup {
  position: absolute;
  top: 48px; right: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 220px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pos-view-popup-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; margin-top: 12px; }
.pos-view-popup-label:first-child { margin-top: 0; }
.pos-col-btn { width: 36px; height: 32px; border-radius: 6px; border: 1px solid var(--color-border); background: transparent; color: #888; cursor: pointer; font-size: 12px; font-weight: 700; }
.pos-col-btn.active { background: var(--color-primary); color: var(--color-bg); border-color: var(--color-primary); }
.pos-item { background: #16161e; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.15s; position: relative; }
.pos-item:hover { border-color: var(--color-primary); background: #2a2318; transform: translateY(-1px); }
/* ФАЗА 4.1: визуальный стиль "нет в наличии" для полного POS */
.pos-item.pos-item-disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.6); }
.pos-item.pos-item-disabled:hover { transform: none; border-color: var(--color-border); background: #16161e; }
.pos-item .item-emoji { font-size: 28px; margin-bottom: 6px; }
.pos-item .item-name { font-size: 12px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.pos-item .item-price { font-size: var(--font-size-base); font-weight: 700; color: var(--color-primary); }
.pos-item .item-stock { font-size: 12px; color: #888; margin-top: 3px; font-weight: 600; }
.pos-cart { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.cart-header { padding: 10px 14px; border-bottom: 1px solid var(--color-border); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap; min-height: 46px; }
.cart-header-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow: hidden; }
.cart-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.customer-name-badge { font-size: 12px; color: var(--color-success); background: #1a2a1a; padding: 4px 8px; border-radius: 12px; display: none; }
.cart-items { flex: 1; overflow-y: auto; padding: 10px; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: calc(var(--radius) - 4px); margin-bottom: 4px; }
.cart-item:hover { background: var(--color-border); }
.ci-name { flex: 1; font-size: 12px; line-height: 1.3; }
.ci-qty { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-base); font-weight: 600; }
.ci-btn { width: 22px; height: 22px; border-radius: 6px; background: var(--color-border); border: none; color: var(--color-text); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.ci-btn:hover { background: var(--color-primary); color: var(--color-bg); }
.ci-total { font-size: var(--font-size-base); font-weight: 700; color: var(--color-primary); min-width: 55px; text-align: right; }
.cart-footer { padding: 14px 16px; border-top: 1px solid var(--color-border); }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.cart-total-label { font-size: var(--font-size-base); color: #888; }
.cart-total-val { font-size: 20px; font-weight: 700; color: var(--color-primary); }
/* ДИНАМИЧЕСКИЕ ЦЕНЫ: строка скидки */
.cart-discount-row { font-size: 11px; color: var(--color-success); min-height: 16px; margin-bottom: 10px; }
.pay-methods { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pay-btn { flex: 1; min-width: 70px; padding: 8px; border-radius: calc(var(--radius) - 4px); font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid var(--color-border); background: transparent; color: #888; transition: all 0.15s; }
.pay-btn.active { background: var(--color-primary); color: var(--color-bg); border-color: var(--color-primary); }
.pay-btn:hover:not(.active) { border-color: #888; color: var(--color-text); }
.login-overlay { display: none; position: fixed; inset: 0; background: rgba(15,15,19,0.97); z-index: 200; align-items: center; justify-content: center; }
.login-box { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: calc(var(--radius) + 4px); padding: 32px; width: 320px; text-align: center; }
.login-logo { font-size: 40px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--color-primary); margin-bottom: 4px; }
.login-sub { font-size: 12px; color: #666; margin-bottom: 24px; }
.login-input { background: #16161e; border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 4px); padding: 10px 14px; color: var(--color-text); font-size: 14px; width: 100%; margin-bottom: 10px; outline: none; }
.login-input:focus { border-color: var(--color-primary); }
/* ФАЗА 2.1: overflow-x:auto — таблицы прокручиваются горизонтально вместо того чтобы вылезать за экран */
.table-wrap { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 18px; font-size: 11px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--color-border); background: #16161e; }
td { padding: 11px 18px; font-size: var(--font-size-base); border-bottom: 1px solid #1e1e28; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #1e1e2a; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; }
.stat-card .label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.stat-card .sub { font-size: 12px; color: #666; margin-top: 4px; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stock-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px; position: relative; }
.stock-card .sc-name { font-size: var(--font-size-base); font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.stock-card .sc-qty { font-size: 24px; font-weight: 700; }
.stock-card .sc-unit { font-size: 12px; color: #666; }
.stock-card .sc-bar { height: 4px; background: var(--color-border); border-radius: 2px; margin-top: 10px; }
.stock-card .sc-fill { height: 100%; border-radius: 2px; background: var(--color-success); transition: all 0.3s; }
.stock-card.warning .sc-fill { background: var(--color-warning); }
.stock-card.critical .sc-fill { background: var(--color-danger); }
.stock-card .sc-label { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.stock-card.warning .sc-label { background: #3a2a1a; color: var(--color-warning); }
.stock-card.critical .sc-label { background: #3a1a1a; color: var(--color-danger); }
.section-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; overflow: hidden; }
.section-card-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--color-text); }
.section-card svg { display: block; max-width: 100%; }
.tl-item { display: flex; gap: 12px; padding: 8px 0; font-size: var(--font-size-base); border-bottom: 1px solid #1e1e28; }
.tl-item:last-child { border-bottom: none; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); margin-top: 5px; flex-shrink: 0; }
.tl-time { color: #666; min-width: 45px; font-size: 12px; }
.tl-user { color: var(--color-primary); font-weight: 600; margin-right: 4px; }
.tl-text { color: #aaa; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 300; align-items: center; justify-content: center; }
.modal-content { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.form-input { background: #16161e; border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 4px); padding: 10px 14px; color: var(--color-text); font-size: 14px; width: 100%; outline: none; }
.form-input:focus { border-color: var(--color-primary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.loading { text-align: center; padding: 40px; color: #666; }
.cert-input-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.cert-input { flex: 1; background: #16161e; border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 4px); padding: 8px 12px; color: var(--color-text); font-size: var(--font-size-base); outline: none; }
.cert-input:focus { border-color: var(--color-primary); }
.cert-btn { padding: 8px 12px; border-radius: calc(var(--radius) - 4px); background: var(--color-border); color: var(--color-text); border: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.cert-btn:hover { background: var(--color-primary); color: var(--color-bg); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-section { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; }
.settings-section-title { font-size: 16px; font-weight: 700; color: var(--color-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.color-picker-group { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.color-input { flex: 1; }
input[type="color"] { width: 100%; height: 40px; border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 4px); background: transparent; cursor: pointer; }
.radio-group { display: flex; gap: 12px; margin-bottom: 12px; }
.radio-btn { flex: 1; padding: 10px; border-radius: calc(var(--radius) - 4px); border: 1px solid var(--color-border); background: transparent; color: #888; cursor: pointer; text-align: center; font-size: var(--font-size-base); font-weight: 600; transition: all 0.15s; }
.radio-btn.active { background: var(--color-primary); color: var(--color-bg); border-color: var(--color-primary); }
.radio-btn:hover:not(.active) { border-color: #888; color: var(--color-text); }
.save-notice { background: #1a3a28; border: 1px solid #2a4a2a; border-radius: var(--radius); padding: 12px; margin-top: 20px; font-size: 12px; color: var(--color-success); text-align: center; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a48; border-radius: 2px; }
@media (max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } .pos-layout { grid-template-columns: 1fr; } }
.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.employee-card { background: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; position: relative; transition: all 0.15s; }
.employee-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.employee-card.inactive { opacity: 0.5; }
.emp-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emp-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--color-bg); flex-shrink: 0; }
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 15px; font-weight: 700; color: var(--color-text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-role { font-size: 12px; color: #888; }
.emp-badge { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 12px; }
.emp-badge.active { background: #1a3a28; color: var(--color-success); }
.emp-badge.inactive { background: #3a1a1a; color: var(--color-danger); }
.emp-details { font-size: 12px; color: #666; line-height: 1.6; }
.emp-detail { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.emp-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.permissions-matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.perm-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-tab { padding: 8px 16px; border-radius: calc(var(--radius) - 4px); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--color-border); background: transparent; color: #888; transition: all 0.15s; }
.filter-tab.active { background: var(--color-primary); color: var(--color-bg); border-color: var(--color-primary); }
.customer-input-wrap { display: flex; gap: 8px; margin-bottom: 8px; padding: 10px; background: #16161e; border-radius: calc(var(--radius) - 4px); align-items: center; }
.customer-input { flex: 1; background: transparent; border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 6px); padding: 8px 12px; color: var(--color-text); font-size: 13px; outline: none; }
.customer-input:focus { border-color: var(--color-primary); }
.customer-btn { padding: 8px 12px; border-radius: calc(var(--radius) - 6px); background: var(--color-primary); color: var(--color-bg); border: none; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.customer-btn:hover { opacity: 0.9; }
.shift-details { margin-top: 8px; padding: 12px; background: #16161e; border-radius: calc(var(--radius) - 4px); display: none; }
.shift-details.expanded { display: block; }
.shift-details-grid { display: grid; gap: 8px; }
.sale-item { padding: 8px; background: var(--color-bg-card); border-radius: calc(var(--radius) - 6px); font-size: 12px; }
.sale-item-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 600; }
.sale-item-products { color: #888; font-size: 11px; line-height: 1.5; }
.expand-btn { cursor: pointer; color: var(--color-primary); font-size: 12px; font-weight: 600; margin-top: 4px; display: inline-block; }
.expand-btn:hover { text-decoration: underline; }
.products-toolbar { display: flex; gap: 8px; }
/* ============================================================
   НОВЫЕ МОДУЛИ v2.0
   ============================================================ */

/* ── Отложенные чеки ──────────────────────────────────────── */
.held-cart-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.held-cart-card:hover { border-color: var(--color-primary); }
.hc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.hc-label { font-weight: 600; color: var(--color-text); }
.hc-time { font-size: 11px; color: #888; }
.hc-client { font-size: 12px; color: var(--color-primary); margin-bottom: 4px; }
.hc-items { font-size: 12px; color: #aaa; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-footer { display: flex; justify-content: space-between; align-items: center; }
.hc-total { font-weight: 700; color: var(--color-success); font-size: 15px; }
.hc-actions { display: flex; gap: 6px; }

/* ── Лояльность ───────────────────────────────────────────── */
.loyalty-block { padding: 8px; background: #0a1a0a; border: 1px solid #1a3a1a; border-radius: var(--radius); margin-bottom: 8px; }
.loyalty-points-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 8px; gap: 8px; }
.loyalty-discounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.loyalty-discount-badge { background: #1a2a1a; border: 1px solid #2a4a2a; color: var(--color-success); font-size: 11px; padding: 4px 8px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.loyalty-discount-badge:hover { background: #2a4a2a; }
.fav-products { margin-top: 8px; }
.fav-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.fav-product-tag { display: inline-block; background: #1a1a2a; border: 1px solid #2a2a4a; border-radius: 10px; font-size: 11px; padding: 3px 8px; margin: 2px; cursor: pointer; transition: background .15s; }
.fav-product-tag:hover { background: #2a2a4a; }

.birthday-block { border-left: 3px solid var(--color-warning); }
.birthday-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.birthday-name { font-weight: 600; flex: 1; }
.birthday-date { color: #aaa; font-size: 12px; }
.birthday-days { font-size: 12px; color: var(--color-warning); }
.birthday-days.today { color: var(--color-success); font-weight: 700; }

.loyalty-programs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.loyalty-program-card { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px; }
.loyalty-program-card.disabled { opacity: 0.5; }
.lp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lp-icon { font-size: 20px; }
.lp-name { font-weight: 600; flex: 1; }
.lp-desc { font-size: 12px; color: #888; margin-bottom: 6px; }
.lp-value { font-size: 12px; color: var(--color-primary); }

.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #333; border-radius: 20px; transition: .3s; }
.slider:before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
input:checked + .slider { background: var(--color-success); }
input:checked + .slider:before { transform: translateX(16px); }

.settings-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* ── Поставщики ───────────────────────────────────────────── */
.suppliers-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .suppliers-layout { grid-template-columns: 1fr; } }
.suppliers-list, .purchases-list { display: flex; flex-direction: column; gap: 10px; }
.supplier-card { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px; }
.s-name { font-weight: 600; margin-bottom: 4px; }
.s-contact, .s-phone, .s-email { font-size: 12px; color: #aaa; }
.s-notes { font-size: 12px; color: #888; margin-top: 4px; font-style: italic; }

.purchase-card { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px; }
.p-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.p-supplier { font-weight: 600; }
.p-date { font-size: 11px; color: #888; margin-bottom: 4px; }
.p-items { font-size: 12px; color: #aaa; margin-bottom: 8px; }
.p-footer { display: flex; justify-content: space-between; align-items: center; }
.p-total { font-weight: 700; color: var(--color-success); }
.p-actions { display: flex; gap: 6px; }

.modal-input { width: 100%; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text); margin-bottom: 8px; }
.modal-input-sm { padding: 6px 10px; background: var(--bg-card); border: 1px solid var(--color-border); border-radius: 8px; color: var(--color-text); }
.modal-box { background: var(--bg-modal, #1a1a2e); border: 1px solid var(--color-border); border-radius: 12px; padding: 24px; max-width: 480px; width: 95%; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.purchase-item-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }

/* ── Производственный календарь ───────────────────────────── */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 16px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 11px; color: #666; padding: 6px; }
.cal-day { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: 6px; padding: 6px; min-height: 80px; position: relative; font-size: 11px; transition: border-color .2s; }
.cal-day:hover { border-color: var(--color-primary); }
.cal-today { background: #1a2a1a; border-color: var(--color-success) !important; }
.cal-day-num { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cal-day-type { font-size: 9px; margin-bottom: 2px; }
.cal-note { font-size: 9px; color: #888; margin-bottom: 2px; }
.cal-staff { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.cal-staff-dot { background: #1a2a3a; border: 1px solid #2a4a6a; border-radius: 3px; padding: 1px 3px; font-size: 9px; }
/* ФАЗА 2.3: цвета по типу смены */
.cal-staff-dot[data-type="work"]    { background: #1a2a1a; border-color: #2a5a2a; color: #7ecf7e; }
.cal-staff-dot[data-type="day_off"] { background: #1a1a2a; border-color: #3a3a6a; color: #8888cc; }
.cal-staff-dot[data-type="vacation"]{ background: #1a2a2a; border-color: #2a5a5a; color: #7ecfcf; }
.cal-staff-dot[data-type="sick"]    { background: #2a1a1a; border-color: #6a2a2a; color: #cf7e7e; }
/* Легенда для статусов сотрудников */
.cal-legend-staff { background: var(--color-card); border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-legend-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #666; margin-right: 4px; }
/* ФАЗА 2.2: кнопка обновить на page-header */
.btn-refresh { background: transparent; border: 1px solid var(--color-border); color: #888; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all .15s; }
.btn-refresh:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cal-actions { position: absolute; bottom: 4px; right: 4px; display: none; gap: 2px; }
.cal-day:hover .cal-actions { display: flex; }
.cal-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 2px; }
.day-type-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.day-type-btn { padding: 10px; text-align: left; }

/* ── Инвентаризация ───────────────────────────────────────── */
.inv-open-session { background: #1a2a1a; border: 1px solid #2a4a2a; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.inv-session-header { display: flex; flex-direction: column; gap: 4px; }
.inv-table-wrap { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th, .inv-table td { padding: 8px 12px; border-bottom: 1px solid var(--color-border); text-align: left; }
.inv-table th { font-size: 12px; color: #888; }
.inv-qty-input { width: 80px; padding: 4px 8px; background: var(--bg-card); border: 1px solid var(--color-border); border-radius: 6px; color: var(--color-text); }
.inv-reason-input { width: 100%; padding: 4px 8px; background: var(--bg-card); border: 1px solid var(--color-border); border-radius: 6px; color: var(--color-text); }
.inv-diff-negative { background: rgba(224,85,85,.05); }
.inv-diff-positive { background: rgba(80,200,120,.05); }
.inv-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.inv-hist-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.inventory-history { margin-top: 12px; }

/* ── Ингредиенты и техкарты ───────────────────────────────── */
.ingredients-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .ingredients-layout { grid-template-columns: 1fr; } }
.row-warning { background: rgba(240,160,80,.06); }
.alert-card { border-left: 3px solid var(--color-danger); }
.low-stock-badge { display: inline-block; background: #2a1a1a; border: 1px solid var(--color-danger); color: var(--color-danger); border-radius: 8px; padding: 3px 10px; font-size: 12px; margin: 3px; }

.recipes-list { display: flex; flex-direction: column; gap: 10px; }
.recipe-card { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px; }
.recipe-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.recipe-ingredients { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-ing { background: #1a1a2a; border: 1px solid #2a2a4a; border-radius: 8px; font-size: 11px; padding: 3px 8px; color: #aaa; }
.recipe-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }


/* Дополнительные классы */
.p-status { font-size: 12px; font-weight: 600; }
.status-closed { color: #888; }
.status-open { color: var(--color-success); }
.chart-view-btn { }

/* ── Офлайн-режим ─────────────────────────────────────── */

.offline-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  z-index: 9999;
  transition: opacity 0.5s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.offline-bar--online {
  background: #1a3d2b;
  color: #50c878;
}

.offline-bar--offline {
  background: #3d1a1a;
  color: #ff7070;
}

.offline-bar--syncing {
  background: #2d2d1a;
  color: #f0c070;
}

.offline-bar-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: inherit;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.offline-bar-btn:hover { background: rgba(255,255,255,0.25); }

.offline-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px 0;
}

.offline-stat {
  text-align: center;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: 10px;
  min-width: 100px;
}

.offline-stat-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
}

.offline-stat-lbl {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════
   БАТЧ 4: МОБИЛЬНАЯ КАССА + ТЕМЫ + УВЕДОМЛЕНИЯ
   ══════════════════════════════════════════════════ */

/* ── Переключатель режима POS ─────────────────────── */
.pos-mode-toggle {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 50;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.pos-mode-toggle:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ КАССА — профессиональный вид (референс r-keeper/iiko)
   Раскладка: [меню + товары слева] | [заказ справа]
   На узких экранах: [товары сверху] → [заказ снизу]
   ══════════════════════════════════════════════════════════════ */



.stock-grid-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }


/* Пункт 5: крупная строка скидки в корзине */
.cart-discount-total {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-success);
  padding: 5px 0;
}
.cart-cert-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 4px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}

/* ── Светлая (розово-бежевая) тема ── */
/* Применяется когда quickTheme='light'. CSS-переменные — через JS.
   Здесь исправляем элементы с захардкоженными тёмными цветами */

/* Базовые поверхности */
[data-quick-theme="light"] {
  --color-primary: #6B2060;
  --color-bg: #F4EDE8;
  --color-text: #3a2030;
  --color-text-muted: #7a5060;
  --color-border: #DBBFA8;
  --color-hover: rgba(107,32,96,.08);
}
[data-quick-theme="light"] body { background: #F4EDE8; color: #3a2030; }
[data-quick-theme="light"] .top-nav {
  background: #6B2060; border-color: #5B1A52;
}
[data-quick-theme="light"] .top-nav .logo { color: #F4E0D0; }
[data-quick-theme="light"] .nav-tab { color: #E8D0C8; border-color: transparent; background: transparent; }
[data-quick-theme="light"] .nav-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
[data-quick-theme="light"] .nav-tab.active {
  background: rgba(255,255,255,0.18); color: #fff;
  border-color: rgba(255,255,255,0.35);
}
[data-quick-theme="light"] #liveClock { color: #DDBBCC; }
[data-quick-theme="light"] #userDisplay { color: #DEC8D8; }
[data-quick-theme="light"] #offlineNavLabel { color: #DEC8D8; }

/* Сайдбар */
[data-quick-theme="light"] .sidebar { background: #5B1A52; border-color: #4E1446; }
[data-quick-theme="light"] .sidebar-section-label { color: #C8A0C0; }
[data-quick-theme="light"] .sidebar-item { color: #EDD5E8; }
[data-quick-theme="light"] .sidebar-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
[data-quick-theme="light"] .sidebar-item.active { background: rgba(255,255,255,0.18); color: #fff; }
[data-quick-theme="light"] .sidebar-toggle {
  background: #EDD5C0; color: #5B1A52; border-color: #C8A0B0;
}

/* Основной контент */
[data-quick-theme="light"] .main { background: #F4EDE8; }
[data-quick-theme="light"] .page { background: #F4EDE8; }

/* Карточки и секции */
[data-quick-theme="light"] .section-card {
  background: #FDF8F5; border-color: #DBBFA8; color: #3a2030;
}
[data-quick-theme="light"] .section-card-title { color: #5B1A52; }

/* Формы */
[data-quick-theme="light"] .form-input {
  background: #FDF8F5; color: #3a2030;
  border-color: #DBBFA8;
}
[data-quick-theme="light"] .form-input:focus {
  border-color: #7B2D6E; box-shadow: 0 0 0 2px rgba(123,45,110,0.15);
}
[data-quick-theme="light"] .form-label { color: #6B2060; }
[data-quick-theme="light"] .modal-input {
  background: #FDF8F5; color: #3a2030; border-color: #DBBFA8;
}

/* Кнопки */
[data-quick-theme="light"] .btn-secondary {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] .btn-secondary:hover {
  background: #E0C5AD; border-color: #7B2D6E;
}
[data-quick-theme="light"] .btn-primary {
  background: #7B2D6E; color: #fff; border-color: #6B2060;
}
[data-quick-theme="light"] .btn-primary:hover { background: #6B2060; }

/* Таблицы */
[data-quick-theme="light"] table th {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] table td { border-color: #DBBFA8; color: #3a2030; }
[data-quick-theme="light"] table tr:nth-child(even) { background: #F8F0EB; }
[data-quick-theme="light"] table tr:hover { background: #F0E4DB; }
[data-quick-theme="light"] .table-wrap { border-color: #DBBFA8; }

/* POS — товары */
[data-quick-theme="light"] .pos-menu { background: #FDF8F5; border-color: #DBBFA8; }
[data-quick-theme="light"] .pos-categories { border-color: #DBBFA8; }
[data-quick-theme="light"] .pos-cat {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] .pos-cat.active {
  background: #7B2D6E; color: #fff; border-color: #6B2060;
}
[data-quick-theme="light"] .pos-item {
  background: #FDF8F5; border-color: #DBBFA8; color: #3a2030;
  box-shadow: 0 1px 3px rgba(91,26,82,0.07);
}
[data-quick-theme="light"] .pos-item:hover {
  border-color: #7B2D6E; background: #F5EAF0; transform: translateY(-1px);
}
[data-quick-theme="light"] .pos-item .item-name { color: #3a2030; }
[data-quick-theme="light"] .pos-item .item-stock { color: #9A6080; }
[data-quick-theme="light"] .pos-item.pos-item-disabled:hover {
  background: #FDF8F5; border-color: #DBBFA8; transform: none;
}

/* POS — корзина */
[data-quick-theme="light"] .pos-cart {
  background: #FDF8F5; border-color: #DBBFA8;
}
[data-quick-theme="light"] .cart-header { border-color: #DBBFA8; }
[data-quick-theme="light"] .cart-item { border-color: #DBBFA8; color: #3a2030; }
[data-quick-theme="light"] .cart-footer { border-color: #DBBFA8; }
[data-quick-theme="light"] .ci-btn {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] .customer-input {
  background: #FDF8F5; color: #3a2030; border-color: #DBBFA8;
}
[data-quick-theme="light"] .pay-btn {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] .pay-btn.active {
  background: #7B2D6E; color: #fff; border-color: #6B2060;
}

/* Баннер смены */
[data-quick-theme="light"] .shift-banner {
  background: #F0E4F5; border-color: #D0A8D0;
}
[data-quick-theme="light"] .shift-info { color: #4a1a40; }
[data-quick-theme="light"] .shift-info strong { color: #5B1A52; }

/* Модалы */
[data-quick-theme="light"] .modal-content {
  background: #FDF8F5; border-color: #DBBFA8; color: #3a2030;
}
[data-quick-theme="light"] .modal-title { color: #5B1A52; }

/* Страница заголовки */
[data-quick-theme="light"] .page-title { color: #6B2060; }
[data-quick-theme="light"] .page-subtitle { color: #9A6080; }
[data-quick-theme="light"] .page-header { border-color: #DBBFA8; }

/* Stock карточки */
[data-quick-theme="light"] .stock-card {
  background: #FDF8F5; border-color: #DBBFA8; color: #3a2030;
}
[data-quick-theme="light"] .sc-name { color: #3a2030; }
[data-quick-theme="light"] .sc-qty { color: #5B1A52; }
[data-quick-theme="light"] .sc-bar { background: #DBBFA8; }

/* Filter tabs */
[data-quick-theme="light"] .filter-tab {
  background: #EDD5C0; color: #5B1A52; border-color: #DBBFA8;
}
[data-quick-theme="light"] .filter-tab.active {
  background: #7B2D6E; color: #fff;
}

/* Employee cards */
[data-quick-theme="light"] .employee-card {
  background: #FDF8F5; border-color: #DBBFA8; color: #3a2030;
}

/* Toast */
[data-quick-theme="light"] .toast {
  background: #FDF8F5; color: #3a2030; border-color: #DBBFA8;
  box-shadow: 0 4px 16px rgba(91,26,82,0.15);
}

/* ============================================================
   АДАПТИВНОСТЬ — расширенные breakpoints
   ============================================================ */

/* Планшет в портрете и небольшие ноутбуки */
@media (max-width: 1100px) {
  .pos-layout { grid-template-columns: 1fr !important; }
  .pos-categories { flex-wrap: wrap; }
  .kanban-board, [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Планшет */
@media (max-width: 900px) {
  .sidebar { width: 56px !important; }
  .sidebar .nav-label { display: none !important; }
  .sidebar .nav-icon { font-size: 20px; }
  .page-content { margin-left: 56px !important; }
  .top-nav { left: 56px !important; }
  .page-header { flex-direction: column; align-items: flex-start !important; gap: 8px; }
  .page-header > div:last-child { width: 100%; }
  .modal-content { max-width: 95vw !important; margin: 10px auto; }
  .suppliers-layout, .ingredients-layout { grid-template-columns: 1fr !important; }
}

/* Мобильный */
@media (max-width: 600px) {
  .sidebar { display: none !important; }
  .page-content { margin-left: 0 !important; padding: 8px !important; }
  .top-nav { left: 0 !important; padding: 0 8px; }
  .login-box { width: 90vw !important; padding: 24px 20px !important; }
  .pos-layout { grid-template-columns: 1fr !important; }
  .cart-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    border-radius: 16px 16px 0 0 !important; max-height: 50vh; overflow-y: auto; }
  .modal-content { max-width: 100vw !important; width: 100vw; margin: 0;
    border-radius: 16px 16px 0 0; position: fixed; bottom: 0; top: auto !important; }
  .kanban-board, [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
  }
  table { font-size: 12px !important; }
  table th, table td { padding: 6px 8px !important; }
  .btn { padding: 7px 12px !important; font-size: 13px !important; }
  .page-title { font-size: 18px !important; }
}

/* Маленький мобильный */
@media (max-width: 380px) {
  .login-box { padding: 20px 14px !important; }
  .login-title { font-size: 18px !important; }
}

/* Большие мониторы (2K+) */
@media (min-width: 1600px) {
  :root { --base-font: 15px; }
  .pos-layout { grid-template-columns: 1fr 420px !important; }
  .sidebar { width: 220px !important; }
  .page-content { max-width: 1600px; margin-left: auto !important; margin-right: auto !important; }
}

/* ══════════════════════════════════════════════════════════════
   ФАЗА UI: SKELETON-ЗАГРУЗКА
   ══════════════════════════════════════════════════════════════ */
@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #1e1e28 25%, #28283a 50%, #1e1e28 75%);
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.5s infinite;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * { opacity: 0 !important; }

.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, #1e1e28 25%, #28283a 50%, #1e1e28 75%);
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.5s infinite;
  margin-bottom: 8px;
}
.skeleton-line.short  { width: 45%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long   { width: 90%; }

.skeleton-card {
  border-radius: var(--radius);
  background: var(--color-bg-card);
  padding: 16px;
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════
   ФАЗА UI: МИКРОАНИМАЦИИ
   ══════════════════════════════════════════════════════════════ */

/* Кнопки — нажатие */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: scale(0.95);
  transition: transform 0.08s ease;
}
.btn { transition: all 0.15s ease; }

/* Строки таблицы — появление сверху */
@keyframes row-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.table-row-new {
  animation: row-slide-in 0.25s ease-out;
}

/* Модальное окно — влетает снизу */
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box,
.modal-content,
.modal-inner {
  animation: modal-slide-up 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Оверлей модала — мягкое появление */
@keyframes overlay-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-overlay.active,
.modal.active {
  animation: overlay-fade-in 0.18s ease;
}

/* Карточки stat-card — появление */
@keyframes card-pop-in {
  from { opacity: 0; transform: scale(0.95) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.stat-card {
  animation: card-pop-in 0.3s ease-out;
}

/* Sidebar items — hover микро-сдвиг */
.sidebar-item {
  transition: all 0.15s ease;
}
.sidebar-item:hover {
  transform: translateX(3px);
}

/* Nav tabs — плавный underline */
.nav-tab {
  position: relative;
  overflow: hidden;
}
.nav-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease, left 0.2s ease;
}
.nav-tab:hover::after {
  width: 80%; left: 10%;
}

/* Тост — плавное появление снизу */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.show {
  animation: toast-in 0.22s ease-out;
}

/* Плавная загрузка страниц */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page.active {
  animation: page-fade-in 0.2s ease-out;
}

