/* EcoBox Ops mobile shell. Tokens live in tokens.css (copied from app-4.5). */
html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body { padding-bottom: 72px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-light); }

.ops-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 12px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
}
.ops-brand { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.ops-brand small { display: block; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.ops-header-grow { flex: 1; }
.ops-phase {
    display: flex;
    background: var(--bg-input);
    border-radius: 999px;
    padding: 2px;
}
.ops-phase button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
}
.ops-phase button.is-on { background: var(--accent-gradient); color: #fff; }

.ops-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
}
.ops-sync.is-off { background: rgba(245, 158, 11, 0.12); color: var(--warning-light); }
.ops-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
}
.ops-sync.is-off .ops-dot { background: var(--warning); }
.ops-sync button {
    margin-left: auto;
    min-height: 32px;
    border: 1px solid var(--border-medium);
    background: transparent;
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-primary);
}

.ops-main { padding: 12px; max-width: 720px; margin: 0 auto; }

.ops-tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    background: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
    padding: 4px 4px env(safe-area-inset-bottom);
    z-index: 30;
}
.ops-tabs button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    min-height: 56px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.ops-tabs button.is-on { color: var(--accent-light); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.card.is-pending { box-shadow: inset 3px 0 0 var(--warning); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--text-secondary); font-size: 13px; }
.title { font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.sub { color: var(--text-muted); font-size: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}
.btn + .btn { margin-top: 8px; }
.btn-primary { background: var(--accent-gradient); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-medium); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-medium);
    background: var(--bg-input);
}
.field textarea { min-height: 88px; resize: vertical; }

.seg { display: flex; background: var(--bg-input); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.seg button {
    flex: 1; border: 0; background: transparent; min-height: 36px;
    border-radius: 999px; color: var(--text-secondary); font-weight: 600; font-size: 13px;
}
.seg button.is-on { background: var(--accent-gradient); color: #fff; }

.status-pill, .pill {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.pill-ok { background: rgba(34,197,94,0.15); color: var(--success-light); }
.pill-warn { background: rgba(245,158,11,0.15); color: var(--warning-light); }
.pill-err { background: rgba(239,68,68,0.15); color: var(--danger-light); }
.pill-info { background: rgba(59,130,246,0.15); color: var(--secondary-light); }
.pill-muted { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; }
.tile .n { font-size: 28px; font-weight: 800; line-height: 1.1; }
.tile .l { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

.empty { text-align: center; padding: 36px 16px; color: var(--text-secondary); }
.skel { height: 72px; border-radius: 12px; background: linear-gradient(90deg, #162040, #1c2a52, #162040); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 10px; }
@keyframes sk { 0% { background-position: 0 0; } 100% { background-position: 200% 0; } }

.sheet-back {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40;
    display: flex; align-items: flex-end;
}
.sheet {
    width: 100%; max-height: 92vh; overflow: auto;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.toast-host { position: fixed; left: 12px; right: 12px; bottom: 80px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1E293B; border: 1px solid var(--border-medium); padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.toast.ok { border-color: rgba(34,197,94,0.4); }
.toast.err { border-color: rgba(239,68,68,0.5); }

.sig-wrap { border: 1px dashed var(--border-medium); border-radius: 10px; background: #fff; }
.sig-wrap canvas { width: 100%; height: 160px; display: block; }

.scan-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.scan-bar input { flex: 1; min-height: 48px; border-radius: 8px; border: 1px solid var(--border-medium); background: var(--bg-input); padding: 0 12px; }
.scan-bar button { min-width: 72px; }

.check { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.check input { width: 22px; height: 22px; }

.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
