/* Расшифровка расхождения по продукту */
.breakdown th { font-weight: 400; text-align: left; }
.breakdown-total th, .breakdown-total td { font-weight: 700; }

/* Предупреждение о цене в приходе */
.price-warnings ul { margin: 6px 0 10px; padding-left: 20px; }
.price-warnings .check { font-weight: 700; }
.confirm-big .notice-check { text-align: left; margin-bottom: 8px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }


/* ================= Оформление в духе iOS =================
   Поверх базовых стилей: полупрозрачная шапка, сгруппированные белые карточки без теней,
   значки на синих «плашках», сегментные вкладки, круглые клавиши, переключатели. */
/* Шапка: полупрозрачная, с размытием; крупный заголовок; «назад» и действия — акцентным текстом */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -.5px 0 var(--sep); padding-top: 12px; padding-bottom: 12px; }
.topbar-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -.025em; }
.topbar a[aria-label="Назад"], .topbar button[aria-label="Назад"] { color: var(--accent); }
.topbar a[aria-label="Назад"] .icon { width: 30px; height: 30px; stroke-width: 2.4; }
.topbar .btn-quiet { color: var(--accent); font-weight: 500; }
.who { color: var(--text); font-weight: 500; text-decoration: none; }
.page { padding-top: 24px; }
h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--muted); margin: 32px 0 8px 16px; }

