body { background: #f4f5f7; }
.table td, .table th { vertical-align: middle; }
.badge-spec { background: #e7f1ff; color: #0a58ca; font-weight: 500; }
.form-check-inline { margin-right: 1.25rem; }
.notif-badge { position: relative; display: inline-block; }
.cursor-grab { cursor: grab; }
.sortable-ghost { opacity: .4; }

/* Доска */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.board-col { flex: 0 0 260px; background: #e9ecef; border-radius: .5rem; padding: .5rem; min-height: 200px; }
.board-col h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; color: #495057; margin: .25rem .25rem .5rem; display: flex; justify-content: space-between; }
.board-card { background: #fff; border-radius: .4rem; padding: .55rem .65rem; margin-bottom: .5rem; box-shadow: 0 1px 2px rgba(0,0,0,.08); border-left: 4px solid #0d6efd; cursor: grab; }
.board-card.overdue { border-left-color: #dc3545; background: #fff5f5; }
.board-card.ready { border-left-color: #198754; }
.board-card .plate { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.board-card a { color: inherit; text-decoration: none; }

/* Цепочка */
.chain-step { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border: 1px solid #dee2e6; border-radius: .4rem; background: #fff; margin-bottom: .35rem; flex-wrap: wrap; }
.chain-step.locked { background: #f8f9fa; }
.chain-step .num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e9ecef; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; flex: none; }
.chain-step.status-done .num { background: #198754; color: #fff; }
.chain-step.status-in_progress .num { background: #0d6efd; color: #fff; }
.chain-step.status-available .num { background: #0dcaf0; }
.chain-step.status-paused .num { background: #ffc107; }
.chain-step .stage-name { font-weight: 500; min-width: 9rem; }

/* Фото */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.photo-tile { position: relative; background: #fff; border-radius: .4rem; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.photo-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-tile.unseen { outline: 3px solid #fd7e14; }
.photo-tile .meta { font-size: .75rem; padding: .3rem .4rem; }

/* Выбор фото (камера / галерея) */
.photo-picker label.btn { position: relative; }
.photo-picker label.btn:focus-within { box-shadow: 0 0 0 .25rem rgba(13,110,253,.35); }
.pp-tile .pp-remove { position: absolute; top: 4px; right: 4px; padding: .05rem .35rem; line-height: 1.2; opacity: .92; }
.pp-tile.pp-loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.55)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='%230d6efd' stroke-width='5' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 36px no-repeat; }
.pp-preview:empty { display: none; }
#photo-upload, #photos, #comments, #parts, #share, #invoices { scroll-margin-top: 4.5rem; }  /* шапка закреплена сверху */

/* Прогресс для клиента */
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; }
.steps .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid #adb5bd; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.steps .done .dot { background: #198754; border-color: #198754; color: #fff; }
.steps .active .dot { border-color: #0d6efd; background: #cfe2ff; }
.steps .active { font-weight: 600; }

/* Работник: мобильный интерфейс */
.worker-ui main { padding-bottom: 5.5rem !important; }
.task-card { border-left: 5px solid #adb5bd; }
.task-card.status-available { border-left-color: #0dcaf0; }
.task-card.status-in_progress { border-left-color: #0d6efd; }
.task-card.status-paused { border-left-color: #ffc107; }
.task-card a.stretched-link { z-index: 1; }
.task-card-current { background: #eef4ff; box-shadow: 0 0 0 2px #0d6efd inset, 0 .125rem .25rem rgba(0,0,0,.075) !important; }
.btn-touch { padding: .9rem 1rem; font-size: 1.15rem; }
.worker-tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #212529; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.worker-tabbar a { flex: 1; color: #adb5bd; text-decoration: none; display: flex; flex-direction: column; align-items: center; padding: .45rem 0; font-size: .75rem; }
.worker-tabbar a i { font-size: 1.4rem; }
.worker-tabbar a.active { color: #fff; }
.worker-tabbar a.tab-photo i { background: #dc3545; color: #fff; border-radius: 50%; width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; margin-top: -1.2rem; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.fab-photo { position: fixed; right: 1.25rem; bottom: 1.5rem; width: 4rem; height: 4rem; border-radius: 50%; font-size: 1.7rem; z-index: 1020; box-shadow: 0 3px 10px rgba(0,0,0,.3); display: none; align-items: center; justify-content: center; }
@media (min-width: 992px) { .worker-ui .fab-photo { display: flex; } }

.branch-select { min-width: 11rem; }
.branch-badge { background: #f1e7ff; color: #59359a; font-weight: 500; }

/* QR */
.qr-svg { width: 100%; height: auto; display: block; }
.qr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.qr-card { background: #fff; border: 1px dashed #adb5bd; border-radius: .5rem; padding: 1rem; text-align: center; break-inside: avoid; }
.qr-card .qr-box { max-width: 200px; margin: 0 auto .5rem; }
#qr-video { width: 100%; max-width: 420px; border-radius: .5rem; background: #000; }
@media print { body { background: #fff; } .qr-card { border-color: #666; } }

/* Индикатор живого обновления */
#live-indicator { font-size: .7rem; color: #75b798; }
#live-indicator.live-pulse { animation: live-pulse 1.2s ease-out; }
@keyframes live-pulse { 0% { color: #20c997; text-shadow: 0 0 8px #20c997; } 100% { color: #75b798; text-shadow: none; } }

@media print {
  nav, .worker-tabbar, .no-print { display: none !important; }
}
