/* mobile-first поверх Pico.css */
:root { --pico-font-size: 106%; }
html, body { overflow-x: hidden; }
.container { padding-inline: 16px; }

button, [role="button"], input:not([type="checkbox"]):not([type="radio"]), select, textarea, a.card {
  min-height: 44px;
}
input[type="checkbox"], input[type="radio"] { width: 1.4rem; height: 1.4rem; }
label.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; }

.topnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.navlinks li { padding: 0; margin: 0; }
.navlinks a { display: inline-flex; align-items: center; min-height: 44px; }
.who { font-size: .85rem; color: var(--pico-muted-color); }
form.inline { margin: 0; }
form.inline button { margin: 0; width: auto; padding-block: .4rem; }

.narrow { max-width: 28rem; margin-inline: auto; }
.error { color: #b3261e; font-weight: 600; }
mark.bad { background: #fbd0cc; color: #7a1410; }
mark.ok { background: #cdeccd; color: #14501a; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 32rem; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
a.card {
  display: flex; flex-direction: column; justify-content: center; gap: .2rem;
  padding: .9rem 1rem; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius);
  text-decoration: none;
}
.temp-password { font-size: 1.4rem; padding: .3rem .6rem; user-select: all; }
.field-error { color: #b3261e; display: block; margin-top: -.5rem; margin-bottom: .75rem; }

/* ---- этап 3 ---- */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--pico-muted-border-color); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a.active { border-bottom-color: var(--pico-primary); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; margin-top: 1rem; }
.obj-card { align-items: flex-start; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 1rem; font-size: .8rem; background: #e3e8ef; color: #223; }
.status-in_progress { background: #d6ecff; }
.status-done { background: #cdeccd; }
.status-paused { background: #fde7b8; }
.filters { display: grid; gap: .5rem; margin-bottom: 1rem; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ok-note { background: #e6f6e6; border-left: 4px solid #2e7d32; padding: .6rem .9rem; }
.lookup { max-height: 16rem; overflow-y: auto; margin-bottom: 1rem; }
.lookup-item { border-bottom: 1px solid var(--pico-muted-border-color); }
.lookup-btn { display: block; width: 100%; text-align: left; margin-bottom: .35rem; }
.lookup-box { display: grid; gap: .5rem; }
.totals table td:last-child { text-align: right; white-space: nowrap; }
.total-row td { border-top: 2px solid var(--pico-muted-border-color); font-size: 1.1rem; }
.over { color: #b3261e; font-weight: 600; }
.actions-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.actions-row form, .actions-row a { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--pico-border-radius); }
td.num { text-align: right; white-space: nowrap; }

/* права доступа */
.perm-table th { background: var(--pico-card-sectioning-background-color, #f3f5f8); }
.perm-table td:last-child { white-space: nowrap; font-weight: 600; }
.perm-yes { color: #1b6e2a; }
.perm-limited { color: #8a5a00; }
.perm-no { color: #9a2a22; }
.perm-objects { margin-top: 0; }

.drawings { list-style: none; padding-left: 0; }
.drawings li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: 44px; border-bottom: 1px solid var(--pico-muted-border-color); }
.drawings form { margin: 0; }
.drawings-box { margin-bottom: 1rem; }
.fin-summary table td:last-child { text-align: right; white-space: nowrap; }
.receipt-line { border-bottom: 1px solid var(--pico-muted-border-color); padding: .5rem 0; }
.receipt-line select, .receipt-line input { margin-bottom: .4rem; }
.receipt-img { max-width: 100%; height: auto; border-radius: var(--pico-border-radius); }
.camera-row { display: grid; gap: .5rem; margin-bottom: 1rem; }
a.btn-like, label.btn-like { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--pico-primary); border-radius: var(--pico-border-radius); cursor: pointer; text-align: center; }

/* заявки и план работ */
.req-draft { background: #e3e8ef; }
.req-submitted { background: #fde7b8; }
.req-approved { background: #d6ecff; }
.req-ordered { background: #e1d8f5; }
.req-delivered { background: #cdeccd; }
.req-cancelled { background: #fbd0cc; }
.inline-edit { display: flex; align-items: center; gap: .4rem; margin: 0; }
.inline-edit input { width: 6rem; margin: 0; }
.plan-day { margin-top: 1rem; }
.plan-day h4 { margin-bottom: .25rem; }
.plan-today h4::after { content: " · сегодня"; color: var(--pico-primary); font-weight: 400; }
.plan-ok { color: #1b6e2a; }
.plan-late { color: #b3261e; font-weight: 600; }
progress.plan-bar { height: .5rem; margin: 0; width: 6rem; }

.plan-actions { margin: .35rem 0 0; }
.plan-actions summary { font-size: .85rem; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.plan-actions form { margin: .5rem 0 1rem; padding-bottom: .75rem; border-bottom: 1px dashed var(--pico-muted-border-color); }
.plan-overdue { border-left: 4px solid #b3261e; }
tr.plan-closed td { background: rgba(46, 125, 50, .06); }

.tab-badge { display: inline-block; min-width: 1.4rem; margin-left: .4rem; padding: .05rem .45rem; border-radius: 1rem; font-size: .75rem; font-weight: 600; text-align: center; color: #fff; }
.tab-badge-red { background: #d32f2f; }
.tab-badge-green { background: #2e7d32; }