/* Кнопки: синяя, «тонированная» и текстовая — как в iOS */
.btn { border-radius: 14px; font-weight: 600; background: var(--tint); color: var(--accent); min-height: 52px; box-shadow: none; }
.btn .icon { color: currentColor; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-problem { background: var(--problem-bg); color: var(--problem); }
.btn-big { border-radius: 16px; min-height: 60px; font-size: 1.08rem; }
.btn:active { opacity: .7; }

/* Вкладки → сегментный переключатель */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--field); border-radius: 12px; margin-bottom: 20px; flex-wrap: nowrap; }
.tab { min-height: 40px; padding: 0 20px; border-radius: 9px; font-weight: 600; font-size: .95rem; color: var(--text); background: transparent; }
.tab.active { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .tab.active { background: #636366; }

/* Поиск как в iOS */
.search input { background: var(--field); border-radius: 12px; min-height: 48px; font-size: 1.05rem; box-shadow: none; }

/* Карточки и плитки — белые на сером, без теней (сгруппированный стиль iOS) */
.tile, .section-tile, .card, .home-btn, .att-card { border-radius: var(--radius); box-shadow: none; }
.tile { gap: 12px; }
.tile-name { font-weight: 600; letter-spacing: -.015em; }
.tile-sub { color: var(--muted); }
.tile-icon { color: var(--accent); }
/* Значок продукта или группы — как значок приложения: синий квадрат-«плашка» */
.tile-placeholder { border-radius: 22%; background: var(--tint); color: var(--accent); }
.tile > .tile-icon { width: 60px; height: 60px; padding: 13px; border-radius: 16px; background: var(--tint); }
.section-tile .tile-icon { color: #fff; background: var(--accent); border-radius: 13px; padding: 10px; width: 50px; height: 50px; }
.section-tile .tile-name { font-size: 1.35rem; font-weight: 700; letter-spacing: -.025em; }

/* Главный экран кухни */
.home-btn { font-weight: 700; letter-spacing: -.025em; }
.home-btn .icon { color: var(--accent); background: var(--tint); border-radius: 16px; padding: 12px; width: 3.4rem; height: 3.4rem; }
.home-main { background: var(--accent); color: #fff; }
.home-main .icon { color: #fff; background: rgba(255, 255, 255, .18); border-radius: 26px; padding: 18px; width: 6rem; height: 6rem; }
.home-main small { color: rgba(255, 255, 255, .85); }

/* Списки → сгруппированные с тонкими разделителями */
.list { gap: 0; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }
.list-row { background: transparent; border-radius: 0; box-shadow: inset 0 -.5px 0 var(--sep); min-height: 64px; }
.list-row:last-child { box-shadow: none; }
.list-row strong { font-weight: 600; }

/* «Требует внимания» — как уведомление iOS: цветной кружок только по смыслу */
.att-row > .icon:first-child { border-radius: 50%; padding: 6px; width: 34px; height: 34px; color: #fff; }
.att-problem > .icon:first-child, .att-problem .att-row > .icon:first-child { background: var(--problem); }
.att-check > .icon:first-child, .att-check .att-row > .icon:first-child { background: var(--check); }

/* Поля ввода */
.field input[type=text], .field input[type=number], .field input[type=password], .field input[type=tel],
.field input[type=email], .field select, .field textarea, .form input[type=text], .form select {
  background: var(--field); border: 0; border-radius: 12px; min-height: 52px; box-shadow: none; }
.field-label { font-weight: 500; color: var(--muted); font-size: .88rem; letter-spacing: 0; text-transform: none; }
.form.card { padding: 24px 28px; }

/* Варианты-кнопки → «таблетки», выбранная — синяя */
.choice span { border-radius: 999px; background: var(--field); font-weight: 600; min-height: 46px; padding: 0 20px; }
.choice input:checked + span { background: var(--accent); color: #fff; }

/* Галочки → переключатели iOS (зелёный — «включено») */
.check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 31px;
  background: rgba(120, 120, 128, .2); position: relative; flex: none; transition: background .2s; margin: 0; }
.check input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .2s; }
.check input[type=checkbox]:checked { background: #34c759; }
.check input[type=checkbox]:checked::after { transform: translateX(20px); }
.check { font-weight: 500; }

/* PIN и цифровая клавиатура повара — круглые клавиши, как на iPhone */
.pin-hint { font-weight: 500; font-size: 1.2rem; }
.pin-keys { gap: 20px 28px; max-width: 360px; margin-left: auto; margin-right: auto; }
.pin-key { display: flex; align-items: center; justify-content: center; padding: 0;
  -webkit-appearance: none; appearance: none; line-height: 1; text-align: center;
  width: 88px; height: 88px; border-radius: 50%; justify-self: center; background: var(--field);
  font-size: 2.2rem; font-weight: 400; color: var(--text); }
.pin-key:active { background: var(--surface-pressed); }
.pin-key-ok { background: var(--accent); color: #fff; font-size: 1.15rem; font-weight: 600; }
.pin-dots span { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .pinpad .pin-keys { --pin-key-size: clamp(64px, 18vw, 76px);
    grid-template-columns: repeat(3, var(--pin-key-size)); width: max-content;
    gap: 14px 18px; }
  .pinpad .pin-key { width: var(--pin-key-size); height: var(--pin-key-size);
    min-height: 0; font-size: 1.9rem; }
  .pinpad .pin-key-ok { font-size: 1rem; }
  .pinpad .pin-dots { margin: 22px 0; gap: 14px; }
}
.numpad-display { font-weight: 600; letter-spacing: -.03em; }

/* Плашки, уведомления, всплывающие окна */
.notice-check, .notice-problem { border-radius: 14px; }
.notification-count { background: var(--problem); }
.notification-popup { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .18); }
.toast { border-radius: 16px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.badge-new { border-radius: 6px; background: var(--accent); color: #fff; }
.table th { font-weight: 500; color: var(--muted); }
.btn.mark-button { min-height: 120px; font-size: 1.7rem; border-radius: 28px; }
@media (max-width: 600px) { .topbar-title { font-size: 1.2rem; } .home-main .icon { width: 4.5rem; height: 4.5rem; padding: 14px; } }

/* Вкладки не шире экрана: лишнее листается вбок внутри переключателя, кнопка действия — справа */
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs .tabs-action { margin-left: 8px; flex: none; min-height: 40px; border-radius: 9px; background: var(--accent); color: #fff; }

/* Телефон: в шапке только значки — заголовку нужно место; строка продаж — в две строки */
@media (max-width: 600px) {
  .who { display: none; }
  .topbar-right form .btn { font-size: 0; gap: 0; }
  .topbar-right form .btn .icon { width: 24px; height: 24px; }
  .sale-row { flex-wrap: wrap; row-gap: 6px; padding-top: 12px; }
  .sale-name { flex-basis: 100%; }
  .sale-price { margin-right: auto; }
}
/* Поле количества в строке (продажи, пересчёт) — белое на сером, чтобы было видно, куда нажимать */
.form .sale-row input[type=text] { background: var(--surface); }

/* Остатки → «Излишки»: плюс и сумма под ним */
.stock-surplus { text-align: right; }
.stock-surplus small { display: block; font-size: .9rem; }
.stock-surplus-note { display: block; }

/* Широкая таблица на телефоне → карточка на строку: название сверху, цифры с подписями сеткой */
@media (max-width: 600px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody { display: block; }
  .table-stack tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; padding: 14px 0;
    box-shadow: inset 0 -.5px 0 var(--sep); }
  .table-stack tr:last-child { box-shadow: none; }
  .table-stack tr:has(> td:nth-child(3):last-child) { grid-template-columns: auto 1fr; }
  .table.table-stack td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .table-stack td:first-child { grid-column: 1 / -1; font-size: 1.08rem; font-weight: 600; }
  .table-stack td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
  .table-stack td:first-child::before { display: none; }
  .table-stack td[colspan] { grid-column: 1 / -1; }
  .table-stack td[colspan]::before { display: none; }
  /* Фильтры остатков: отдельные «таблетки», переносятся и все видны сразу */
  .stock-controls .tabs { background: none; padding: 0; gap: 8px; flex-wrap: wrap; overflow: visible; }
  .stock-controls .tab { background: var(--field); border-radius: 999px; box-shadow: none; min-height: 40px; padding: 0 16px; }
  .stock-controls .tab.active, :root[data-theme="dark"] .stock-controls .tab.active { background: var(--accent); color: #fff; box-shadow: none; }
}

/* Предупреждение «Админ-окно закроется через 30 с». Жёлтый — «надо проверить». */
.idle-warning { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 16px; width: min(calc(100vw - 32px), 560px); padding: 12px 12px 12px 22px; border-radius: 16px; background: var(--check-bg); color: var(--text); font-weight: 600; }
.idle-warning > span { flex: 1; }
.idle-warning .btn { flex: none; }
.idle-warning[hidden] { display: none; }
.draft-notice { margin: 0 0 20px; font-weight: 600; }
.processing-hint { display: block; margin-top: 8px; line-height: 1.35; }



/* Страницы ошибок (404, 500 и т. п.): одна мысль и одна кнопка. */
.error-page { text-align: center; display: grid; gap: 16px; justify-items: center; }
.error-page h1 { margin: 0; }
.error-page p { margin: 0 0 8px; line-height: 1.5; }
.error-page-icon .icon { width: 3.5rem; height: 3.5rem; color: var(--muted); }

/* Предупреждение с выбором: значок слева, текст и варианты справа (продажи за внесённый день, проверка цифр). */
.notice-flex { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; }
.notice-flex > .icon { flex: none; color: var(--check); margin-top: 2px; }
.notice-flex > div { min-width: 0; line-height: 1.5; }
.notice-flex ul { margin: 6px 0 0; padding-left: 20px; }
.notice-flex .choices { margin-top: 12px; }
.notice-flex small { display: block; margin-top: 8px; }
.notice-flex .check-line { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-weight: 600; cursor: pointer; }
.notice-flex .check-line input { width: 24px; height: 24px; flex: none; }
